Source-Changes-HG archive

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

[src/thorpej-cfargs]: src/sys/arch/x86/pci/imcsmb - The third argument passed...



details:   https://anonhg.NetBSD.org/src/rev/57756248aca5
branches:  thorpej-cfargs
changeset: 981692:57756248aca5
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sun Mar 28 19:42:59 2021 +0000

description:
- The third argument passed to the rescan function is a locs array, not
  a pointer to flags.
- imc and imcsmb each carry only a single interface attribute, so no
  need to be explicit.

diffstat:

 sys/arch/x86/pci/imcsmb/imc.c    |  22 +++++++---------------
 sys/arch/x86/pci/imcsmb/imcsmb.c |   8 ++++----
 2 files changed, 11 insertions(+), 19 deletions(-)

diffs (104 lines):

diff -r abca0cdefaaf -r 57756248aca5 sys/arch/x86/pci/imcsmb/imc.c
--- a/sys/arch/x86/pci/imcsmb/imc.c     Sun Mar 28 01:03:19 2021 +0000
+++ b/sys/arch/x86/pci/imcsmb/imc.c     Sun Mar 28 19:42:59 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: imc.c,v 1.2.16.1 2021/03/23 07:14:51 thorpej Exp $ */
+/* $NetBSD: imc.c,v 1.2.16.2 2021/03/28 19:42:59 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: imc.c,v 1.2.16.1 2021/03/23 07:14:51 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imc.c,v 1.2.16.2 2021/03/28 19:42:59 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -206,7 +206,7 @@
 {
        struct imc_softc *sc = device_private(self);
        struct pci_attach_args *pa = aux;
-       int flags, i;
+       int i;
 
        sc->sc_dev = self;
        sc->sc_pci_tag = pa->pa_tag;
@@ -222,22 +222,19 @@
                }
        }
 
-       flags = 0;
-
        if (!pmf_device_register(self, NULL, NULL))
                aprint_error_dev(self, "couldn't establish power handler\n");
 
-       imc_rescan(self, "imc", &flags);
+       imc_rescan(self, NULL, NULL);
 }
 
 /* Create the imcsmbX children */
 
 static int
-imc_rescan(device_t self, const char * ifattr, const int *flags)
+imc_rescan(device_t self, const char *ifattr, const int *locs)
 {
        struct imc_softc *sc = device_private(self);
        struct imc_attach_args imca;
-       device_t child;
        int unit;
 
        for (unit = 0; unit < 2; unit++) {
@@ -248,13 +245,8 @@
                imca.ia_regs = &imcsmb_regs[unit];
                imca.ia_pci_tag = sc->sc_pci_tag;
                imca.ia_pci_chipset_tag = sc->sc_pci_chipset_tag;
-               child = config_found(self, &imca, NULL, CFARG_EOL);
-
-               if (child == NULL) {
-                       aprint_debug_dev(self, "Child %d imcsmb not added\n",
-                           unit);
-               }
-               sc->sc_smbchild[unit] = child;
+               sc->sc_smbchild[unit] =
+                   config_found(self, &imca, NULL, CFARG_EOL);
        }
 
        return 0;
diff -r abca0cdefaaf -r 57756248aca5 sys/arch/x86/pci/imcsmb/imcsmb.c
--- a/sys/arch/x86/pci/imcsmb/imcsmb.c  Sun Mar 28 01:03:19 2021 +0000
+++ b/sys/arch/x86/pci/imcsmb/imcsmb.c  Sun Mar 28 19:42:59 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: imcsmb.c,v 1.3.10.1 2021/03/23 01:29:32 thorpej Exp $ */
+/* $NetBSD: imcsmb.c,v 1.3.10.2 2021/03/28 19:42:59 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: imcsmb.c,v 1.3.10.1 2021/03/23 01:29:32 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imcsmb.c,v 1.3.10.2 2021/03/28 19:42:59 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -138,7 +138,7 @@
 }
 
 static int
-imcsmb_rescan(device_t self, const char *ifattr, const int *flags)
+imcsmb_rescan(device_t self, const char *ifattr, const int *locs)
 {
        struct imcsmb_softc *sc = device_private(self);
        struct i2cbus_attach_args iba;
@@ -155,7 +155,7 @@
 
        memset(&iba, 0, sizeof(iba));
        iba.iba_tag = &sc->sc_i2c_tag;
-       sc->sc_smbus = config_found_ia(self, ifattr, &iba, iicbus_print);
+       sc->sc_smbus = config_found(self, &iba, iicbus_print, CFARG_EOL);
 
        if (sc->sc_smbus == NULL) {
                aprint_normal_dev(self, "no child found\n");



Home | Main Index | Thread Index | Old Index