Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/x86/pci/imcsmb x86/imc(4): Use config_detach_children.



details:   https://anonhg.NetBSD.org/src/rev/2bac686d82dc
branches:  trunk
changeset: 374684:2bac686d82dc
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed May 10 00:07:49 2023 +0000

description:
x86/imc(4): Use config_detach_children.

diffstat:

 sys/arch/x86/pci/imcsmb/imc.c    |  17 ++++++-----------
 sys/arch/x86/pci/imcsmb/imcsmb.c |  14 ++++++--------
 2 files changed, 12 insertions(+), 19 deletions(-)

diffs (76 lines):

diff -r 1325e692ab39 -r 2bac686d82dc sys/arch/x86/pci/imcsmb/imc.c
--- a/sys/arch/x86/pci/imcsmb/imc.c     Tue May 09 23:11:09 2023 +0000
+++ b/sys/arch/x86/pci/imcsmb/imc.c     Wed May 10 00:07:49 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: imc.c,v 1.5 2022/09/28 10:09:48 msaitoh Exp $ */
+/* $NetBSD: imc.c,v 1.6 2023/05/10 00:07:49 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: imc.c,v 1.5 2022/09/28 10:09:48 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imc.c,v 1.6 2023/05/10 00:07:49 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -259,16 +259,11 @@ imc_rescan(device_t self, const char *if
 static int
 imc_detach(device_t self, int flags)
 {
-       struct imc_softc *sc = device_private(self);
-       int i, error;
+       int error;
 
-       for (i = 0; i < 2; i++) {
-               if (sc->sc_smbchild[i] != NULL) {
-                       error = config_detach(sc->sc_smbchild[i], flags);     
-                       if (error)
-                               return error;
-               }
-       }
+       error = config_detach_children(self, flags);
+       if (error)
+               return error;
 
        pmf_device_deregister(self);
        return 0;
diff -r 1325e692ab39 -r 2bac686d82dc sys/arch/x86/pci/imcsmb/imcsmb.c
--- a/sys/arch/x86/pci/imcsmb/imcsmb.c  Tue May 09 23:11:09 2023 +0000
+++ b/sys/arch/x86/pci/imcsmb/imcsmb.c  Wed May 10 00:07:49 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: imcsmb.c,v 1.5 2021/08/07 16:19:08 thorpej Exp $ */
+/* $NetBSD: imcsmb.c,v 1.6 2023/05/10 00:07:49 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: imcsmb.c,v 1.5 2021/08/07 16:19:08 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imcsmb.c,v 1.6 2023/05/10 00:07:49 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -182,14 +182,12 @@ imcsmb_chdet(device_t self, device_t chi
 static int
 imcsmb_detach(device_t self, int flags)
 {
+       struct imcsmb_softc *sc = device_private(self);
        int error;
-       struct imcsmb_softc *sc = device_private(self);
 
-       if (sc->sc_smbus != NULL) {
-               error = config_detach(sc->sc_smbus, flags);
-               if (error)
-                       return error;
-       }
+       error = config_detach_children(self, flags);
+       if (error)
+               return error;
 
        pmf_device_deregister(self);
        iic_tag_fini(&sc->sc_i2c_tag);



Home | Main Index | Thread Index | Old Index