Module Name:    src
Committed By:   thorpej
Date:           Sun Mar 28 19:42:59 UTC 2021

Modified Files:
        src/sys/arch/x86/pci/imcsmb [thorpej-cfargs]: imc.c imcsmb.c

Log Message:
- 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.


To generate a diff of this commit:
cvs rdiff -u -r1.2.16.1 -r1.2.16.2 src/sys/arch/x86/pci/imcsmb/imc.c
cvs rdiff -u -r1.3.10.1 -r1.3.10.2 src/sys/arch/x86/pci/imcsmb/imcsmb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x86/pci/imcsmb/imc.c
diff -u src/sys/arch/x86/pci/imcsmb/imc.c:1.2.16.1 src/sys/arch/x86/pci/imcsmb/imc.c:1.2.16.2
--- src/sys/arch/x86/pci/imcsmb/imc.c:1.2.16.1	Tue Mar 23 07:14:51 2021
+++ src/sys/arch/x86/pci/imcsmb/imc.c	Sun Mar 28 19:42:59 2021
@@ -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 @@ imc_attach(device_t parent, device_t sel
 {
 	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 @@ imc_attach(device_t parent, device_t sel
 		}
 	}
 
-	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 @@ imc_rescan(device_t self, const char * i
 		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;

Index: src/sys/arch/x86/pci/imcsmb/imcsmb.c
diff -u src/sys/arch/x86/pci/imcsmb/imcsmb.c:1.3.10.1 src/sys/arch/x86/pci/imcsmb/imcsmb.c:1.3.10.2
--- src/sys/arch/x86/pci/imcsmb/imcsmb.c:1.3.10.1	Tue Mar 23 01:29:32 2021
+++ src/sys/arch/x86/pci/imcsmb/imcsmb.c	Sun Mar 28 19:42:59 2021
@@ -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 @@ imcsmb_attach(device_t parent, device_t 
 }
 
 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 @@ imcsmb_rescan(device_t self, const char 
 
 	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");

Reply via email to