Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Jul 2024 04:49:05 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: a05a680469a7 - main - newbus: replace -1 in BUS_ADD_CHILD(...-1) with DEVICE_UNIT_ANY
Message-ID:  <202407250449.46P4n5bq032051@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=a05a680469a7ac77b195021fed74e3aa58152dd7

commit a05a680469a7ac77b195021fed74e3aa58152dd7
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2024-07-25 04:23:02 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-07-25 04:23:02 +0000

    newbus: replace -1 in BUS_ADD_CHILD(...-1) with DEVICE_UNIT_ANY
    
    Sponsored by:           Netflix
---
 sys/arm64/nvidia/tegra210/max77620_rtc.c          |  2 +-
 sys/crypto/openssl/ossl.c                         |  2 +-
 sys/dev/acpica/acpi.c                             |  2 +-
 sys/dev/amdsbwd/amdsbwd.c                         |  2 +-
 sys/dev/bhnd/bcma/bcma.c                          |  2 +-
 sys/dev/bhnd/bhndb/bhndb.c                        |  2 +-
 sys/dev/bhnd/cores/chipc/chipc.c                  | 12 ++++++------
 sys/dev/bhnd/cores/chipc/chipc_spi.c              |  2 +-
 sys/dev/bhnd/siba/siba.c                          |  2 +-
 sys/dev/cfe/cfe_resource.c                        |  2 +-
 sys/dev/chromebook_platform/chromebook_platform.c |  2 +-
 sys/dev/etherswitch/e6000sw/e6000sw.c             |  2 +-
 sys/dev/etherswitch/etherswitch.c                 |  2 +-
 sys/dev/etherswitch/ip17x/ip17x.c                 |  2 +-
 sys/dev/etherswitch/miiproxy.c                    |  2 +-
 sys/dev/etherswitch/rtl8366/rtl8366rb.c           |  2 +-
 sys/dev/firewire/firewire.c                       |  2 +-
 sys/dev/firewire/sbp.c                            |  2 +-
 sys/dev/hid/hidbus.c                              |  2 +-
 sys/dev/iicbus/acpi_iicbus.c                      |  2 +-
 sys/dev/iicbus/iic.c                              |  2 +-
 sys/dev/iicbus/iicsmb.c                           |  2 +-
 sys/dev/ipmi/ipmi_isa.c                           |  2 +-
 sys/dev/ipmi/ipmi_smbus.c                         |  2 +-
 sys/dev/isl/isl.c                                 |  2 +-
 sys/dev/mdio/mdio.c                               |  2 +-
 sys/dev/nvdimm/nvdimm_acpi.c                      |  2 +-
 sys/dev/nvdimm/nvdimm_e820.c                      |  2 +-
 sys/dev/ppbus/if_plip.c                           |  2 +-
 sys/dev/ppbus/lpbb.c                              |  2 +-
 sys/dev/ppbus/lpt.c                               |  2 +-
 sys/dev/ppbus/pcfclock.c                          |  2 +-
 sys/dev/ppbus/ppi.c                               |  2 +-
 sys/dev/ppbus/pps.c                               |  2 +-
 sys/dev/smbios/smbios.c                           |  2 +-
 sys/dev/smbus/smb.c                               |  2 +-
 sys/dev/superio/superio.c                         |  2 +-
 sys/i386/bios/smapi.c                             |  2 +-
 sys/i386/i386/bios.c                              |  2 +-
 sys/isa/pnp.c                                     |  2 +-
 sys/powerpc/mpc85xx/atpic.c                       |  2 +-
 sys/x86/bios/vpd.c                                |  2 +-
 sys/x86/isa/orm.c                                 |  2 +-
 sys/x86/pci/qpi.c                                 |  2 +-
 44 files changed, 49 insertions(+), 49 deletions(-)

diff --git a/sys/arm64/nvidia/tegra210/max77620_rtc.c b/sys/arm64/nvidia/tegra210/max77620_rtc.c
index dc82d4b387b9..29808af27819 100644
--- a/sys/arm64/nvidia/tegra210/max77620_rtc.c
+++ b/sys/arm64/nvidia/tegra210/max77620_rtc.c
@@ -385,7 +385,7 @@ max77620_rtc_create(struct max77620_softc *sc, phandle_t node)
 
 	parent = device_get_parent(sc->dev);
 
-	child = BUS_ADD_CHILD(parent, 0, NULL, -1);
+	child = BUS_ADD_CHILD(parent, 0, NULL, DEVICE_UNIT_ANY);
 	if (child == NULL)	{
 		device_printf(sc->dev, "Cannot create MAX77620 RTC device.\n");
 		return (ENXIO);
diff --git a/sys/crypto/openssl/ossl.c b/sys/crypto/openssl/ossl.c
index 031f447e45a5..c2ca28133a78 100644
--- a/sys/crypto/openssl/ossl.c
+++ b/sys/crypto/openssl/ossl.c
@@ -57,7 +57,7 @@ ossl_identify(driver_t *driver, device_t parent)
 {
 
 	if (device_find_child(parent, "ossl", -1) == NULL)
-		BUS_ADD_CHILD(parent, 10, "ossl", -1);
+		BUS_ADD_CHILD(parent, 10, "ossl", DEVICE_UNIT_ANY);
 }
 
 static int
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c
index 91a1636f2808..b7d7277eb310 100644
--- a/sys/dev/acpica/acpi.c
+++ b/sys/dev/acpica/acpi.c
@@ -2396,7 +2396,7 @@ acpi_probe_child(ACPI_HANDLE handle, UINT32 level, void *context, void **status)
 	    ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "scanning '%s'\n", handle_str));
 	    order = level * 10 + ACPI_DEV_BASE_ORDER;
 	    acpi_probe_order(handle, &order);
-	    child = BUS_ADD_CHILD(bus, order, NULL, -1);
+	    child = BUS_ADD_CHILD(bus, order, NULL, DEVICE_UNIT_ANY);
 	    if (child == NULL)
 		break;
 
diff --git a/sys/dev/amdsbwd/amdsbwd.c b/sys/dev/amdsbwd/amdsbwd.c
index 1dfe6c1b11bf..122fa2d58277 100644
--- a/sys/dev/amdsbwd/amdsbwd.c
+++ b/sys/dev/amdsbwd/amdsbwd.c
@@ -271,7 +271,7 @@ amdsbwd_identify(driver_t *driver, device_t parent)
 	    pci_get_devid(smb_dev) != HYGONCZ_SMBUS_DEVID)
 		return;
 
-	child = BUS_ADD_CHILD(parent, ISA_ORDER_SPECULATIVE, "amdsbwd", -1);
+	child = BUS_ADD_CHILD(parent, ISA_ORDER_SPECULATIVE, "amdsbwd", DEVICE_UNIT_ANY);
 	if (child == NULL)
 		device_printf(parent, "add amdsbwd child failed\n");
 }
diff --git a/sys/dev/bhnd/bcma/bcma.c b/sys/dev/bhnd/bcma/bcma.c
index c9df03cfb504..9ce4bf04a1c5 100644
--- a/sys/dev/bhnd/bcma/bcma.c
+++ b/sys/dev/bhnd/bcma/bcma.c
@@ -678,7 +678,7 @@ bcma_add_children(device_t bus)
 	bcma_erom = (struct bcma_erom *)erom;
 	while ((error = bcma_erom_next_corecfg(bcma_erom, &corecfg)) == 0) {
 		/* Add the child device */
-		child = BUS_ADD_CHILD(bus, 0, NULL, -1);
+		child = BUS_ADD_CHILD(bus, 0, NULL, DEVICE_UNIT_ANY);
 		if (child == NULL) {
 			error = ENXIO;
 			goto cleanup;
diff --git a/sys/dev/bhnd/bhndb/bhndb.c b/sys/dev/bhnd/bhndb/bhndb.c
index af62057690ac..eeff088ffdde 100644
--- a/sys/dev/bhnd/bhndb/bhndb.c
+++ b/sys/dev/bhnd/bhndb/bhndb.c
@@ -558,7 +558,7 @@ bhndb_attach(device_t dev, struct bhnd_chipid *cid,
 	}
 
 	/* Add our bridged bus device */
-	sc->bus_dev = BUS_ADD_CHILD(dev, BHND_PROBE_BUS, "bhnd", -1);
+	sc->bus_dev = BUS_ADD_CHILD(dev, BHND_PROBE_BUS, "bhnd", DEVICE_UNIT_ANY);
 	if (sc->bus_dev == NULL) {
 		error = ENXIO;
 		goto failed;
diff --git a/sys/dev/bhnd/cores/chipc/chipc.c b/sys/dev/bhnd/cores/chipc/chipc.c
index 60cb04400cb0..a7da4ec9b7fc 100644
--- a/sys/dev/bhnd/cores/chipc/chipc.c
+++ b/sys/dev/bhnd/cores/chipc/chipc.c
@@ -270,7 +270,7 @@ chipc_add_children(struct chipc_softc *sc)
 	if (sc->caps.nvram_src == BHND_NVRAM_SRC_SPROM ||
 	    sc->caps.nvram_src == BHND_NVRAM_SRC_OTP)
 	{
-		child = BUS_ADD_CHILD(sc->dev, 0, "bhnd_nvram", -1);
+		child = BUS_ADD_CHILD(sc->dev, 0, "bhnd_nvram", DEVICE_UNIT_ANY);
 		if (child == NULL) {
 			device_printf(sc->dev, "failed to add nvram device\n");
 			return (ENXIO);
@@ -293,13 +293,13 @@ chipc_add_children(struct chipc_softc *sc)
 	 * attached directly to the bhnd(4) bus -- not chipc.
 	 */
 	if (sc->caps.pmu && !sc->caps.aob) {
-		child = BUS_ADD_CHILD(sc->dev, 0, "bhnd_pmu", -1);
+		child = BUS_ADD_CHILD(sc->dev, 0, "bhnd_pmu", DEVICE_UNIT_ANY);
 		if (child == NULL) {
 			device_printf(sc->dev, "failed to add pmu\n");
 			return (ENXIO);
 		}
 	} else if (sc->caps.pwr_ctrl) {
-		child = BUS_ADD_CHILD(sc->dev, 0, "bhnd_pwrctl", -1);
+		child = BUS_ADD_CHILD(sc->dev, 0, "bhnd_pwrctl", DEVICE_UNIT_ANY);
 		if (child == NULL) {
 			device_printf(sc->dev, "failed to add pwrctl\n");
 			return (ENXIO);
@@ -307,7 +307,7 @@ chipc_add_children(struct chipc_softc *sc)
 	}
 
 	/* GPIO */
-	child = BUS_ADD_CHILD(sc->dev, 0, "gpio", -1);
+	child = BUS_ADD_CHILD(sc->dev, 0, "gpio", DEVICE_UNIT_ANY);
 	if (child == NULL) {
 		device_printf(sc->dev, "failed to add gpio\n");
 		return (ENXIO);
@@ -331,7 +331,7 @@ chipc_add_children(struct chipc_softc *sc)
 		irq_rid = 0;
 		mem_rid = 0;
 
-		child = BUS_ADD_CHILD(sc->dev, 0, "uart", -1);
+		child = BUS_ADD_CHILD(sc->dev, 0, "uart", DEVICE_UNIT_ANY);
 		if (child == NULL) {
 			device_printf(sc->dev, "failed to add uart%u\n", i);
 			return (ENXIO);
@@ -360,7 +360,7 @@ chipc_add_children(struct chipc_softc *sc)
 	if (flash_bus != NULL) {
 		int rid;
 
-		child = BUS_ADD_CHILD(sc->dev, 0, flash_bus, -1);
+		child = BUS_ADD_CHILD(sc->dev, 0, flash_bus, DEVICE_UNIT_ANY);
 		if (child == NULL) {
 			device_printf(sc->dev, "failed to add %s device\n",
 			    flash_bus);
diff --git a/sys/dev/bhnd/cores/chipc/chipc_spi.c b/sys/dev/bhnd/cores/chipc/chipc_spi.c
index 75e4b5cb7bc4..46b445cf0756 100644
--- a/sys/dev/bhnd/cores/chipc/chipc_spi.c
+++ b/sys/dev/bhnd/cores/chipc/chipc_spi.c
@@ -122,7 +122,7 @@ chipc_spi_attach(device_t dev)
 	ccaps = BHND_CHIPC_GET_CAPS(device_get_parent(dev));
 	flash_name = chipc_sflash_device_name(ccaps->flash_type);
 	if (flash_name != NULL) {
-		flash_dev = BUS_ADD_CHILD(spibus, 0, flash_name, -1);
+		flash_dev = BUS_ADD_CHILD(spibus, 0, flash_name, DEVICE_UNIT_ANY);
 		if (flash_dev == NULL) {
 			device_printf(dev, "failed to add %s\n", flash_name);
 			error = ENXIO;
diff --git a/sys/dev/bhnd/siba/siba.c b/sys/dev/bhnd/siba/siba.c
index 2688f3415aa5..e693481f0819 100644
--- a/sys/dev/bhnd/siba/siba.c
+++ b/sys/dev/bhnd/siba/siba.c
@@ -1318,7 +1318,7 @@ siba_add_children(device_t dev)
 			goto failed;
 
 		/* Add the child device */
-		child = BUS_ADD_CHILD(dev, 0, NULL, -1);
+		child = BUS_ADD_CHILD(dev, 0, NULL, DEVICE_UNIT_ANY);
 		if (child == NULL) {
 			error = ENXIO;
 			goto failed;
diff --git a/sys/dev/cfe/cfe_resource.c b/sys/dev/cfe/cfe_resource.c
index d5047e045f37..78c5f149ba7d 100644
--- a/sys/dev/cfe/cfe_resource.c
+++ b/sys/dev/cfe/cfe_resource.c
@@ -81,7 +81,7 @@ cferes_identify(driver_t* driver, device_t parent)
 	struct cferes_softc	*sc;
 	uint64_t		 addr, len, type;
 
-	child = BUS_ADD_CHILD(parent, 100, "cferes", -1);
+	child = BUS_ADD_CHILD(parent, 100, "cferes", DEVICE_UNIT_ANY);
 	device_set_driver(child, driver);
 	sc = device_get_softc(child);
 
diff --git a/sys/dev/chromebook_platform/chromebook_platform.c b/sys/dev/chromebook_platform/chromebook_platform.c
index cd5ad76a8701..935685d86955 100644
--- a/sys/dev/chromebook_platform/chromebook_platform.c
+++ b/sys/dev/chromebook_platform/chromebook_platform.c
@@ -74,7 +74,7 @@ chromebook_i2c_identify(driver_t *driver, device_t bus)
 			continue;
 		if (slaves[i].pci_id != pci_get_devid(controller))
 			continue;
-		child = BUS_ADD_CHILD(bus, 0, slaves[i].name, -1);
+		child = BUS_ADD_CHILD(bus, 0, slaves[i].name, DEVICE_UNIT_ANY);
 		if (child != NULL)
 			iicbus_set_addr(child, slaves[i].addr);
 	}
diff --git a/sys/dev/etherswitch/e6000sw/e6000sw.c b/sys/dev/etherswitch/e6000sw/e6000sw.c
index 3b309f7f36f8..4e95287399e3 100644
--- a/sys/dev/etherswitch/e6000sw/e6000sw.c
+++ b/sys/dev/etherswitch/e6000sw/e6000sw.c
@@ -205,7 +205,7 @@ e6000sw_identify(driver_t *driver, device_t parent)
 {
 
 	if (device_find_child(parent, "e6000sw", -1) == NULL)
-		BUS_ADD_CHILD(parent, 0, "e6000sw", -1);
+		BUS_ADD_CHILD(parent, 0, "e6000sw", DEVICE_UNIT_ANY);
 }
 
 static int
diff --git a/sys/dev/etherswitch/etherswitch.c b/sys/dev/etherswitch/etherswitch.c
index 74afcd259007..c66918f77174 100644
--- a/sys/dev/etherswitch/etherswitch.c
+++ b/sys/dev/etherswitch/etherswitch.c
@@ -83,7 +83,7 @@ static void
 etherswitch_identify(driver_t *driver, device_t parent)
 {
 	if (device_find_child(parent, "etherswitch", -1) == NULL)
-		BUS_ADD_CHILD(parent, 0, "etherswitch", -1);
+		BUS_ADD_CHILD(parent, 0, "etherswitch", DEVICE_UNIT_ANY);
 }
 
 static int
diff --git a/sys/dev/etherswitch/ip17x/ip17x.c b/sys/dev/etherswitch/ip17x/ip17x.c
index 5e07e1f72b80..349dc59e09ae 100644
--- a/sys/dev/etherswitch/ip17x/ip17x.c
+++ b/sys/dev/etherswitch/ip17x/ip17x.c
@@ -84,7 +84,7 @@ static void
 ip17x_identify(driver_t *driver, device_t parent)
 {
 	if (device_find_child(parent, "ip17x", -1) == NULL)
-	    BUS_ADD_CHILD(parent, 0, "ip17x", -1);
+	    BUS_ADD_CHILD(parent, 0, "ip17x", DEVICE_UNIT_ANY);
 }
 
 static int
diff --git a/sys/dev/etherswitch/miiproxy.c b/sys/dev/etherswitch/miiproxy.c
index 24822b15f89e..3a621eae0875 100644
--- a/sys/dev/etherswitch/miiproxy.c
+++ b/sys/dev/etherswitch/miiproxy.c
@@ -331,7 +331,7 @@ static void
 mdioproxy_identify(driver_t *driver, device_t parent)
 {
 	if (device_find_child(parent, driver->name, -1) == NULL) {
-		BUS_ADD_CHILD(parent, 0, driver->name, -1);
+		BUS_ADD_CHILD(parent, 0, driver->name, DEVICE_UNIT_ANY);
 	}
 }
 
diff --git a/sys/dev/etherswitch/rtl8366/rtl8366rb.c b/sys/dev/etherswitch/rtl8366/rtl8366rb.c
index 761a96b0ec80..e57b11f3270f 100644
--- a/sys/dev/etherswitch/rtl8366/rtl8366rb.c
+++ b/sys/dev/etherswitch/rtl8366/rtl8366rb.c
@@ -134,7 +134,7 @@ rtl8366rb_identify(driver_t *driver, device_t parent)
 	struct iicbus_ivar *devi;
 
 	if (device_find_child(parent, "rtl8366rb", -1) == NULL) {
-		child = BUS_ADD_CHILD(parent, 0, "rtl8366rb", -1);
+		child = BUS_ADD_CHILD(parent, 0, "rtl8366rb", DEVICE_UNIT_ANY);
 		devi = IICBUS_IVAR(child);
 		devi->addr = RTL8366_IIC_ADDR;
 	}
diff --git a/sys/dev/firewire/firewire.c b/sys/dev/firewire/firewire.c
index 4bb683cccfb7..93a414405c17 100644
--- a/sys/dev/firewire/firewire.c
+++ b/sys/dev/firewire/firewire.c
@@ -314,7 +314,7 @@ fw_asystart(struct fw_xfer *xfer)
 static void
 firewire_identify(driver_t *driver, device_t parent)
 {
-	BUS_ADD_CHILD(parent, 0, "firewire", -1);
+	BUS_ADD_CHILD(parent, 0, "firewire", DEVICE_UNIT_ANY);
 }
 
 static int
diff --git a/sys/dev/firewire/sbp.c b/sys/dev/firewire/sbp.c
index 5f4ebb747057..2a91f6987e69 100644
--- a/sys/dev/firewire/sbp.c
+++ b/sys/dev/firewire/sbp.c
@@ -304,7 +304,7 @@ SBP_DEBUG(0)
 END_DEBUG
 
 	if (device_find_child(parent, "sbp", -1) == NULL)
-		BUS_ADD_CHILD(parent, 0, "sbp", -1);
+		BUS_ADD_CHILD(parent, 0, "sbp", DEVICE_UNIT_ANY);
 }
 
 /*
diff --git a/sys/dev/hid/hidbus.c b/sys/dev/hid/hidbus.c
index 003017c0f3ea..548027b0320a 100644
--- a/sys/dev/hid/hidbus.c
+++ b/sys/dev/hid/hidbus.c
@@ -226,7 +226,7 @@ hidbus_enumerate_children(device_t dev, const void* data, hid_size_t len)
 	while (hid_get_item(hd, &hi)) {
 		if (hi.kind != hid_collection || hi.collevel != 1)
 			continue;
-		child = BUS_ADD_CHILD(dev, 0, NULL, -1);
+		child = BUS_ADD_CHILD(dev, 0, NULL, DEVICE_UNIT_ANY);
 		if (child == NULL) {
 			device_printf(dev, "Could not add HID device\n");
 			continue;
diff --git a/sys/dev/iicbus/acpi_iicbus.c b/sys/dev/iicbus/acpi_iicbus.c
index 4b61387b0ed6..eb5f31d6132f 100644
--- a/sys/dev/iicbus/acpi_iicbus.c
+++ b/sys/dev/iicbus/acpi_iicbus.c
@@ -512,7 +512,7 @@ acpi_iicbus_enumerate_child(ACPI_HANDLE handle, UINT32 level,
 			return (AE_OK);
 	}
 
-	child = BUS_ADD_CHILD(iicbus, 0, NULL, -1);
+	child = BUS_ADD_CHILD(iicbus, 0, NULL, DEVICE_UNIT_ANY);
 	if (child == NULL) {
 		device_printf(iicbus, "add child failed\n");
 		return (AE_OK);
diff --git a/sys/dev/iicbus/iic.c b/sys/dev/iicbus/iic.c
index 0d65bdea5782..ec37a6e19342 100644
--- a/sys/dev/iicbus/iic.c
+++ b/sys/dev/iicbus/iic.c
@@ -134,7 +134,7 @@ iic_identify(driver_t *driver, device_t parent)
 {
 
 	if (device_find_child(parent, "iic", -1) == NULL)
-		BUS_ADD_CHILD(parent, 0, "iic", -1);
+		BUS_ADD_CHILD(parent, 0, "iic", DEVICE_UNIT_ANY);
 }
 
 static int
diff --git a/sys/dev/iicbus/iicsmb.c b/sys/dev/iicbus/iicsmb.c
index 8576491b08a8..3e7e06a85f09 100644
--- a/sys/dev/iicbus/iicsmb.c
+++ b/sys/dev/iicbus/iicsmb.c
@@ -135,7 +135,7 @@ iicsmb_identify(driver_t *driver, device_t parent)
 {
 
 	if (device_find_child(parent, "iicsmb", -1) == NULL)
-		BUS_ADD_CHILD(parent, 0, "iicsmb", -1);
+		BUS_ADD_CHILD(parent, 0, "iicsmb", DEVICE_UNIT_ANY);
 }
 
 static int
diff --git a/sys/dev/ipmi/ipmi_isa.c b/sys/dev/ipmi/ipmi_isa.c
index 432c63b327ee..7ae55baf2f8f 100644
--- a/sys/dev/ipmi/ipmi_isa.c
+++ b/sys/dev/ipmi/ipmi_isa.c
@@ -70,7 +70,7 @@ ipmi_isa_identify(driver_t *driver, device_t parent)
 		if (devid != 0xffffffff &&
 		    ipmi_pci_match(devid & 0xffff, devid >> 16) != NULL)
 			return;
-		BUS_ADD_CHILD(parent, 0, "ipmi", -1);
+		BUS_ADD_CHILD(parent, 0, "ipmi", DEVICE_UNIT_ANY);
 	}
 }
 
diff --git a/sys/dev/ipmi/ipmi_smbus.c b/sys/dev/ipmi/ipmi_smbus.c
index 59b8dd76675a..1772d9313892 100644
--- a/sys/dev/ipmi/ipmi_smbus.c
+++ b/sys/dev/ipmi/ipmi_smbus.c
@@ -60,7 +60,7 @@ ipmi_smbus_identify(driver_t *driver, device_t parent)
 
 	if (ipmi_smbios_identify(&info) && info.iface_type == SSIF_MODE &&
 	    device_find_child(parent, "ipmi", -1) == NULL)
-		BUS_ADD_CHILD(parent, 0, "ipmi", -1);
+		BUS_ADD_CHILD(parent, 0, "ipmi", DEVICE_UNIT_ANY);
 }
 
 static int
diff --git a/sys/dev/isl/isl.c b/sys/dev/isl/isl.c
index 558fc88975fa..009c02ad2b35 100644
--- a/sys/dev/isl/isl.c
+++ b/sys/dev/isl/isl.c
@@ -157,7 +157,7 @@ isl_identify(driver_t *driver, device_t parent)
 
 	/* Check if we can communicate to our slave. */
 	if (init_device(dev, 0x88, 1) == 0)
-		BUS_ADD_CHILD(parent, ISA_ORDER_SPECULATIVE, "isl", -1);
+		BUS_ADD_CHILD(parent, ISA_ORDER_SPECULATIVE, "isl", DEVICE_UNIT_ANY);
 }
 #endif
 
diff --git a/sys/dev/mdio/mdio.c b/sys/dev/mdio/mdio.c
index 55122edd16cc..c34493254e0f 100644
--- a/sys/dev/mdio/mdio.c
+++ b/sys/dev/mdio/mdio.c
@@ -38,7 +38,7 @@ mdio_identify(driver_t *driver, device_t parent)
 {
 
 	if (device_find_child(parent, mdio_driver.name, -1) == NULL)
-		BUS_ADD_CHILD(parent, 0, mdio_driver.name, -1);
+		BUS_ADD_CHILD(parent, 0, mdio_driver.name, DEVICE_UNIT_ANY);
 }
 
 static int
diff --git a/sys/dev/nvdimm/nvdimm_acpi.c b/sys/dev/nvdimm/nvdimm_acpi.c
index 995e60e8b4ee..a8e5db0542f2 100644
--- a/sys/dev/nvdimm/nvdimm_acpi.c
+++ b/sys/dev/nvdimm/nvdimm_acpi.c
@@ -109,7 +109,7 @@ nvdimm_root_create_devs(device_t dev, ACPI_TABLE_NFIT *nfitbl)
 		if (dimm_handle == NULL)
 			continue;
 
-		child = BUS_ADD_CHILD(dev, 100, "nvdimm", -1);
+		child = BUS_ADD_CHILD(dev, 100, "nvdimm", DEVICE_UNIT_ANY);
 		if (child == NULL) {
 			device_printf(dev, "failed to create nvdimm\n");
 			return (ENXIO);
diff --git a/sys/dev/nvdimm/nvdimm_e820.c b/sys/dev/nvdimm/nvdimm_e820.c
index 3fbe2df31209..2a6f29ebad21 100644
--- a/sys/dev/nvdimm/nvdimm_e820.c
+++ b/sys/dev/nvdimm/nvdimm_e820.c
@@ -275,7 +275,7 @@ nvdimm_e820_identify(driver_t *driver, device_t parent)
 	if (smapbase == NULL)
 		return;
 
-	child = BUS_ADD_CHILD(parent, 0, driver->name, -1);
+	child = BUS_ADD_CHILD(parent, 0, driver->name, DEVICE_UNIT_ANY);
 	if (child == NULL)
 		device_printf(parent, "add %s child failed\n", driver->name);
 }
diff --git a/sys/dev/ppbus/if_plip.c b/sys/dev/ppbus/if_plip.c
index c2adcb602f6b..598c0c49b82e 100644
--- a/sys/dev/ppbus/if_plip.c
+++ b/sys/dev/ppbus/if_plip.c
@@ -216,7 +216,7 @@ lp_identify(driver_t *driver, device_t parent)
 
 	dev = device_find_child(parent, "plip", -1);
 	if (!dev)
-		BUS_ADD_CHILD(parent, 0, "plip", -1);
+		BUS_ADD_CHILD(parent, 0, "plip", DEVICE_UNIT_ANY);
 }
 
 static int
diff --git a/sys/dev/ppbus/lpbb.c b/sys/dev/ppbus/lpbb.c
index ce16471e7629..3380cdfdaed4 100644
--- a/sys/dev/ppbus/lpbb.c
+++ b/sys/dev/ppbus/lpbb.c
@@ -63,7 +63,7 @@ lpbb_identify(driver_t *driver, device_t parent)
 
 	dev = device_find_child(parent, "lpbb", -1);
 	if (!dev)
-		BUS_ADD_CHILD(parent, 0, "lpbb", -1);
+		BUS_ADD_CHILD(parent, 0, "lpbb", DEVICE_UNIT_ANY);
 }
 
 static int
diff --git a/sys/dev/ppbus/lpt.c b/sys/dev/ppbus/lpt.c
index 644e0f08008b..994adcc6a608 100644
--- a/sys/dev/ppbus/lpt.c
+++ b/sys/dev/ppbus/lpt.c
@@ -339,7 +339,7 @@ lpt_identify(driver_t *driver, device_t parent)
 
 	dev = device_find_child(parent, LPT_NAME, -1);
 	if (!dev)
-		BUS_ADD_CHILD(parent, 0, LPT_NAME, -1);
+		BUS_ADD_CHILD(parent, 0, LPT_NAME, DEVICE_UNIT_ANY);
 }
 
 /*
diff --git a/sys/dev/ppbus/pcfclock.c b/sys/dev/ppbus/pcfclock.c
index e0d2e71b49e5..7cee6692b367 100644
--- a/sys/dev/ppbus/pcfclock.c
+++ b/sys/dev/ppbus/pcfclock.c
@@ -113,7 +113,7 @@ pcfclock_identify(driver_t *driver, device_t parent)
 
 	dev = device_find_child(parent, PCFCLOCK_NAME, -1);
 	if (!dev)
-		BUS_ADD_CHILD(parent, 0, PCFCLOCK_NAME, -1);
+		BUS_ADD_CHILD(parent, 0, PCFCLOCK_NAME, DEVICE_UNIT_ANY);
 }
 
 static int
diff --git a/sys/dev/ppbus/ppi.c b/sys/dev/ppbus/ppi.c
index 3789da6fbed5..65921b53e0c6 100644
--- a/sys/dev/ppbus/ppi.c
+++ b/sys/dev/ppbus/ppi.c
@@ -137,7 +137,7 @@ ppi_identify(driver_t *driver, device_t parent)
 
 	dev = device_find_child(parent, "ppi", -1);
 	if (!dev)
-		BUS_ADD_CHILD(parent, 0, "ppi", -1);
+		BUS_ADD_CHILD(parent, 0, "ppi", DEVICE_UNIT_ANY);
 }
 
 /*
diff --git a/sys/dev/ppbus/pps.c b/sys/dev/ppbus/pps.c
index a5c0a56d4f94..5a2791aa0335 100644
--- a/sys/dev/ppbus/pps.c
+++ b/sys/dev/ppbus/pps.c
@@ -78,7 +78,7 @@ ppsidentify(driver_t *driver, device_t parent)
 
 	dev = device_find_child(parent, PPS_NAME, -1);
 	if (!dev)
-		BUS_ADD_CHILD(parent, 0, PPS_NAME, -1);
+		BUS_ADD_CHILD(parent, 0, PPS_NAME, DEVICE_UNIT_ANY);
 }
 
 static int
diff --git a/sys/dev/smbios/smbios.c b/sys/dev/smbios/smbios.c
index 883e8f501b59..dbf766b86422 100644
--- a/sys/dev/smbios/smbios.c
+++ b/sys/dev/smbios/smbios.c
@@ -145,7 +145,7 @@ smbios_identify (driver_t *driver, device_t parent)
 			}
 		}
 
-		child = BUS_ADD_CHILD(parent, 5, "smbios", -1);
+		child = BUS_ADD_CHILD(parent, 5, "smbios", DEVICE_UNIT_ANY);
 		device_set_driver(child, driver);
 
 		/* smuggle the phys addr into probe and attach */
diff --git a/sys/dev/smbus/smb.c b/sys/dev/smbus/smb.c
index ee323c835f10..0efa93ae0e89 100644
--- a/sys/dev/smbus/smb.c
+++ b/sys/dev/smbus/smb.c
@@ -127,7 +127,7 @@ smb_identify(driver_t *driver, device_t parent)
 {
 
 	if (device_find_child(parent, "smb", -1) == NULL)
-		BUS_ADD_CHILD(parent, 0, "smb", -1);
+		BUS_ADD_CHILD(parent, 0, "smb", DEVICE_UNIT_ANY);
 }
 
 static int
diff --git a/sys/dev/superio/superio.c b/sys/dev/superio/superio.c
index ddb06af93bec..960b89c0cdc0 100644
--- a/sys/dev/superio/superio.c
+++ b/sys/dev/superio/superio.c
@@ -685,7 +685,7 @@ superio_add_known_child(device_t dev, superio_dev_type_t type, uint8_t ldn)
 	struct superio_devinfo *dinfo;
 	device_t child;
 
-	child = BUS_ADD_CHILD(dev, 0, NULL, -1);
+	child = BUS_ADD_CHILD(dev, 0, NULL, DEVICE_UNIT_ANY);
 	if (child == NULL) {
 		device_printf(dev, "failed to add child for ldn %d, type %s\n",
 		    ldn, devtype_to_str(type));
diff --git a/sys/i386/bios/smapi.c b/sys/i386/bios/smapi.c
index b73fb97e4365..b222e5e4cc61 100644
--- a/sys/i386/bios/smapi.c
+++ b/sys/i386/bios/smapi.c
@@ -151,7 +151,7 @@ smapi_identify (driver_t *driver, device_t parent)
 		rid = 0;
 		length = ADDR2HDR(addr)->length;
 
-		child = BUS_ADD_CHILD(parent, 5, "smapi", -1);
+		child = BUS_ADD_CHILD(parent, 5, "smapi", DEVICE_UNIT_ANY);
 		device_set_driver(child, driver);
 		bus_set_resource(child, SYS_RES_MEMORY, rid, addr, length);
 		device_set_desc(child, "SMAPI BIOS");
diff --git a/sys/i386/i386/bios.c b/sys/i386/i386/bios.c
index 0951fbe6a679..7f3e1546f236 100644
--- a/sys/i386/i386/bios.c
+++ b/sys/i386/i386/bios.c
@@ -642,7 +642,7 @@ pnpbios_identify(driver_t *driver, device_t parent)
 	    continue;
 
 	/* Add the device and parse its resources */
-	dev = BUS_ADD_CHILD(parent, ISA_ORDER_PNPBIOS, NULL, -1);
+	dev = BUS_ADD_CHILD(parent, ISA_ORDER_PNPBIOS, NULL, DEVICE_UNIT_ANY);
 	isa_set_vendorid(dev, pd->devid);
 	isa_set_logicalid(dev, pd->devid);
 	/*
diff --git a/sys/isa/pnp.c b/sys/isa/pnp.c
index 877e2ed91d6f..0e711a93d1ce 100644
--- a/sys/isa/pnp.c
+++ b/sys/isa/pnp.c
@@ -469,7 +469,7 @@ pnp_create_devices(device_t parent, pnp_id *p, int csn,
 			 */
 			bcopy(resinfo, &logical_id, 4);
 			pnp_check_quirks(p->vendor_id, logical_id, ldn, NULL);
-			dev = BUS_ADD_CHILD(parent, ISA_ORDER_PNP, NULL, -1);
+			dev = BUS_ADD_CHILD(parent, ISA_ORDER_PNP, NULL, DEVICE_UNIT_ANY);
 			if (desc)
 				device_set_desc_copy(dev, desc);
 			else
diff --git a/sys/powerpc/mpc85xx/atpic.c b/sys/powerpc/mpc85xx/atpic.c
index fdee2177c970..8c69af8b4b4d 100644
--- a/sys/powerpc/mpc85xx/atpic.c
+++ b/sys/powerpc/mpc85xx/atpic.c
@@ -145,7 +145,7 @@ atpic_isa_identify(driver_t *drv, device_t parent)
 {
 	device_t child;
 
-	child = BUS_ADD_CHILD(parent, ISA_ORDER_SENSITIVE, drv->name, -1);
+	child = BUS_ADD_CHILD(parent, ISA_ORDER_SENSITIVE, drv->name, DEVICE_UNIT_ANY);
 	device_set_driver(child, drv);
 	isa_set_logicalid(child, atpic_ids[0].ip_id);
 	isa_set_vendorid(child, atpic_ids[0].ip_id);
diff --git a/sys/x86/bios/vpd.c b/sys/x86/bios/vpd.c
index 5ad194d28bba..8b68dcd39a66 100644
--- a/sys/x86/bios/vpd.c
+++ b/sys/x86/bios/vpd.c
@@ -141,7 +141,7 @@ vpd_identify (driver_t *driver, device_t parent)
 		rid = 0;
 		length = ADDR2VPD(addr)->Length;
 
-		child = BUS_ADD_CHILD(parent, 5, "vpd", -1);
+		child = BUS_ADD_CHILD(parent, 5, "vpd", DEVICE_UNIT_ANY);
 		device_set_driver(child, driver);
 		bus_set_resource(child, SYS_RES_MEMORY, rid, addr, length);
 		device_set_desc(child, "Vital Product Data Area");
diff --git a/sys/x86/isa/orm.c b/sys/x86/isa/orm.c
index f8afc17cac71..bb2663332550 100644
--- a/sys/x86/isa/orm.c
+++ b/sys/x86/isa/orm.c
@@ -94,7 +94,7 @@ orm_identify(driver_t* driver, device_t parent)
 	if (resource_disabled("orm", 0))
 		return;
 
-	child = BUS_ADD_CHILD(parent, ISA_ORDER_SENSITIVE, "orm", -1);
+	child = BUS_ADD_CHILD(parent, ISA_ORDER_SENSITIVE, "orm", DEVICE_UNIT_ANY);
 	device_set_driver(child, driver);
 	isa_set_logicalid(child, ORM_ID);
 	isa_set_vendorid(child, ORM_ID);
diff --git a/sys/x86/pci/qpi.c b/sys/x86/pci/qpi.c
index 085afd49852b..278489dfe10a 100644
--- a/sys/x86/pci/qpi.c
+++ b/sys/x86/pci/qpi.c
@@ -132,7 +132,7 @@ qpi_probe_pcib(device_t dev, int bus)
 		return (ENXIO);
 	}
 
-	child = BUS_ADD_CHILD(dev, 0, "pcib", -1);
+	child = BUS_ADD_CHILD(dev, 0, "pcib", DEVICE_UNIT_ANY);
 	if (child == NULL)
 		panic("%s: failed to add pci bus %d", device_get_nameunit(dev),
 		    bus);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202407250449.46P4n5bq032051>