aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xshare/examples/drivers/make_device_driver.sh3
-rw-r--r--stand/kshim/bsd_kernel.c5
-rw-r--r--sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c4
-rw-r--r--sys/arm/nvidia/tegra124/tegra124_coretemp.c4
-rw-r--r--sys/arm/nvidia/tegra124/tegra124_cpufreq.c4
-rw-r--r--sys/arm/ti/am335x/am335x_ehrpwm.c3
-rw-r--r--sys/arm/ti/am335x/am335x_scm.c2
-rw-r--r--sys/arm/ti/ti_i2c.c3
-rw-r--r--sys/arm64/arm64/gic_v3_acpi.c2
-rw-r--r--sys/arm64/arm64/gic_v3_fdt.c2
-rw-r--r--sys/arm64/cavium/thunder_pcie_fdt.c2
-rw-r--r--sys/arm64/nvidia/tegra210/tegra210_coretemp.c4
-rw-r--r--sys/arm64/nvidia/tegra210/tegra210_cpufreq.c4
-rw-r--r--sys/compat/linuxkpi/common/src/linux_i2c.c5
-rw-r--r--sys/compat/linuxkpi/common/src/linux_i2cbb.c5
-rw-r--r--sys/crypto/aesni/aesni.c4
-rw-r--r--sys/crypto/armv8/armv8_crypto.c4
-rw-r--r--sys/crypto/blake2/blake2_cryptodev.c4
-rw-r--r--sys/crypto/openssl/ossl.c2
-rw-r--r--sys/crypto/via/padlock.c4
-rw-r--r--sys/dev/aac/aac.c2
-rw-r--r--sys/dev/acpi_support/acpi_asus_wmi.c4
-rw-r--r--sys/dev/acpi_support/acpi_hp.c4
-rw-r--r--sys/dev/acpi_support/acpi_sbl_wmi.c4
-rw-r--r--sys/dev/acpica/acpi_pcib_acpi.c2
-rw-r--r--sys/dev/acpica/acpi_perf.c2
-rw-r--r--sys/dev/acpica/acpi_throttle.c6
-rw-r--r--sys/dev/acpica/acpi_video.c2
-rw-r--r--sys/dev/agp/agp_i810.c2
-rw-r--r--sys/dev/amdsbwd/amdsbwd.c5
-rw-r--r--sys/dev/amdsmn/amdsmn.c2
-rw-r--r--sys/dev/amdtemp/amdtemp.c2
-rw-r--r--sys/dev/atopcase/atopcase.c2
-rw-r--r--sys/dev/bhnd/bhnd_subr.c2
-rw-r--r--sys/dev/bhnd/cores/chipc/chipc_spi.c6
-rw-r--r--sys/dev/bwn/if_bwn_pci.c2
-rw-r--r--sys/dev/chromebook_platform/chromebook_platform.c2
-rw-r--r--sys/dev/coretemp/coretemp.c2
-rw-r--r--sys/dev/cpufreq/cpufreq_dt.c2
-rw-r--r--sys/dev/cpufreq/ichss.c8
-rw-r--r--sys/dev/cxgb/cxgb_main.c3
-rw-r--r--sys/dev/cxgbe/crypto/t4_crypto.c2
-rw-r--r--sys/dev/dpaa2/dpaa2_mc_acpi.c2
-rw-r--r--sys/dev/dpaa2/dpaa2_rc.c4
-rw-r--r--sys/dev/dpaa2/memac_mdio_acpi.c2
-rw-r--r--sys/dev/efidev/efirtc.c4
-rw-r--r--sys/dev/etherswitch/e6000sw/e6000sw.c2
-rw-r--r--sys/dev/etherswitch/etherswitch.c2
-rw-r--r--sys/dev/etherswitch/ip17x/ip17x.c2
-rw-r--r--sys/dev/etherswitch/miiproxy.c2
-rw-r--r--sys/dev/etherswitch/rtl8366/rtl8366rb.c2
-rw-r--r--sys/dev/firewire/sbp.c2
-rw-r--r--sys/dev/glxiic/glxiic.c7
-rw-r--r--sys/dev/gpio/gpiobus.c2
-rw-r--r--sys/dev/hid/hidraw.c2
-rw-r--r--sys/dev/hyperv/input/hv_hid.c2
-rw-r--r--sys/dev/hyperv/vmbus/vmbus_et.c2
-rw-r--r--sys/dev/ichsmb/ichsmb.c3
-rw-r--r--sys/dev/iicbus/controller/cadence/cdnc_i2c.c2
-rw-r--r--sys/dev/iicbus/controller/twsi/twsi.c3
-rw-r--r--sys/dev/iicbus/iic.c2
-rw-r--r--sys/dev/iicbus/iicsmb.c2
-rw-r--r--sys/dev/ipmi/ipmi_isa.c2
-rw-r--r--sys/dev/ipmi/ipmi_smbus.c2
-rw-r--r--sys/dev/isl/isl.c2
-rw-r--r--sys/dev/ismt/ismt.c3
-rw-r--r--sys/dev/kvm_clock/kvm_clock.c2
-rw-r--r--sys/dev/mdio/mdio.c2
-rw-r--r--sys/dev/mfi/mfi.c6
-rw-r--r--sys/dev/mfi/mfi_cam.c2
-rw-r--r--sys/dev/mmcnull/mmcnull.c2
-rw-r--r--sys/dev/nvdimm/nvdimm_e820.c2
-rw-r--r--sys/dev/nvmf/host/nvmf_ctldev.c2
-rw-r--r--sys/dev/p2sb/lewisburg_gpiocm.c2
-rw-r--r--sys/dev/pcf/pcf_isa.c2
-rw-r--r--sys/dev/pci/pci_host_generic_den0115.c2
-rw-r--r--sys/dev/ppbus/if_plip.c2
-rw-r--r--sys/dev/ppbus/lpbb.c2
-rw-r--r--sys/dev/ppbus/lpt.c2
-rw-r--r--sys/dev/ppbus/pcfclock.c2
-rw-r--r--sys/dev/ppbus/ppi.c2
-rw-r--r--sys/dev/ppbus/pps.c2
-rw-r--r--sys/dev/psci/smccc_errata.c2
-rw-r--r--sys/dev/psci/smccc_trng.c2
-rw-r--r--sys/dev/pwm/ofw_pwmbus.c6
-rw-r--r--sys/dev/qat/qat/qat_ocf.c4
-rw-r--r--sys/dev/qcom_qup/qcom_spi.c2
-rw-r--r--sys/dev/sdio/sdiob.c2
-rw-r--r--sys/dev/smbus/smb.c2
-rw-r--r--sys/dev/sound/dummy.c4
-rw-r--r--sys/dev/sound/pci/hdsp.c2
-rw-r--r--sys/dev/spibus/acpi_spibus.c2
-rw-r--r--sys/dev/superio/superio.c2
-rw-r--r--sys/dev/usb/misc/i2ctinyusb.c2
-rw-r--r--sys/dev/viapm/viapm.c2
-rw-r--r--sys/dev/viawd/viawd.c2
-rw-r--r--sys/dev/virtio/mmio/virtio_mmio.c2
-rw-r--r--sys/isa/isahint.c3
-rw-r--r--sys/kern/kern_cpu.c5
-rw-r--r--sys/opencrypto/cryptosoft.c2
-rw-r--r--sys/powerpc/cpufreq/dfs.c4
-rw-r--r--sys/powerpc/cpufreq/mpc85xx_jog.c4
-rw-r--r--sys/powerpc/cpufreq/pcr.c4
-rw-r--r--sys/powerpc/cpufreq/pmcr.c4
-rw-r--r--sys/powerpc/cpufreq/pmufreq.c4
-rw-r--r--sys/powerpc/powermac/atibl.c2
-rw-r--r--sys/powerpc/powermac/nvbl.c2
-rw-r--r--sys/powerpc/powernv/opal_i2c.c3
-rw-r--r--sys/powerpc/ps3/ps3bus.c2
-rw-r--r--sys/powerpc/ps3/ps3pic.c2
-rw-r--r--sys/riscv/riscv/intc.c2
-rw-r--r--sys/riscv/riscv/sbi.c6
-rw-r--r--sys/x86/cpufreq/est.c10
-rw-r--r--sys/x86/cpufreq/hwpstate_amd.c5
-rw-r--r--sys/x86/cpufreq/hwpstate_intel.c2
-rw-r--r--sys/x86/cpufreq/p4tcc.c2
-rw-r--r--sys/x86/cpufreq/powernow.c5
-rw-r--r--sys/x86/cpufreq/smist.c8
-rw-r--r--sys/x86/pci/qpi.c2
119 files changed, 192 insertions, 163 deletions
diff --git a/share/examples/drivers/make_device_driver.sh b/share/examples/drivers/make_device_driver.sh
index 5b8f8efa6469..d6d3a8d7c6b9 100755
--- a/share/examples/drivers/make_device_driver.sh
+++ b/share/examples/drivers/make_device_driver.sh
@@ -342,7 +342,8 @@ ${1}_isa_identify (driver_t *driver, device_t parent)
if ((ioport == 0) && (irq == 0))
return; /* We've added all our local hints. */
- child = BUS_ADD_CHILD(parent, ISA_ORDER_SPECULATIVE, "${1}", -1);
+ child = BUS_ADD_CHILD(parent, ISA_ORDER_SPECULATIVE, "${1}",
+ DEVICE_UNIT_ANY);
bus_set_resource(child, SYS_RES_IOPORT, 0, ioport, NUMPORTS);
bus_set_resource(child, SYS_RES_IRQ, 0, irq, 1);
bus_set_resource(child, SYS_RES_DRQ, 0, res[i].drq, 1);
diff --git a/stand/kshim/bsd_kernel.c b/stand/kshim/bsd_kernel.c
index 91ca46e18d74..455ae570d8ae 100644
--- a/stand/kshim/bsd_kernel.c
+++ b/stand/kshim/bsd_kernel.c
@@ -1326,12 +1326,13 @@ usb_pci_mod_load(void *arg)
{
uint32_t x;
- usb_pci_root = device_add_child(NULL, "pci", -1);
+ usb_pci_root = device_add_child(NULL, "pci", DEVICE_UNIT_ANY);
if (usb_pci_root == NULL)
return;
for (x = 0; x != USB_PCI_USB_MAX; x++) {
- usb_pci_dev[x] = device_add_child(usb_pci_root, usb_pci_devices[x], -1);
+ usb_pci_dev[x] = device_add_child(usb_pci_root,
+ usb_pci_devices[x], DEVICE_UNIT_ANY);
if (usb_pci_dev[x] == NULL)
continue;
if (device_probe_and_attach(usb_pci_dev[x])) {
diff --git a/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c b/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c
index 3ef564c6ae13..2bcf6ba8da1e 100644
--- a/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c
+++ b/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c
@@ -1204,9 +1204,9 @@ bcm2835_cpufreq_identify(driver_t *driver, device_t parent)
return;
DPRINTF("driver=%p, parent=%p\n", driver, parent);
- if (device_find_child(parent, "bcm2835_cpufreq", -1) != NULL)
+ if (device_find_child(parent, "bcm2835_cpufreq", DEVICE_UNIT_ANY) != NULL)
return;
- if (BUS_ADD_CHILD(parent, 0, "bcm2835_cpufreq", -1) == NULL)
+ if (BUS_ADD_CHILD(parent, 0, "bcm2835_cpufreq", DEVICE_UNIT_ANY) == NULL)
device_printf(parent, "add child failed\n");
}
diff --git a/sys/arm/nvidia/tegra124/tegra124_coretemp.c b/sys/arm/nvidia/tegra124/tegra124_coretemp.c
index 42ed02de4f86..1a756c62e490 100644
--- a/sys/arm/nvidia/tegra124/tegra124_coretemp.c
+++ b/sys/arm/nvidia/tegra124/tegra124_coretemp.c
@@ -176,9 +176,9 @@ tegra124_coretemp_identify(driver_t *driver, device_t parent)
root = OF_finddevice("/");
if (!ofw_bus_node_is_compatible(root, "nvidia,tegra124"))
return;
- if (device_find_child(parent, "tegra124_coretemp", -1) != NULL)
+ if (device_find_child(parent, "tegra124_coretemp", DEVICE_UNIT_ANY) != NULL)
return;
- if (BUS_ADD_CHILD(parent, 0, "tegra124_coretemp", -1) == NULL)
+ if (BUS_ADD_CHILD(parent, 0, "tegra124_coretemp", DEVICE_UNIT_ANY) == NULL)
device_printf(parent, "add child failed\n");
}
diff --git a/sys/arm/nvidia/tegra124/tegra124_cpufreq.c b/sys/arm/nvidia/tegra124/tegra124_cpufreq.c
index a537d9397722..2fa6f902cad7 100644
--- a/sys/arm/nvidia/tegra124/tegra124_cpufreq.c
+++ b/sys/arm/nvidia/tegra124/tegra124_cpufreq.c
@@ -475,9 +475,9 @@ tegra124_cpufreq_identify(driver_t *driver, device_t parent)
if (device_get_unit(parent) != 0)
return;
- if (device_find_child(parent, "tegra124_cpufreq", -1) != NULL)
+ if (device_find_child(parent, "tegra124_cpufreq", DEVICE_UNIT_ANY) != NULL)
return;
- if (BUS_ADD_CHILD(parent, 0, "tegra124_cpufreq", -1) == NULL)
+ if (BUS_ADD_CHILD(parent, 0, "tegra124_cpufreq", DEVICE_UNIT_ANY) == NULL)
device_printf(parent, "add child failed\n");
}
diff --git a/sys/arm/ti/am335x/am335x_ehrpwm.c b/sys/arm/ti/am335x/am335x_ehrpwm.c
index 59ef0931439d..e19933396156 100644
--- a/sys/arm/ti/am335x/am335x_ehrpwm.c
+++ b/sys/arm/ti/am335x/am335x_ehrpwm.c
@@ -512,7 +512,8 @@ am335x_ehrpwm_attach(device_t dev)
reg |= TBCTL_CTRMODE_UP | TBCTL_FREERUN;
EPWM_WRITE2(sc, EPWM_TBCTL, reg);
- if ((sc->sc_busdev = device_add_child(dev, "pwmbus", -1)) == NULL) {
+ if ((sc->sc_busdev = device_add_child(dev, "pwmbus",
+ DEVICE_UNIT_ANY)) == NULL) {
device_printf(dev, "Cannot add child pwmbus\n");
// This driver can still do things even without the bus child.
}
diff --git a/sys/arm/ti/am335x/am335x_scm.c b/sys/arm/ti/am335x/am335x_scm.c
index 8245f35617ad..33268bd0a94b 100644
--- a/sys/arm/ti/am335x/am335x_scm.c
+++ b/sys/arm/ti/am335x/am335x_scm.c
@@ -86,7 +86,7 @@ am335x_scm_identify(driver_t *driver, device_t parent)
return;
/* Make sure we attach only once. */
- if (device_find_child(parent, "am335x_scm", -1) != NULL)
+ if (device_find_child(parent, "am335x_scm", DEVICE_UNIT_ANY) != NULL)
return;
child = device_add_child(parent, "am335x_scm", DEVICE_UNIT_ANY);
diff --git a/sys/arm/ti/ti_i2c.c b/sys/arm/ti/ti_i2c.c
index 53b48e4fe87b..c89809c7a218 100644
--- a/sys/arm/ti/ti_i2c.c
+++ b/sys/arm/ti/ti_i2c.c
@@ -851,7 +851,8 @@ ti_i2c_attach(device_t dev)
goto out;
/* Attach the iicbus. */
- if ((sc->sc_iicbus = device_add_child(dev, "iicbus", -1)) == NULL) {
+ if ((sc->sc_iicbus = device_add_child(dev, "iicbus",
+ DEVICE_UNIT_ANY)) == NULL) {
device_printf(dev, "could not allocate iicbus instance\n");
err = ENXIO;
goto out;
diff --git a/sys/arm64/arm64/gic_v3_acpi.c b/sys/arm64/arm64/gic_v3_acpi.c
index 7c3495fd442b..88fd0394c548 100644
--- a/sys/arm64/arm64/gic_v3_acpi.c
+++ b/sys/arm64/arm64/gic_v3_acpi.c
@@ -450,7 +450,7 @@ gic_v3_acpi_bus_attach(device_t dev)
gic_v3_add_children, dev);
/* Add the vgic child if needed */
if (((uintptr_t)acpi_get_private(dev) & GICV3_PRIV_FLAGS) != 0) {
- child = device_add_child(dev, "vgic", -1);
+ child = device_add_child(dev, "vgic", DEVICE_UNIT_ANY);
if (child == NULL) {
device_printf(dev, "Could not add vgic child\n");
} else {
diff --git a/sys/arm64/arm64/gic_v3_fdt.c b/sys/arm64/arm64/gic_v3_fdt.c
index 9c034b417624..4bea4040c0ba 100644
--- a/sys/arm64/arm64/gic_v3_fdt.c
+++ b/sys/arm64/arm64/gic_v3_fdt.c
@@ -363,7 +363,7 @@ gic_v3_ofw_bus_attach(device_t dev)
* child so we can use this in the vmm module for bhyve.
*/
if (OF_hasprop(parent, "interrupts")) {
- child = device_add_child(dev, "vgic", -1);
+ child = device_add_child(dev, "vgic", DEVICE_UNIT_ANY);
if (child == NULL) {
device_printf(dev, "Could not add vgic child\n");
} else {
diff --git a/sys/arm64/cavium/thunder_pcie_fdt.c b/sys/arm64/cavium/thunder_pcie_fdt.c
index f173a28b637d..87dc113ad781 100644
--- a/sys/arm64/cavium/thunder_pcie_fdt.c
+++ b/sys/arm64/cavium/thunder_pcie_fdt.c
@@ -152,7 +152,7 @@ thunder_pcie_ofw_bus_attach(device_t dev)
ofw_bus_intr_to_rl(dev, node, &di->di_rl, NULL);
/* Add newbus device for this FDT node */
- child = device_add_child(dev, NULL, -1);
+ child = device_add_child(dev, NULL, DEVICE_UNIT_ANY);
if (child == NULL) {
resource_list_free(&di->di_rl);
ofw_bus_gen_destroy_devinfo(&di->di_dinfo);
diff --git a/sys/arm64/nvidia/tegra210/tegra210_coretemp.c b/sys/arm64/nvidia/tegra210/tegra210_coretemp.c
index ac037d4ac385..973cbc4759fb 100644
--- a/sys/arm64/nvidia/tegra210/tegra210_coretemp.c
+++ b/sys/arm64/nvidia/tegra210/tegra210_coretemp.c
@@ -181,9 +181,9 @@ tegra210_coretemp_identify(driver_t *driver, device_t parent)
root = OF_finddevice("/");
if (!ofw_bus_node_is_compatible(root, "nvidia,tegra210"))
return;
- if (device_find_child(parent, "tegra210_coretemp", -1) != NULL)
+ if (device_find_child(parent, "tegra210_coretemp", DEVICE_UNIT_ANY) != NULL)
return;
- if (BUS_ADD_CHILD(parent, 0, "tegra210_coretemp", -1) == NULL)
+ if (BUS_ADD_CHILD(parent, 0, "tegra210_coretemp", DEVICE_UNIT_ANY) == NULL)
device_printf(parent, "add child failed\n");
}
diff --git a/sys/arm64/nvidia/tegra210/tegra210_cpufreq.c b/sys/arm64/nvidia/tegra210/tegra210_cpufreq.c
index 9b248a09bd58..56dfc1b32500 100644
--- a/sys/arm64/nvidia/tegra210/tegra210_cpufreq.c
+++ b/sys/arm64/nvidia/tegra210/tegra210_cpufreq.c
@@ -393,9 +393,9 @@ tegra210_cpufreq_identify(driver_t *driver, device_t parent)
if (device_get_unit(parent) != 0)
return;
- if (device_find_child(parent, "tegra210_cpufreq", -1) != NULL)
+ if (device_find_child(parent, "tegra210_cpufreq", DEVICE_UNIT_ANY) != NULL)
return;
- if (BUS_ADD_CHILD(parent, 0, "tegra210_cpufreq", -1) == NULL)
+ if (BUS_ADD_CHILD(parent, 0, "tegra210_cpufreq", DEVICE_UNIT_ANY) == NULL)
device_printf(parent, "add child failed\n");
}
diff --git a/sys/compat/linuxkpi/common/src/linux_i2c.c b/sys/compat/linuxkpi/common/src/linux_i2c.c
index d3e69d5df212..f18570202f74 100644
--- a/sys/compat/linuxkpi/common/src/linux_i2c.c
+++ b/sys/compat/linuxkpi/common/src/linux_i2c.c
@@ -85,7 +85,7 @@ lkpi_iic_attach(device_t dev)
struct lkpi_iic_softc *sc;
sc = device_get_softc(dev);
- sc->iicbus = device_add_child(dev, "iicbus", -1);
+ sc->iicbus = device_add_child(dev, "iicbus", DEVICE_UNIT_ANY);
if (sc->iicbus == NULL) {
device_printf(dev, "Couldn't add iicbus child, aborting\n");
return (ENXIO);
@@ -323,7 +323,8 @@ lkpi_i2c_add_adapter(struct i2c_adapter *adapter)
device_printf(adapter->dev.parent->bsddev,
"Adding i2c adapter %s\n", adapter->name);
sx_xlock(&lkpi_sx_i2c);
- lkpi_iic = device_add_child(adapter->dev.parent->bsddev, "lkpi_iic", -1);
+ lkpi_iic = device_add_child(adapter->dev.parent->bsddev, "lkpi_iic",
+ DEVICE_UNIT_ANY);
if (lkpi_iic == NULL) {
device_printf(adapter->dev.parent->bsddev, "Couldn't add lkpi_iic\n");
sx_xunlock(&lkpi_sx_i2c);
diff --git a/sys/compat/linuxkpi/common/src/linux_i2cbb.c b/sys/compat/linuxkpi/common/src/linux_i2cbb.c
index f266a1404af7..48a018ec2533 100644
--- a/sys/compat/linuxkpi/common/src/linux_i2cbb.c
+++ b/sys/compat/linuxkpi/common/src/linux_i2cbb.c
@@ -90,7 +90,7 @@ lkpi_iicbb_attach(device_t dev)
struct lkpi_iicbb_softc *sc;
sc = device_get_softc(dev);
- sc->iicbb = device_add_child(dev, "iicbb", -1);
+ sc->iicbb = device_add_child(dev, "iicbb", DEVICE_UNIT_ANY);
if (sc->iicbb == NULL) {
device_printf(dev, "Couldn't add iicbb child, aborting\n");
return (ENXIO);
@@ -308,7 +308,8 @@ lkpi_i2c_bit_add_bus(struct i2c_adapter *adapter)
device_printf(adapter->dev.parent->bsddev,
"Adding i2c adapter %s\n", adapter->name);
sx_xlock(&lkpi_sx_i2cbb);
- lkpi_iicbb = device_add_child(adapter->dev.parent->bsddev, "lkpi_iicbb", -1);
+ lkpi_iicbb = device_add_child(adapter->dev.parent->bsddev, "lkpi_iicbb",
+ DEVICE_UNIT_ANY);
if (lkpi_iicbb == NULL) {
device_printf(adapter->dev.parent->bsddev, "Couldn't add lkpi_iicbb\n");
sx_xunlock(&lkpi_sx_i2cbb);
diff --git a/sys/crypto/aesni/aesni.c b/sys/crypto/aesni/aesni.c
index 6a551577d1b9..be8b234d796c 100644
--- a/sys/crypto/aesni/aesni.c
+++ b/sys/crypto/aesni/aesni.c
@@ -81,8 +81,8 @@ aesni_identify(driver_t *drv, device_t parent)
{
/* NB: order 10 is so we get attached after h/w devices */
- if (device_find_child(parent, "aesni", -1) == NULL &&
- BUS_ADD_CHILD(parent, 10, "aesni", -1) == 0)
+ if (device_find_child(parent, "aesni", DEVICE_UNIT_ANY) == NULL &&
+ BUS_ADD_CHILD(parent, 10, "aesni", DEVICE_UNIT_ANY) == 0)
panic("aesni: could not attach");
}
diff --git a/sys/crypto/armv8/armv8_crypto.c b/sys/crypto/armv8/armv8_crypto.c
index 0a63d052b7a9..5b7ec4fbe125 100644
--- a/sys/crypto/armv8/armv8_crypto.c
+++ b/sys/crypto/armv8/armv8_crypto.c
@@ -73,8 +73,8 @@ armv8_crypto_identify(driver_t *drv, device_t parent)
{
/* NB: order 10 is so we get attached after h/w devices */
- if (device_find_child(parent, "armv8crypto", -1) == NULL &&
- BUS_ADD_CHILD(parent, 10, "armv8crypto", -1) == 0)
+ if (device_find_child(parent, "armv8crypto", DEVICE_UNIT_ANY) == NULL &&
+ BUS_ADD_CHILD(parent, 10, "armv8crypto", DEVICE_UNIT_ANY) == 0)
panic("ARMv8 crypto: could not attach");
}
diff --git a/sys/crypto/blake2/blake2_cryptodev.c b/sys/crypto/blake2/blake2_cryptodev.c
index 00211544c42b..702a76a8e57a 100644
--- a/sys/crypto/blake2/blake2_cryptodev.c
+++ b/sys/crypto/blake2/blake2_cryptodev.c
@@ -61,8 +61,8 @@ blake2_identify(driver_t *drv, device_t parent)
{
/* NB: order 10 is so we get attached after h/w devices */
- if (device_find_child(parent, "blaketwo", -1) == NULL &&
- BUS_ADD_CHILD(parent, 10, "blaketwo", -1) == 0)
+ if (device_find_child(parent, "blaketwo", DEVICE_UNIT_ANY) == NULL &&
+ BUS_ADD_CHILD(parent, 10, "blaketwo", DEVICE_UNIT_ANY) == 0)
panic("blaketwo: could not attach");
}
diff --git a/sys/crypto/openssl/ossl.c b/sys/crypto/openssl/ossl.c
index c2ca28133a78..203091c1e50b 100644
--- a/sys/crypto/openssl/ossl.c
+++ b/sys/crypto/openssl/ossl.c
@@ -56,7 +56,7 @@ static void
ossl_identify(driver_t *driver, device_t parent)
{
- if (device_find_child(parent, "ossl", -1) == NULL)
+ if (device_find_child(parent, "ossl", DEVICE_UNIT_ANY) == NULL)
BUS_ADD_CHILD(parent, 10, "ossl", DEVICE_UNIT_ANY);
}
diff --git a/sys/crypto/via/padlock.c b/sys/crypto/via/padlock.c
index 359618409f09..1123aa2f0c74 100644
--- a/sys/crypto/via/padlock.c
+++ b/sys/crypto/via/padlock.c
@@ -71,8 +71,8 @@ static void
padlock_identify(driver_t *drv, device_t parent)
{
/* NB: order 10 is so we get attached after h/w devices */
- if (device_find_child(parent, "padlock", -1) == NULL &&
- BUS_ADD_CHILD(parent, 10, "padlock", -1) == 0)
+ if (device_find_child(parent, "padlock", DEVICE_UNIT_ANY) == NULL &&
+ BUS_ADD_CHILD(parent, 10, "padlock", DEVICE_UNIT_ANY) == 0)
panic("padlock: could not attach");
}
diff --git a/sys/dev/aac/aac.c b/sys/dev/aac/aac.c
index 912b3dc903e3..2519c66e81d4 100644
--- a/sys/dev/aac/aac.c
+++ b/sys/dev/aac/aac.c
@@ -473,7 +473,7 @@ aac_add_container(struct aac_softc *sc, struct aac_mntinforesp *mir, int f)
mir->MntTable[0].FileSystemName,
mir->MntTable[0].Capacity, mir->MntTable[0].VolType);
- if ((child = device_add_child(sc->aac_dev, "aacd", -1)) == NULL)
+ if ((child = device_add_child(sc->aac_dev, "aacd", DEVICE_UNIT_ANY)) == NULL)
device_printf(sc->aac_dev, "device_add_child failed\n");
else
device_set_ivars(child, co);
diff --git a/sys/dev/acpi_support/acpi_asus_wmi.c b/sys/dev/acpi_support/acpi_asus_wmi.c
index 0e9c35d42793..0198ccada3ed 100644
--- a/sys/dev/acpi_support/acpi_asus_wmi.c
+++ b/sys/dev/acpi_support/acpi_asus_wmi.c
@@ -454,7 +454,7 @@ acpi_asus_wmi_identify(driver_t *driver, device_t parent)
return;
/* Add only a single device instance. */
- if (device_find_child(parent, "acpi_asus_wmi", -1) != NULL)
+ if (device_find_child(parent, "acpi_asus_wmi", DEVICE_UNIT_ANY) != NULL)
return;
/* Check management GUID to see whether system is compatible. */
@@ -462,7 +462,7 @@ acpi_asus_wmi_identify(driver_t *driver, device_t parent)
ACPI_ASUS_WMI_MGMT_GUID))
return;
- if (BUS_ADD_CHILD(parent, 0, "acpi_asus_wmi", -1) == NULL)
+ if (BUS_ADD_CHILD(parent, 0, "acpi_asus_wmi", DEVICE_UNIT_ANY) == NULL)
device_printf(parent, "add acpi_asus_wmi child failed\n");
}
diff --git a/sys/dev/acpi_support/acpi_hp.c b/sys/dev/acpi_support/acpi_hp.c
index 088e46af2ce3..5523b8768d41 100644
--- a/sys/dev/acpi_support/acpi_hp.c
+++ b/sys/dev/acpi_support/acpi_hp.c
@@ -465,7 +465,7 @@ acpi_hp_identify(driver_t *driver, device_t parent)
return;
/* Add only a single device instance. */
- if (device_find_child(parent, "acpi_hp", -1) != NULL)
+ if (device_find_child(parent, "acpi_hp", DEVICE_UNIT_ANY) != NULL)
return;
/* Check BIOS GUID to see whether system is compatible. */
@@ -473,7 +473,7 @@ acpi_hp_identify(driver_t *driver, device_t parent)
ACPI_HP_WMI_BIOS_GUID))
return;
- if (BUS_ADD_CHILD(parent, 0, "acpi_hp", -1) == NULL)
+ if (BUS_ADD_CHILD(parent, 0, "acpi_hp", DEVICE_UNIT_ANY) == NULL)
device_printf(parent, "add acpi_hp child failed\n");
}
diff --git a/sys/dev/acpi_support/acpi_sbl_wmi.c b/sys/dev/acpi_support/acpi_sbl_wmi.c
index 7f8bbeb88317..8abee8c94e26 100644
--- a/sys/dev/acpi_support/acpi_sbl_wmi.c
+++ b/sys/dev/acpi_support/acpi_sbl_wmi.c
@@ -59,7 +59,7 @@ acpi_sbl_wmi_identify(driver_t *driver, device_t parent)
return;
/* Add only a single device instance. */
- if (device_find_child(parent, "acpi_sbl_wmi", -1) != NULL)
+ if (device_find_child(parent, "acpi_sbl_wmi", DEVICE_UNIT_ANY) != NULL)
return;
/* Check management GUID to see whether system is compatible. */
@@ -67,7 +67,7 @@ acpi_sbl_wmi_identify(driver_t *driver, device_t parent)
ACPI_SBL_FW_UPDATE_WMI_GUID))
return;
- if (BUS_ADD_CHILD(parent, 0, "acpi_sbl_wmi", -1) == NULL)
+ if (BUS_ADD_CHILD(parent, 0, "acpi_sbl_wmi", DEVICE_UNIT_ANY) == NULL)
device_printf(parent, "add acpi_sbl_wmi child failed\n");
}
diff --git a/sys/dev/acpica/acpi_pcib_acpi.c b/sys/dev/acpica/acpi_pcib_acpi.c
index e8ab481d776f..3913ec612f79 100644
--- a/sys/dev/acpica/acpi_pcib_acpi.c
+++ b/sys/dev/acpica/acpi_pcib_acpi.c
@@ -473,7 +473,7 @@ acpi_pcib_acpi_attach(device_t dev)
error = 0;
bus_identify_children(dev);
- if (device_add_child(dev, "pci", -1) == NULL) {
+ if (device_add_child(dev, "pci", DEVICE_UNIT_ANY) == NULL) {
bus_dma_tag_destroy(sc->ap_dma_tag);
sc->ap_dma_tag = NULL;
error = ENXIO;
diff --git a/sys/dev/acpica/acpi_perf.c b/sys/dev/acpica/acpi_perf.c
index 0013d2a94552..ee7a4355f32a 100644
--- a/sys/dev/acpica/acpi_perf.c
+++ b/sys/dev/acpica/acpi_perf.c
@@ -142,7 +142,7 @@ acpi_perf_identify(driver_t *driver, device_t parent)
device_t dev;
/* Make sure we're not being doubly invoked. */
- if (device_find_child(parent, "acpi_perf", -1) != NULL)
+ if (device_find_child(parent, "acpi_perf", DEVICE_UNIT_ANY) != NULL)
return;
/* Get the handle for the Processor object and check for perf states. */
diff --git a/sys/dev/acpica/acpi_throttle.c b/sys/dev/acpica/acpi_throttle.c
index 5cdca63c27c6..8b2919c71073 100644
--- a/sys/dev/acpica/acpi_throttle.c
+++ b/sys/dev/acpica/acpi_throttle.c
@@ -131,7 +131,7 @@ acpi_throttle_identify(driver_t *driver, device_t parent)
ACPI_OBJECT *obj;
/* Make sure we're not being doubly invoked. */
- if (device_find_child(parent, "acpi_throttle", -1))
+ if (device_find_child(parent, "acpi_throttle", DEVICE_UNIT_ANY))
return;
/* Check for a valid duty width and parent CPU type. */
@@ -173,8 +173,8 @@ acpi_throttle_probe(device_t dev)
* Since p4tcc uses the same mechanism (but internal to the CPU),
* we disable acpi_throttle when p4tcc is also present.
*/
- if (device_find_child(device_get_parent(dev), "p4tcc", -1) &&
- !resource_disabled("p4tcc", 0))
+ if (device_find_child(device_get_parent(dev), "p4tcc", DEVICE_UNIT_ANY)
+ && !resource_disabled("p4tcc", 0))
return (ENXIO);
device_set_desc(dev, "ACPI CPU Throttling");
diff --git a/sys/dev/acpica/acpi_video.c b/sys/dev/acpica/acpi_video.c
index 472a38d3eb56..7a22c9dc0994 100644
--- a/sys/dev/acpica/acpi_video.c
+++ b/sys/dev/acpica/acpi_video.c
@@ -274,7 +274,7 @@ static void
acpi_video_identify(driver_t *driver, device_t parent)
{
- if (device_find_child(parent, "acpi_video", -1) == NULL)
+ if (device_find_child(parent, "acpi_video", DEVICE_UNIT_ANY) == NULL)
device_add_child(parent, "acpi_video", DEVICE_UNIT_ANY);
}
diff --git a/sys/dev/agp/agp_i810.c b/sys/dev/agp/agp_i810.c
index b63c0aaf634a..9d955745f673 100644
--- a/sys/dev/agp/agp_i810.c
+++ b/sys/dev/agp/agp_i810.c
@@ -680,7 +680,7 @@ static void
agp_i810_identify(driver_t *driver, device_t parent)
{
- if (device_find_child(parent, "agp", -1) == NULL &&
+ if (device_find_child(parent, "agp", DEVICE_UNIT_ANY) == NULL &&
agp_i810_match(parent))
device_add_child(parent, "agp", DEVICE_UNIT_ANY);
}
diff --git a/sys/dev/amdsbwd/amdsbwd.c b/sys/dev/amdsbwd/amdsbwd.c
index 122fa2d58277..d817a7b1364e 100644
--- a/sys/dev/amdsbwd/amdsbwd.c
+++ b/sys/dev/amdsbwd/amdsbwd.c
@@ -255,7 +255,7 @@ amdsbwd_identify(driver_t *driver, device_t parent)
if (resource_disabled("amdsbwd", 0))
return;
- if (device_find_child(parent, "amdsbwd", -1) != NULL)
+ if (device_find_child(parent, "amdsbwd", DEVICE_UNIT_ANY) != NULL)
return;
/*
@@ -271,7 +271,8 @@ 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", DEVICE_UNIT_ANY);
+ 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/amdsmn/amdsmn.c b/sys/dev/amdsmn/amdsmn.c
index 803491e9b0f5..d19103738ec6 100644
--- a/sys/dev/amdsmn/amdsmn.c
+++ b/sys/dev/amdsmn/amdsmn.c
@@ -207,7 +207,7 @@ amdsmn_identify(driver_t *driver, device_t parent)
device_t child;
/* Make sure we're not being doubly invoked. */
- if (device_find_child(parent, "amdsmn", -1) != NULL)
+ if (device_find_child(parent, "amdsmn", DEVICE_UNIT_ANY) != NULL)
return;
if (!amdsmn_match(parent, NULL))
return;
diff --git a/sys/dev/amdtemp/amdtemp.c b/sys/dev/amdtemp/amdtemp.c
index 3ce826a2c0ec..79ccdc8c79fb 100644
--- a/sys/dev/amdtemp/amdtemp.c
+++ b/sys/dev/amdtemp/amdtemp.c
@@ -287,7 +287,7 @@ amdtemp_identify(driver_t *driver, device_t parent)
device_t child;
/* Make sure we're not being doubly invoked. */
- if (device_find_child(parent, "amdtemp", -1) != NULL)
+ if (device_find_child(parent, "amdtemp", DEVICE_UNIT_ANY) != NULL)
return;
if (amdtemp_match(parent, NULL)) {
diff --git a/sys/dev/atopcase/atopcase.c b/sys/dev/atopcase/atopcase.c
index 9e64b389c9e3..8dc81046e47e 100644
--- a/sys/dev/atopcase/atopcase.c
+++ b/sys/dev/atopcase/atopcase.c
@@ -476,7 +476,7 @@ atopcase_add_child(struct atopcase_softc *sc, struct atopcase_child *ac,
goto exit;
}
- hidbus = device_add_child(sc->sc_dev, "hidbus", -1);
+ hidbus = device_add_child(sc->sc_dev, "hidbus", DEVICE_UNIT_ANY);
if (hidbus == NULL) {
device_printf(sc->sc_dev, "can't add child\n");
err = ENOMEM;
diff --git a/sys/dev/bhnd/bhnd_subr.c b/sys/dev/bhnd/bhnd_subr.c
index 1c456ed1cddf..4818fffd5659 100644
--- a/sys/dev/bhnd/bhnd_subr.c
+++ b/sys/dev/bhnd/bhnd_subr.c
@@ -2170,7 +2170,7 @@ bhnd_bus_generic_get_nvram_var(device_t dev, device_t child, const char *name,
bus_topo_assert();
/* Look for a directly-attached NVRAM child */
- if ((nvram = device_find_child(dev, "bhnd_nvram", -1)) != NULL)
+ if ((nvram = device_find_child(dev, "bhnd_nvram", DEVICE_UNIT_ANY)) != NULL)
return BHND_NVRAM_GETVAR(nvram, name, buf, size, type);
/* Try to delegate to parent */
diff --git a/sys/dev/bhnd/cores/chipc/chipc_spi.c b/sys/dev/bhnd/cores/chipc/chipc_spi.c
index e89d128fa441..290933e5ef25 100644
--- a/sys/dev/bhnd/cores/chipc/chipc_spi.c
+++ b/sys/dev/bhnd/cores/chipc/chipc_spi.c
@@ -107,7 +107,8 @@ chipc_spi_attach(device_t dev)
* XXX: This should be replaced with a DEVICE_IDENTIFY implementation
* in chipc-specific subclasses of the mx25l and at45d drivers.
*/
- if ((spibus = device_add_child(dev, "spibus", -1)) == NULL) {
+ if ((spibus = device_add_child(dev, "spibus",
+ DEVICE_UNIT_ANY)) == NULL) {
device_printf(dev, "failed to add spibus\n");
error = ENXIO;
goto failed;
@@ -121,7 +122,8 @@ 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, DEVICE_UNIT_ANY);
+ 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/bwn/if_bwn_pci.c b/sys/dev/bwn/if_bwn_pci.c
index a81284158443..a64c53acf40f 100644
--- a/sys/dev/bwn/if_bwn_pci.c
+++ b/sys/dev/bwn/if_bwn_pci.c
@@ -182,7 +182,7 @@ bwn_pci_attach(device_t dev)
sc->quirks = ident->quirks;
/* Attach bridge device */
- if ((error = bhndb_attach_bridge(dev, &sc->bhndb_dev, -1)))
+ if ((error = bhndb_attach_bridge(dev, &sc->bhndb_dev, DEVICE_UNIT_ANY)))
return (ENXIO);
/* Success */
diff --git a/sys/dev/chromebook_platform/chromebook_platform.c b/sys/dev/chromebook_platform/chromebook_platform.c
index 935685d86955..f873338a3ba6 100644
--- a/sys/dev/chromebook_platform/chromebook_platform.c
+++ b/sys/dev/chromebook_platform/chromebook_platform.c
@@ -70,7 +70,7 @@ chromebook_i2c_identify(driver_t *driver, device_t bus)
return;
for (i = 0; i < nitems(slaves); i++) {
- if (device_find_child(bus, slaves[i].name, -1) != NULL)
+ if (device_find_child(bus, slaves[i].name, DEVICE_UNIT_ANY) != NULL)
continue;
if (slaves[i].pci_id != pci_get_devid(controller))
continue;
diff --git a/sys/dev/coretemp/coretemp.c b/sys/dev/coretemp/coretemp.c
index 4a7e4e7834d8..df1dcff83639 100644
--- a/sys/dev/coretemp/coretemp.c
+++ b/sys/dev/coretemp/coretemp.c
@@ -112,7 +112,7 @@ coretemp_identify(driver_t *driver, device_t parent)
u_int regs[4];
/* Make sure we're not being doubly invoked. */
- if (device_find_child(parent, "coretemp", -1) != NULL)
+ if (device_find_child(parent, "coretemp", DEVICE_UNIT_ANY) != NULL)
return;
/* Check that CPUID 0x06 is supported and the vendor is Intel.*/
diff --git a/sys/dev/cpufreq/cpufreq_dt.c b/sys/dev/cpufreq/cpufreq_dt.c
index e35a8ec73ef4..b212b08e9a83 100644
--- a/sys/dev/cpufreq/cpufreq_dt.c
+++ b/sys/dev/cpufreq/cpufreq_dt.c
@@ -315,7 +315,7 @@ cpufreq_dt_identify(driver_t *driver, device_t parent)
!OF_hasprop(node, "operating-points-v2"))
return;
- if (device_find_child(parent, "cpufreq_dt", -1) != NULL)
+ if (device_find_child(parent, "cpufreq_dt", DEVICE_UNIT_ANY) != NULL)
return;
if (BUS_ADD_CHILD(parent, 0, "cpufreq_dt", device_get_unit(parent))
diff --git a/sys/dev/cpufreq/ichss.c b/sys/dev/cpufreq/ichss.c
index f1ec62ed6d8a..6c30bbb9700d 100644
--- a/sys/dev/cpufreq/ichss.c
+++ b/sys/dev/cpufreq/ichss.c
@@ -147,7 +147,7 @@ ichss_identify(driver_t *driver, device_t parent)
return;
/* Avoid duplicates. */
- if (device_find_child(parent, "ichss", -1))
+ if (device_find_child(parent, "ichss", DEVICE_UNIT_ANY))
return;
/*
@@ -218,13 +218,15 @@ ichss_probe(device_t dev)
* info, let it manage things. Also, if Enhanced SpeedStep is
* available, don't attach.
*/
- perf_dev = device_find_child(device_get_parent(dev), "acpi_perf", -1);
+ perf_dev = device_find_child(device_get_parent(dev), "acpi_perf",
+ DEVICE_UNIT_ANY);
if (perf_dev && device_is_attached(perf_dev)) {
error = CPUFREQ_DRV_TYPE(perf_dev, &type);
if (error == 0 && (type & CPUFREQ_FLAG_INFO_ONLY) == 0)
return (ENXIO);
}
- est_dev = device_find_child(device_get_parent(dev), "est", -1);
+ est_dev = device_find_child(device_get_parent(dev), "est",
+ DEVICE_UNIT_ANY);
if (est_dev && device_is_attached(est_dev))
return (ENXIO);
diff --git a/sys/dev/cxgb/cxgb_main.c b/sys/dev/cxgb/cxgb_main.c
index 882d1c6cc4a4..616a2ecc1a37 100644
--- a/sys/dev/cxgb/cxgb_main.c
+++ b/sys/dev/cxgb/cxgb_main.c
@@ -622,7 +622,8 @@ cxgb_controller_attach(device_t dev)
for (i = 0; i < (sc)->params.nports; i++) {
struct port_info *pi;
- if ((child = device_add_child(dev, "cxgb", -1)) == NULL) {
+ if ((child = device_add_child(dev, "cxgb",
+ DEVICE_UNIT_ANY)) == NULL) {
device_printf(dev, "failed to add child port\n");
error = EINVAL;
goto out;
diff --git a/sys/dev/cxgbe/crypto/t4_crypto.c b/sys/dev/cxgbe/crypto/t4_crypto.c
index 568a948a49f7..2c83b10b13d6 100644
--- a/sys/dev/cxgbe/crypto/t4_crypto.c
+++ b/sys/dev/cxgbe/crypto/t4_crypto.c
@@ -1804,7 +1804,7 @@ ccr_identify(driver_t *driver, device_t parent)
sc = device_get_softc(parent);
if (sc->cryptocaps & FW_CAPS_CONFIG_CRYPTO_LOOKASIDE &&
- device_find_child(parent, "ccr", -1) == NULL)
+ device_find_child(parent, "ccr", DEVICE_UNIT_ANY) == NULL)
device_add_child(parent, "ccr", DEVICE_UNIT_ANY);
}
diff --git a/sys/dev/dpaa2/dpaa2_mc_acpi.c b/sys/dev/dpaa2/dpaa2_mc_acpi.c
index 1042ea56d8cf..55c1c0d5b12e 100644
--- a/sys/dev/dpaa2/dpaa2_mc_acpi.c
+++ b/sys/dev/dpaa2/dpaa2_mc_acpi.c
@@ -229,7 +229,7 @@ dpaa2_mc_acpi_probe_child(ACPI_HANDLE h, device_t *dev, int level, void *arg)
if ((ad = malloc(sizeof(*ad), M_DEVBUF, M_NOWAIT | M_ZERO)) == NULL)
return (AE_OK);
- child = device_add_child(ctx->dev, "dpaa2_mac_dev", -1);
+ child = device_add_child(ctx->dev, "dpaa2_mac_dev", DEVICE_UNIT_ANY);
if (child == NULL) {
free(ad, M_DEVBUF);
return (AE_OK);
diff --git a/sys/dev/dpaa2/dpaa2_rc.c b/sys/dev/dpaa2/dpaa2_rc.c
index d8e15e388bf5..3cb2fdfeaa2e 100644
--- a/sys/dev/dpaa2/dpaa2_rc.c
+++ b/sys/dev/dpaa2/dpaa2_rc.c
@@ -2905,7 +2905,7 @@ dpaa2_rc_add_child(struct dpaa2_rc_softc *sc, struct dpaa2_cmd *cmd,
}
/* Add a device for the DPAA2 object. */
- dev = device_add_child(rcdev, devclass, -1);
+ dev = device_add_child(rcdev, devclass, DEVICE_UNIT_ANY);
if (dev == NULL) {
device_printf(rcdev, "%s: failed to add a device for DPAA2 "
"object: type=%s, id=%u\n", __func__, dpaa2_ttos(obj->type),
@@ -3031,7 +3031,7 @@ dpaa2_rc_add_managed_child(struct dpaa2_rc_softc *sc, struct dpaa2_cmd *cmd,
}
/* Add a device for the DPAA2 object. */
- dev = device_add_child(rcdev, devclass, -1);
+ dev = device_add_child(rcdev, devclass, DEVICE_UNIT_ANY);
if (dev == NULL) {
device_printf(rcdev, "%s: failed to add a device for DPAA2 "
"object: type=%s, id=%u\n", __func__, dpaa2_ttos(obj->type),
diff --git a/sys/dev/dpaa2/memac_mdio_acpi.c b/sys/dev/dpaa2/memac_mdio_acpi.c
index 3a816901815b..dc08715343e0 100644
--- a/sys/dev/dpaa2/memac_mdio_acpi.c
+++ b/sys/dev/dpaa2/memac_mdio_acpi.c
@@ -227,7 +227,7 @@ memac_mdio_acpi_probe_child(ACPI_HANDLE h, device_t *dev, int level, void *arg)
if ((ad = malloc(sizeof(*ad), M_DEVBUF, M_NOWAIT | M_ZERO)) == NULL)
return (AE_OK);
- child = device_add_child(ctx->dev, "memacphy_acpi", -1);
+ child = device_add_child(ctx->dev, "memacphy_acpi", DEVICE_UNIT_ANY);
if (child == NULL) {
free(ad, M_DEVBUF);
return (AE_OK);
diff --git a/sys/dev/efidev/efirtc.c b/sys/dev/efidev/efirtc.c
index a7baff673c1c..69d2c0b1af9f 100644
--- a/sys/dev/efidev/efirtc.c
+++ b/sys/dev/efidev/efirtc.c
@@ -52,9 +52,9 @@ efirtc_identify(driver_t *driver, device_t parent)
/* Don't add the driver unless we have working runtime services. */
if (efi_rt_ok() != 0)
return;
- if (device_find_child(parent, "efirtc", -1) != NULL)
+ if (device_find_child(parent, "efirtc", DEVICE_UNIT_ANY) != NULL)
return;
- if (BUS_ADD_CHILD(parent, 0, "efirtc", -1) == NULL)
+ if (BUS_ADD_CHILD(parent, 0, "efirtc", DEVICE_UNIT_ANY) == NULL)
device_printf(parent, "add child failed\n");
}
diff --git a/sys/dev/etherswitch/e6000sw/e6000sw.c b/sys/dev/etherswitch/e6000sw/e6000sw.c
index 4ef510b85c70..7e9193f4ba47 100644
--- a/sys/dev/etherswitch/e6000sw/e6000sw.c
+++ b/sys/dev/etherswitch/e6000sw/e6000sw.c
@@ -205,7 +205,7 @@ static void
e6000sw_identify(driver_t *driver, device_t parent)
{
- if (device_find_child(parent, "e6000sw", -1) == NULL)
+ if (device_find_child(parent, "e6000sw", DEVICE_UNIT_ANY) == NULL)
BUS_ADD_CHILD(parent, 0, "e6000sw", DEVICE_UNIT_ANY);
}
diff --git a/sys/dev/etherswitch/etherswitch.c b/sys/dev/etherswitch/etherswitch.c
index c66918f77174..ba46d8b2299d 100644
--- a/sys/dev/etherswitch/etherswitch.c
+++ b/sys/dev/etherswitch/etherswitch.c
@@ -82,7 +82,7 @@ static struct cdevsw etherswitch_cdevsw = {
static void
etherswitch_identify(driver_t *driver, device_t parent)
{
- if (device_find_child(parent, "etherswitch", -1) == NULL)
+ if (device_find_child(parent, "etherswitch", DEVICE_UNIT_ANY) == NULL)
BUS_ADD_CHILD(parent, 0, "etherswitch", DEVICE_UNIT_ANY);
}
diff --git a/sys/dev/etherswitch/ip17x/ip17x.c b/sys/dev/etherswitch/ip17x/ip17x.c
index c90d46c49857..42d3bf990c0e 100644
--- a/sys/dev/etherswitch/ip17x/ip17x.c
+++ b/sys/dev/etherswitch/ip17x/ip17x.c
@@ -83,7 +83,7 @@ static void ip17x_ifmedia_sts(if_t, struct ifmediareq *);
static void
ip17x_identify(driver_t *driver, device_t parent)
{
- if (device_find_child(parent, "ip17x", -1) == NULL)
+ if (device_find_child(parent, "ip17x", DEVICE_UNIT_ANY) == NULL)
BUS_ADD_CHILD(parent, 0, "ip17x", DEVICE_UNIT_ANY);
}
diff --git a/sys/dev/etherswitch/miiproxy.c b/sys/dev/etherswitch/miiproxy.c
index 2af6533d41c8..79342a9e8e03 100644
--- a/sys/dev/etherswitch/miiproxy.c
+++ b/sys/dev/etherswitch/miiproxy.c
@@ -331,7 +331,7 @@ mdioproxy_rendezvous_callback(enum rendezvous_op op, struct rendezvous_entry *re
static void
mdioproxy_identify(driver_t *driver, device_t parent)
{
- if (device_find_child(parent, driver->name, -1) == NULL) {
+ if (device_find_child(parent, driver->name, DEVICE_UNIT_ANY) == NULL) {
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 079244b2f745..9000061ae138 100644
--- a/sys/dev/etherswitch/rtl8366/rtl8366rb.c
+++ b/sys/dev/etherswitch/rtl8366/rtl8366rb.c
@@ -133,7 +133,7 @@ rtl8366rb_identify(driver_t *driver, device_t parent)
device_t child;
struct iicbus_ivar *devi;
- if (device_find_child(parent, "rtl8366rb", -1) == NULL) {
+ if (device_find_child(parent, "rtl8366rb", DEVICE_UNIT_ANY) == NULL) {
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/sbp.c b/sys/dev/firewire/sbp.c
index 2a91f6987e69..be1e60e45e75 100644
--- a/sys/dev/firewire/sbp.c
+++ b/sys/dev/firewire/sbp.c
@@ -303,7 +303,7 @@ SBP_DEBUG(0)
printf("sbp_identify\n");
END_DEBUG
- if (device_find_child(parent, "sbp", -1) == NULL)
+ if (device_find_child(parent, "sbp", DEVICE_UNIT_ANY) == NULL)
BUS_ADD_CHILD(parent, 0, "sbp", DEVICE_UNIT_ANY);
}
diff --git a/sys/dev/glxiic/glxiic.c b/sys/dev/glxiic/glxiic.c
index ddaa77b6b73c..ef0a0e111339 100644
--- a/sys/dev/glxiic/glxiic.c
+++ b/sys/dev/glxiic/glxiic.c
@@ -284,11 +284,11 @@ glxiic_identify(driver_t *driver, device_t parent)
{
/* Prevent child from being added more than once. */
- if (device_find_child(parent, driver->name, -1) != NULL)
+ if (device_find_child(parent, driver->name, DEVICE_UNIT_ANY) != NULL)
return;
if (pci_get_devid(parent) == GLXIIC_CS5536_DEV_ID) {
- if (device_add_child(parent, driver->name, -1) == NULL)
+ if (device_add_child(parent, driver->name, DEVICE_UNIT_ANY) == NULL)
device_printf(parent, "Could not add glxiic child\n");
}
}
@@ -390,7 +390,8 @@ glxiic_attach(device_t dev)
goto out;
}
- if ((sc->iicbus = device_add_child(dev, "iicbus", -1)) == NULL) {
+ if ((sc->iicbus = device_add_child(dev, "iicbus",
+ DEVICE_UNIT_ANY)) == NULL) {
device_printf(dev, "Could not allocate iicbus instance\n");
error = ENXIO;
goto out;
diff --git a/sys/dev/gpio/gpiobus.c b/sys/dev/gpio/gpiobus.c
index e053adacf457..2e2618805e7b 100644
--- a/sys/dev/gpio/gpiobus.c
+++ b/sys/dev/gpio/gpiobus.c
@@ -300,7 +300,7 @@ gpiobus_attach_bus(device_t dev)
busdev = device_add_child(dev, "gpiobus", DEVICE_UNIT_ANY);
if (busdev == NULL)
return (NULL);
- if (device_add_child(dev, "gpioc", -1) == NULL) {
+ if (device_add_child(dev, "gpioc", DEVICE_UNIT_ANY) == NULL) {
device_delete_child(dev, busdev);
return (NULL);
}
diff --git a/sys/dev/hid/hidraw.c b/sys/dev/hid/hidraw.c
index 9b6f83d34d08..06f70070f61b 100644
--- a/sys/dev/hid/hidraw.c
+++ b/sys/dev/hid/hidraw.c
@@ -183,7 +183,7 @@ hidraw_identify(driver_t *driver, device_t parent)
{
device_t child;
- if (device_find_child(parent, "hidraw", -1) == NULL) {
+ if (device_find_child(parent, "hidraw", DEVICE_UNIT_ANY) == NULL) {
child = BUS_ADD_CHILD(parent, 0, "hidraw",
device_get_unit(parent));
if (child != NULL)
diff --git a/sys/dev/hyperv/input/hv_hid.c b/sys/dev/hyperv/input/hv_hid.c
index a26c46184442..ec68581d63a8 100644
--- a/sys/dev/hyperv/input/hv_hid.c
+++ b/sys/dev/hyperv/input/hv_hid.c
@@ -436,7 +436,7 @@ hv_hid_attach(device_t dev)
ret = ENODEV;
goto out;
}
- child = device_add_child(sc->dev, "hidbus", -1);
+ child = device_add_child(sc->dev, "hidbus", DEVICE_UNIT_ANY);
if (child == NULL) {
device_printf(sc->dev, "failed to add hidbus\n");
ret = ENOMEM;
diff --git a/sys/dev/hyperv/vmbus/vmbus_et.c b/sys/dev/hyperv/vmbus/vmbus_et.c
index 21b1cd9e4e39..33eb94daacd3 100644
--- a/sys/dev/hyperv/vmbus/vmbus_et.c
+++ b/sys/dev/hyperv/vmbus/vmbus_et.c
@@ -127,7 +127,7 @@ static void
vmbus_et_identify(driver_t *driver, device_t parent)
{
if (device_get_unit(parent) != 0 ||
- device_find_child(parent, VMBUS_ET_NAME, -1) != NULL ||
+ device_find_child(parent, VMBUS_ET_NAME, DEVICE_UNIT_ANY) != NULL ||
(hyperv_features & CPUID_HV_ET_MASK) != CPUID_HV_ET_MASK ||
hyperv_tc64 == NULL)
return;
diff --git a/sys/dev/ichsmb/ichsmb.c b/sys/dev/ichsmb/ichsmb.c
index 28503b9e574d..c5e9e2f1b9ed 100644
--- a/sys/dev/ichsmb/ichsmb.c
+++ b/sys/dev/ichsmb/ichsmb.c
@@ -112,7 +112,8 @@ ichsmb_attach(device_t dev)
mtx_init(&sc->mutex, device_get_nameunit(dev), "ichsmb", MTX_DEF);
/* Add child: an instance of the "smbus" device */
- if ((sc->smb = device_add_child(dev, DRIVER_SMBUS, -1)) == NULL) {
+ if ((sc->smb = device_add_child(dev, DRIVER_SMBUS,
+ DEVICE_UNIT_ANY)) == NULL) {
device_printf(dev, "no \"%s\" child found\n", DRIVER_SMBUS);
error = ENXIO;
goto fail;
diff --git a/sys/dev/iicbus/controller/cadence/cdnc_i2c.c b/sys/dev/iicbus/controller/cadence/cdnc_i2c.c
index ad18ff39961a..2e7950dab9c1 100644
--- a/sys/dev/iicbus/controller/cadence/cdnc_i2c.c
+++ b/sys/dev/iicbus/controller/cadence/cdnc_i2c.c
@@ -612,7 +612,7 @@ cdnc_i2c_attach(device_t dev)
return (err);
}
- sc->iicbus = device_add_child(dev, "iicbus", -1);
+ sc->iicbus = device_add_child(dev, "iicbus", DEVICE_UNIT_ANY);
cdnc_i2c_add_sysctls(dev);
diff --git a/sys/dev/iicbus/controller/twsi/twsi.c b/sys/dev/iicbus/controller/twsi/twsi.c
index b5aefbae7d7e..46704e1eab65 100644
--- a/sys/dev/iicbus/controller/twsi/twsi.c
+++ b/sys/dev/iicbus/controller/twsi/twsi.c
@@ -812,7 +812,8 @@ twsi_attach(device_t dev)
&sc->debug, 0, "Set debug level (zero to disable)");
/* Attach the iicbus. */
- if ((sc->iicbus = device_add_child(dev, "iicbus", -1)) == NULL) {
+ if ((sc->iicbus = device_add_child(dev, "iicbus",
+ DEVICE_UNIT_ANY)) == NULL) {
device_printf(dev, "could not allocate iicbus instance\n");
twsi_detach(dev);
return (ENXIO);
diff --git a/sys/dev/iicbus/iic.c b/sys/dev/iicbus/iic.c
index ec37a6e19342..3b7d603005aa 100644
--- a/sys/dev/iicbus/iic.c
+++ b/sys/dev/iicbus/iic.c
@@ -133,7 +133,7 @@ static void
iic_identify(driver_t *driver, device_t parent)
{
- if (device_find_child(parent, "iic", -1) == NULL)
+ if (device_find_child(parent, "iic", DEVICE_UNIT_ANY) == NULL)
BUS_ADD_CHILD(parent, 0, "iic", DEVICE_UNIT_ANY);
}
diff --git a/sys/dev/iicbus/iicsmb.c b/sys/dev/iicbus/iicsmb.c
index a5885648632e..e03e789dc05d 100644
--- a/sys/dev/iicbus/iicsmb.c
+++ b/sys/dev/iicbus/iicsmb.c
@@ -134,7 +134,7 @@ static void
iicsmb_identify(driver_t *driver, device_t parent)
{
- if (device_find_child(parent, "iicsmb", -1) == NULL)
+ if (device_find_child(parent, "iicsmb", DEVICE_UNIT_ANY) == NULL)
BUS_ADD_CHILD(parent, 0, "iicsmb", DEVICE_UNIT_ANY);
}
diff --git a/sys/dev/ipmi/ipmi_isa.c b/sys/dev/ipmi/ipmi_isa.c
index 7ae55baf2f8f..0c74307db00d 100644
--- a/sys/dev/ipmi/ipmi_isa.c
+++ b/sys/dev/ipmi/ipmi_isa.c
@@ -57,7 +57,7 @@ ipmi_isa_identify(driver_t *driver, device_t parent)
uint32_t devid;
if (ipmi_smbios_identify(&info) && info.iface_type != SSIF_MODE &&
- device_find_child(parent, "ipmi", -1) == NULL) {
+ device_find_child(parent, "ipmi", DEVICE_UNIT_ANY) == NULL) {
/*
* XXX: Hack alert. On some broken systems, the IPMI
* interface is described via SMBIOS, but the actual
diff --git a/sys/dev/ipmi/ipmi_smbus.c b/sys/dev/ipmi/ipmi_smbus.c
index 1772d9313892..9516b3dfa487 100644
--- a/sys/dev/ipmi/ipmi_smbus.c
+++ b/sys/dev/ipmi/ipmi_smbus.c
@@ -59,7 +59,7 @@ ipmi_smbus_identify(driver_t *driver, device_t parent)
struct ipmi_get_info info;
if (ipmi_smbios_identify(&info) && info.iface_type == SSIF_MODE &&
- device_find_child(parent, "ipmi", -1) == NULL)
+ device_find_child(parent, "ipmi", DEVICE_UNIT_ANY) == NULL)
BUS_ADD_CHILD(parent, 0, "ipmi", DEVICE_UNIT_ANY);
}
diff --git a/sys/dev/isl/isl.c b/sys/dev/isl/isl.c
index 009c02ad2b35..6a0d406aeeda 100644
--- a/sys/dev/isl/isl.c
+++ b/sys/dev/isl/isl.c
@@ -149,7 +149,7 @@ static void
isl_identify(driver_t *driver, device_t parent)
{
- if (device_find_child(parent, "asl", -1)) {
+ if (device_find_child(parent, "asl", DEVICE_UNIT_ANY)) {
if (bootverbose)
printf("asl: device(s) already created\n");
return;
diff --git a/sys/dev/ismt/ismt.c b/sys/dev/ismt/ismt.c
index 4aea93d1f435..5e6b7c8ebf18 100644
--- a/sys/dev/ismt/ismt.c
+++ b/sys/dev/ismt/ismt.c
@@ -586,7 +586,8 @@ ismt_attach(device_t dev)
sc->pcidev = dev;
pci_enable_busmaster(dev);
- if ((sc->smbdev = device_add_child(dev, "smbus", -1)) == NULL) {
+ if ((sc->smbdev = device_add_child(dev, "smbus",
+ DEVICE_UNIT_ANY)) == NULL) {
device_printf(dev, "no smbus child found\n");
err = ENXIO;
goto fail;
diff --git a/sys/dev/kvm_clock/kvm_clock.c b/sys/dev/kvm_clock/kvm_clock.c
index dd756b99b5e0..43da9b69edc8 100644
--- a/sys/dev/kvm_clock/kvm_clock.c
+++ b/sys/dev/kvm_clock/kvm_clock.c
@@ -141,7 +141,7 @@ kvm_clock_identify(driver_t *driver, device_t parent)
if ((regs[0] &
(KVM_FEATURE_CLOCKSOURCE2 | KVM_FEATURE_CLOCKSOURCE)) == 0)
return;
- if (device_find_child(parent, KVM_CLOCK_DEVNAME, -1))
+ if (device_find_child(parent, KVM_CLOCK_DEVNAME, DEVICE_UNIT_ANY))
return;
BUS_ADD_CHILD(parent, 0, KVM_CLOCK_DEVNAME, 0);
}
diff --git a/sys/dev/mdio/mdio.c b/sys/dev/mdio/mdio.c
index 706a1048c5eb..0ef7e7453799 100644
--- a/sys/dev/mdio/mdio.c
+++ b/sys/dev/mdio/mdio.c
@@ -37,7 +37,7 @@ static void
mdio_identify(driver_t *driver, device_t parent)
{
- if (device_find_child(parent, mdio_driver.name, -1) == NULL)
+ if (device_find_child(parent, mdio_driver.name, DEVICE_UNIT_ANY) == NULL)
BUS_ADD_CHILD(parent, 0, mdio_driver.name, DEVICE_UNIT_ANY);
}
diff --git a/sys/dev/mfi/mfi.c b/sys/dev/mfi/mfi.c
index 9e41464a7a2a..13e5dfc84fd1 100644
--- a/sys/dev/mfi/mfi.c
+++ b/sys/dev/mfi/mfi.c
@@ -1922,7 +1922,8 @@ mfi_add_ld_complete(struct mfi_command *cm)
mtx_unlock(&sc->mfi_io_lock);
bus_topo_lock();
- if ((child = device_add_child(sc->mfi_dev, "mfid", -1)) == NULL) {
+ if ((child = device_add_child(sc->mfi_dev, "mfid",
+ DEVICE_UNIT_ANY)) == NULL) {
device_printf(sc->mfi_dev, "Failed to add logical disk\n");
free(ld_info, M_MFIBUF);
bus_topo_unlock();
@@ -2010,7 +2011,8 @@ mfi_add_sys_pd_complete(struct mfi_command *cm)
mtx_unlock(&sc->mfi_io_lock);
bus_topo_lock();
- if ((child = device_add_child(sc->mfi_dev, "mfisyspd", -1)) == NULL) {
+ if ((child = device_add_child(sc->mfi_dev, "mfisyspd",
+ DEVICE_UNIT_ANY)) == NULL) {
device_printf(sc->mfi_dev, "Failed to add system pd\n");
free(pd_info, M_MFIBUF);
bus_topo_unlock();
diff --git a/sys/dev/mfi/mfi_cam.c b/sys/dev/mfi/mfi_cam.c
index cce303c123e5..af95ff957d8c 100644
--- a/sys/dev/mfi/mfi_cam.c
+++ b/sys/dev/mfi/mfi_cam.c
@@ -298,7 +298,7 @@ mfip_cam_rescan(struct mfi_softc *sc, uint32_t tid)
device_t mfip_dev;
bus_topo_lock();
- mfip_dev = device_find_child(sc->mfi_dev, "mfip", -1);
+ mfip_dev = device_find_child(sc->mfi_dev, "mfip", DEVICE_UNIT_ANY);
bus_topo_unlock();
if (mfip_dev == NULL) {
device_printf(sc->mfi_dev, "Couldn't find mfip child device!\n");
diff --git a/sys/dev/mmcnull/mmcnull.c b/sys/dev/mmcnull/mmcnull.c
index 028d3aabd7f1..ec4bc1339778 100644
--- a/sys/dev/mmcnull/mmcnull.c
+++ b/sys/dev/mmcnull/mmcnull.c
@@ -77,7 +77,7 @@ mmcnull_identify(driver_t *driver, device_t parent)
return;
/* Avoid duplicates. */
- if (device_find_child(parent, "mmcnull", -1))
+ if (device_find_child(parent, "mmcnull", DEVICE_UNIT_ANY))
return;
child = BUS_ADD_CHILD(parent, 20, "mmcnull", 0);
diff --git a/sys/dev/nvdimm/nvdimm_e820.c b/sys/dev/nvdimm/nvdimm_e820.c
index 6f9bb4c70f7a..f916801750b6 100644
--- a/sys/dev/nvdimm/nvdimm_e820.c
+++ b/sys/dev/nvdimm/nvdimm_e820.c
@@ -261,7 +261,7 @@ nvdimm_e820_identify(driver_t *driver, device_t parent)
if (resource_disabled(driver->name, 0))
return;
/* Just create a single instance of the fake bus. */
- if (device_find_child(parent, driver->name, -1) != NULL)
+ if (device_find_child(parent, driver->name, DEVICE_UNIT_ANY) != NULL)
return;
smapbase = (const void *)preload_search_info(preload_kmdp,
diff --git a/sys/dev/nvmf/host/nvmf_ctldev.c b/sys/dev/nvmf/host/nvmf_ctldev.c
index bc79bd99f639..275d5e9c932a 100644
--- a/sys/dev/nvmf/host/nvmf_ctldev.c
+++ b/sys/dev/nvmf/host/nvmf_ctldev.c
@@ -29,7 +29,7 @@ nvmf_handoff_host(struct nvmf_ioc_nv *nv)
return (error);
bus_topo_lock();
- dev = device_add_child(root_bus, "nvme", -1);
+ dev = device_add_child(root_bus, "nvme", DEVICE_UNIT_ANY);
if (dev == NULL) {
bus_topo_unlock();
error = ENXIO;
diff --git a/sys/dev/p2sb/lewisburg_gpiocm.c b/sys/dev/p2sb/lewisburg_gpiocm.c
index f5c1792c69e1..9dbbd84f2379 100644
--- a/sys/dev/p2sb/lewisburg_gpiocm.c
+++ b/sys/dev/p2sb/lewisburg_gpiocm.c
@@ -315,7 +315,7 @@ lbggpiocm_attach(device_t dev)
group->npins = npins < MAX_PAD_PER_GROUP ? npins :
MAX_PAD_PER_GROUP;
npins -= group->npins;
- group->dev = device_add_child(dev, "gpio", -1);
+ group->dev = device_add_child(dev, "gpio", DEVICE_UNIT_ANY);
}
sc->community->ngroups = i;
bus_attach_children(dev);
diff --git a/sys/dev/pcf/pcf_isa.c b/sys/dev/pcf/pcf_isa.c
index f86caed87e6a..c797dc31e6d9 100644
--- a/sys/dev/pcf/pcf_isa.c
+++ b/sys/dev/pcf/pcf_isa.c
@@ -160,7 +160,7 @@ pcf_isa_attach(device_t dev)
}
}
- if ((sc->iicbus = device_add_child(dev, "iicbus", -1)) == NULL)
+ if ((sc->iicbus = device_add_child(dev, "iicbus", DEVICE_UNIT_ANY)) == NULL)
device_printf(dev, "could not allocate iicbus instance\n");
/* probe and attach the iicbus */
diff --git a/sys/dev/pci/pci_host_generic_den0115.c b/sys/dev/pci/pci_host_generic_den0115.c
index 3f6daa12344e..d8e3f9feaf18 100644
--- a/sys/dev/pci/pci_host_generic_den0115.c
+++ b/sys/dev/pci/pci_host_generic_den0115.c
@@ -193,7 +193,7 @@ pci_host_acpi_smccc_attach(device_t dev)
sc->base.bus_end = MIN(sc->base.bus_end, end);
}
- device_add_child(dev, "pci", -1);
+ device_add_child(dev, "pci", DEVICE_UNIT_ANY);
bus_attach_children(dev);
return (0);
}
diff --git a/sys/dev/ppbus/if_plip.c b/sys/dev/ppbus/if_plip.c
index 598c0c49b82e..16139139c0e7 100644
--- a/sys/dev/ppbus/if_plip.c
+++ b/sys/dev/ppbus/if_plip.c
@@ -214,7 +214,7 @@ lp_identify(driver_t *driver, device_t parent)
{
device_t dev;
- dev = device_find_child(parent, "plip", -1);
+ dev = device_find_child(parent, "plip", DEVICE_UNIT_ANY);
if (!dev)
BUS_ADD_CHILD(parent, 0, "plip", DEVICE_UNIT_ANY);
}
diff --git a/sys/dev/ppbus/lpbb.c b/sys/dev/ppbus/lpbb.c
index 3380cdfdaed4..3d2253ed9378 100644
--- a/sys/dev/ppbus/lpbb.c
+++ b/sys/dev/ppbus/lpbb.c
@@ -61,7 +61,7 @@ lpbb_identify(driver_t *driver, device_t parent)
device_t dev;
- dev = device_find_child(parent, "lpbb", -1);
+ dev = device_find_child(parent, "lpbb", DEVICE_UNIT_ANY);
if (!dev)
BUS_ADD_CHILD(parent, 0, "lpbb", DEVICE_UNIT_ANY);
}
diff --git a/sys/dev/ppbus/lpt.c b/sys/dev/ppbus/lpt.c
index 97e8c59f9282..401e94d25727 100644
--- a/sys/dev/ppbus/lpt.c
+++ b/sys/dev/ppbus/lpt.c
@@ -336,7 +336,7 @@ lpt_identify(driver_t *driver, device_t parent)
device_t dev;
- dev = device_find_child(parent, LPT_NAME, -1);
+ dev = device_find_child(parent, LPT_NAME, DEVICE_UNIT_ANY);
if (!dev)
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 7cee6692b367..47a1a010a311 100644
--- a/sys/dev/ppbus/pcfclock.c
+++ b/sys/dev/ppbus/pcfclock.c
@@ -111,7 +111,7 @@ pcfclock_identify(driver_t *driver, device_t parent)
device_t dev;
- dev = device_find_child(parent, PCFCLOCK_NAME, -1);
+ dev = device_find_child(parent, PCFCLOCK_NAME, DEVICE_UNIT_ANY);
if (!dev)
BUS_ADD_CHILD(parent, 0, PCFCLOCK_NAME, DEVICE_UNIT_ANY);
}
diff --git a/sys/dev/ppbus/ppi.c b/sys/dev/ppbus/ppi.c
index 65921b53e0c6..3fd5f43a4a3a 100644
--- a/sys/dev/ppbus/ppi.c
+++ b/sys/dev/ppbus/ppi.c
@@ -135,7 +135,7 @@ ppi_identify(driver_t *driver, device_t parent)
device_t dev;
- dev = device_find_child(parent, "ppi", -1);
+ dev = device_find_child(parent, "ppi", DEVICE_UNIT_ANY);
if (!dev)
BUS_ADD_CHILD(parent, 0, "ppi", DEVICE_UNIT_ANY);
}
diff --git a/sys/dev/ppbus/pps.c b/sys/dev/ppbus/pps.c
index 5a2791aa0335..80581e3beae7 100644
--- a/sys/dev/ppbus/pps.c
+++ b/sys/dev/ppbus/pps.c
@@ -76,7 +76,7 @@ ppsidentify(driver_t *driver, device_t parent)
device_t dev;
- dev = device_find_child(parent, PPS_NAME, -1);
+ dev = device_find_child(parent, PPS_NAME, DEVICE_UNIT_ANY);
if (!dev)
BUS_ADD_CHILD(parent, 0, PPS_NAME, DEVICE_UNIT_ANY);
}
diff --git a/sys/dev/psci/smccc_errata.c b/sys/dev/psci/smccc_errata.c
index db6b0a588a86..92f39c72c7f0 100644
--- a/sys/dev/psci/smccc_errata.c
+++ b/sys/dev/psci/smccc_errata.c
@@ -78,7 +78,7 @@ errata_identify(driver_t *driver, device_t parent)
if (version < EM_VERSION_MIN)
return;
- if (BUS_ADD_CHILD(parent, 0, "errata", -1) == NULL)
+ if (BUS_ADD_CHILD(parent, 0, "errata", DEVICE_UNIT_ANY) == NULL)
device_printf(parent, "add errata child failed\n");
}
diff --git a/sys/dev/psci/smccc_trng.c b/sys/dev/psci/smccc_trng.c
index 67939f3422fa..5f54d8adc24a 100644
--- a/sys/dev/psci/smccc_trng.c
+++ b/sys/dev/psci/smccc_trng.c
@@ -78,7 +78,7 @@ trng_identify(driver_t *driver, device_t parent)
if (version < TRNG_VERSION_MIN)
return;
- if (BUS_ADD_CHILD(parent, 0, "trng", -1) == NULL)
+ if (BUS_ADD_CHILD(parent, 0, "trng", DEVICE_UNIT_ANY) == NULL)
device_printf(parent, "add TRNG child failed\n");
}
diff --git a/sys/dev/pwm/ofw_pwmbus.c b/sys/dev/pwm/ofw_pwmbus.c
index 28a6a542c0a7..913792374fd9 100644
--- a/sys/dev/pwm/ofw_pwmbus.c
+++ b/sys/dev/pwm/ofw_pwmbus.c
@@ -150,7 +150,8 @@ ofw_pwmbus_attach(device_t dev)
if (chan >= sc->base.nchannels)
continue;
- if ((child = ofw_pwmbus_add_child(dev, 0, NULL, -1)) == NULL)
+ if ((child = ofw_pwmbus_add_child(dev, 0, NULL,
+ DEVICE_UNIT_ANY)) == NULL)
continue;
ivars = device_get_ivars(child);
@@ -173,7 +174,8 @@ ofw_pwmbus_attach(device_t dev)
*/
if (!any_children) {
for (chan = 0; chan < sc->base.nchannels; ++chan) {
- child = ofw_pwmbus_add_child(dev, 0, "pwmc", -1);
+ child = ofw_pwmbus_add_child(dev, 0, "pwmc",
+ DEVICE_UNIT_ANY);
if (child == NULL) {
device_printf(dev, "failed to add pwmc child "
" device for channel %u\n", chan);
diff --git a/sys/dev/qat/qat/qat_ocf.c b/sys/dev/qat/qat/qat_ocf.c
index afdc5f396c80..74f113e46884 100644
--- a/sys/dev/qat/qat/qat_ocf.c
+++ b/sys/dev/qat/qat/qat_ocf.c
@@ -941,8 +941,8 @@ fail:
static void
qat_ocf_identify(driver_t *drv, device_t parent)
{
- if (device_find_child(parent, "qat_ocf", -1) == NULL &&
- BUS_ADD_CHILD(parent, 200, "qat_ocf", -1) == 0)
+ if (device_find_child(parent, "qat_ocf", DEVICE_UNIT_ANY) == NULL &&
+ BUS_ADD_CHILD(parent, 200, "qat_ocf", DEVICE_UNIT_ANY) == 0)
device_printf(parent, "qat_ocf: could not attach!");
}
diff --git a/sys/dev/qcom_qup/qcom_spi.c b/sys/dev/qcom_qup/qcom_spi.c
index 88341b4d2083..87e70d531324 100644
--- a/sys/dev/qcom_qup/qcom_spi.c
+++ b/sys/dev/qcom_qup/qcom_spi.c
@@ -420,7 +420,7 @@ qcom_spi_attach(device_t dev)
}
QCOM_SPI_UNLOCK(sc);
- sc->spibus = device_add_child(dev, "spibus", -1);
+ sc->spibus = device_add_child(dev, "spibus", DEVICE_UNIT_ANY);
/* We're done, so shut down the interface clock for now */
device_printf(dev, "DONE: shutting down interface clock for now\n");
diff --git a/sys/dev/sdio/sdiob.c b/sys/dev/sdio/sdiob.c
index 701ade4b3467..4ec2058fa2e4 100644
--- a/sys/dev/sdio/sdiob.c
+++ b/sys/dev/sdio/sdiob.c
@@ -923,7 +923,7 @@ sdio_newbus_sim_add(struct sdiob_softc *sc)
__func__, sc, sc->periph, sc->periph->sim));
if (sc->dev == NULL)
- sc->dev = BUS_ADD_CHILD(pdev, 0, SDIOB_NAME_S, -1);
+ sc->dev = BUS_ADD_CHILD(pdev, 0, SDIOB_NAME_S, DEVICE_UNIT_ANY);
if (sc->dev == NULL)
return (ENXIO);
device_set_softc(sc->dev, sc);
diff --git a/sys/dev/smbus/smb.c b/sys/dev/smbus/smb.c
index 0efa93ae0e89..514c42b88131 100644
--- a/sys/dev/smbus/smb.c
+++ b/sys/dev/smbus/smb.c
@@ -126,7 +126,7 @@ static void
smb_identify(driver_t *driver, device_t parent)
{
- if (device_find_child(parent, "smb", -1) == NULL)
+ if (device_find_child(parent, "smb", DEVICE_UNIT_ANY) == NULL)
BUS_ADD_CHILD(parent, 0, "smb", DEVICE_UNIT_ANY);
}
diff --git a/sys/dev/sound/dummy.c b/sys/dev/sound/dummy.c
index 1e2a81f40103..4df5b112d3f4 100644
--- a/sys/dev/sound/dummy.c
+++ b/sys/dev/sound/dummy.c
@@ -296,9 +296,9 @@ MIXER_DECLARE(dummy_mixer);
static void
dummy_identify(driver_t *driver, device_t parent)
{
- if (device_find_child(parent, driver->name, -1) != NULL)
+ if (device_find_child(parent, driver->name, DEVICE_UNIT_ANY) != NULL)
return;
- if (BUS_ADD_CHILD(parent, 0, driver->name, -1) == NULL)
+ if (BUS_ADD_CHILD(parent, 0, driver->name, DEVICE_UNIT_ANY) == NULL)
device_printf(parent, "add child failed\n");
}
diff --git a/sys/dev/sound/pci/hdsp.c b/sys/dev/sound/pci/hdsp.c
index 4712d78ea88b..4ba23d22ebce 100644
--- a/sys/dev/sound/pci/hdsp.c
+++ b/sys/dev/sound/pci/hdsp.c
@@ -890,7 +890,7 @@ hdsp_attach(device_t dev)
scp = malloc(sizeof(struct sc_pcminfo), M_DEVBUF, M_WAITOK | M_ZERO);
scp->hc = &chan_map[i];
scp->sc = sc;
- scp->dev = device_add_child(dev, "pcm", -1);
+ scp->dev = device_add_child(dev, "pcm", DEVICE_UNIT_ANY);
device_set_ivars(scp->dev, scp);
}
diff --git a/sys/dev/spibus/acpi_spibus.c b/sys/dev/spibus/acpi_spibus.c
index 749113d81220..a3280ffa567f 100644
--- a/sys/dev/spibus/acpi_spibus.c
+++ b/sys/dev/spibus/acpi_spibus.c
@@ -302,7 +302,7 @@ acpi_spibus_enumerate_child(ACPI_HANDLE handle, UINT32 level,
if (acpi_spibus_delete_acpi_child(handle) != 0)
return (AE_OK);
- child = BUS_ADD_CHILD(spibus, 0, NULL, -1);
+ child = BUS_ADD_CHILD(spibus, 0, NULL, DEVICE_UNIT_ANY);
if (child == NULL) {
device_printf(spibus, "add child failed\n");
return (AE_OK);
diff --git a/sys/dev/superio/superio.c b/sys/dev/superio/superio.c
index be852a3db367..24d40eb7a208 100644
--- a/sys/dev/superio/superio.c
+++ b/sys/dev/superio/superio.c
@@ -633,7 +633,7 @@ superio_identify(driver_t *driver, device_t parent)
* Those could be created via isa hints or if this
* driver is loaded, unloaded and then loaded again.
*/
- if (device_find_child(parent, "superio", -1)) {
+ if (device_find_child(parent, "superio", DEVICE_UNIT_ANY)) {
if (bootverbose)
printf("superio: device(s) already created\n");
return;
diff --git a/sys/dev/usb/misc/i2ctinyusb.c b/sys/dev/usb/misc/i2ctinyusb.c
index ca40fd5baf5c..c6e8f946d78e 100644
--- a/sys/dev/usb/misc/i2ctinyusb.c
+++ b/sys/dev/usb/misc/i2ctinyusb.c
@@ -167,7 +167,7 @@ i2ctinyusb_attach(device_t dev)
sc->sc_udev = uaa->device;
mtx_init(&sc->sc_mtx, "i2ctinyusb lock", NULL, MTX_DEF | MTX_RECURSE);
- sc->iicbus_dev = device_add_child(dev, "iicbus", -1);
+ sc->iicbus_dev = device_add_child(dev, "iicbus", DEVICE_UNIT_ANY);
if (sc->iicbus_dev == NULL) {
device_printf(dev, "iicbus creation failed\n");
err = ENXIO;
diff --git a/sys/dev/viapm/viapm.c b/sys/dev/viapm/viapm.c
index 36c33422d5b3..1aaaf25dcc34 100644
--- a/sys/dev/viapm/viapm.c
+++ b/sys/dev/viapm/viapm.c
@@ -423,7 +423,7 @@ viapm_586b_attach(device_t dev)
VIAPM_OUTB(GPIO_DIR, VIAPM_INB(GPIO_DIR) | VIAPM_SCL | VIAPM_SDA);
/* add generic bit-banging code */
- if (!(viapm->iicbb = device_add_child(dev, "iicbb", -1)))
+ if (!(viapm->iicbb = device_add_child(dev, "iicbb", DEVICE_UNIT_ANY)))
goto error;
bus_attach_children(dev);
diff --git a/sys/dev/viawd/viawd.c b/sys/dev/viawd/viawd.c
index d088284762cb..9e815b8171d1 100644
--- a/sys/dev/viawd/viawd.c
+++ b/sys/dev/viawd/viawd.c
@@ -125,7 +125,7 @@ viawd_identify(driver_t *driver, device_t parent)
if (viawd_find(parent) == NULL)
return;
- if (device_find_child(parent, driver->name, -1) == NULL)
+ if (device_find_child(parent, driver->name, DEVICE_UNIT_ANY) == NULL)
BUS_ADD_CHILD(parent, 0, driver->name, 0);
}
diff --git a/sys/dev/virtio/mmio/virtio_mmio.c b/sys/dev/virtio/mmio/virtio_mmio.c
index 175b33b42ed8..5a81c8a24779 100644
--- a/sys/dev/virtio/mmio/virtio_mmio.c
+++ b/sys/dev/virtio/mmio/virtio_mmio.c
@@ -275,7 +275,7 @@ vtmmio_attach(device_t dev)
/* Tell the host we've noticed this device. */
vtmmio_set_status(dev, VIRTIO_CONFIG_STATUS_ACK);
- if ((child = device_add_child(dev, NULL, -1)) == NULL) {
+ if ((child = device_add_child(dev, NULL, DEVICE_UNIT_ANY)) == NULL) {
device_printf(dev, "Cannot create child device.\n");
vtmmio_set_status(dev, VIRTIO_CONFIG_STATUS_FAILED);
vtmmio_detach(dev);
diff --git a/sys/isa/isahint.c b/sys/isa/isahint.c
index d9ec9f35f7f2..68aa1de00927 100644
--- a/sys/isa/isahint.c
+++ b/sys/isa/isahint.c
@@ -45,7 +45,8 @@ isa_hinted_child(device_t parent, const char *name, int unit)
/* device-specific flag overrides any wildcard */
sensitive = 0;
if (resource_int_value(name, unit, "sensitive", &sensitive) != 0)
- resource_int_value(name, -1, "sensitive", &sensitive);
+ resource_int_value(name, DEVICE_UNIT_ANY, "sensitive",
+ &sensitive);
if (sensitive)
order = ISA_ORDER_SENSITIVE;
diff --git a/sys/kern/kern_cpu.c b/sys/kern/kern_cpu.c
index 1b55ebf0738b..1fb3d8002c7f 100644
--- a/sys/kern/kern_cpu.c
+++ b/sys/kern/kern_cpu.c
@@ -1101,7 +1101,7 @@ cpufreq_register(device_t dev)
* must offer the same levels and be switched at the same time.
*/
cpu_dev = device_get_parent(dev);
- if ((cf_dev = device_find_child(cpu_dev, "cpufreq", -1))) {
+ if ((cf_dev = device_find_child(cpu_dev, "cpufreq", DEVICE_UNIT_ANY))) {
sc = device_get_softc(cf_dev);
sc->max_mhz = CPUFREQ_VAL_UNKNOWN;
MPASS(sc->cf_drv_dev != NULL);
@@ -1135,7 +1135,8 @@ cpufreq_unregister(device_t dev)
* device as well. We identify cpufreq children by calling a method
* they support.
*/
- cf_dev = device_find_child(device_get_parent(dev), "cpufreq", -1);
+ cf_dev = device_find_child(device_get_parent(dev), "cpufreq",
+ DEVICE_UNIT_ANY);
if (cf_dev == NULL) {
device_printf(dev,
"warning: cpufreq_unregister called with no cpufreq device active\n");
diff --git a/sys/opencrypto/cryptosoft.c b/sys/opencrypto/cryptosoft.c
index b4634bed07c2..aeea3fe665a1 100644
--- a/sys/opencrypto/cryptosoft.c
+++ b/sys/opencrypto/cryptosoft.c
@@ -1686,7 +1686,7 @@ static void
swcr_identify(driver_t *drv, device_t parent)
{
/* NB: order 10 is so we get attached after h/w devices */
- if (device_find_child(parent, "cryptosoft", -1) == NULL &&
+ if (device_find_child(parent, "cryptosoft", DEVICE_UNIT_ANY) == NULL &&
BUS_ADD_CHILD(parent, 10, "cryptosoft", 0) == 0)
panic("cryptosoft: could not attach");
}
diff --git a/sys/powerpc/cpufreq/dfs.c b/sys/powerpc/cpufreq/dfs.c
index 247ddcaa9c6b..cd4587a7b43e 100644
--- a/sys/powerpc/cpufreq/dfs.c
+++ b/sys/powerpc/cpufreq/dfs.c
@@ -94,14 +94,14 @@ dfs_identify(driver_t *driver, device_t parent)
}
/* Make sure we're not being doubly invoked. */
- if (device_find_child(parent, "dfs", -1) != NULL)
+ if (device_find_child(parent, "dfs", DEVICE_UNIT_ANY) != NULL)
return;
/*
* We attach a child for every CPU since settings need to
* be performed on every CPU in the SMP case.
*/
- if (BUS_ADD_CHILD(parent, 10, "dfs", -1) == NULL)
+ if (BUS_ADD_CHILD(parent, 10, "dfs", DEVICE_UNIT_ANY) == NULL)
device_printf(parent, "add dfs child failed\n");
}
diff --git a/sys/powerpc/cpufreq/mpc85xx_jog.c b/sys/powerpc/cpufreq/mpc85xx_jog.c
index 2d66fa05e942..e405c4e94e89 100644
--- a/sys/powerpc/cpufreq/mpc85xx_jog.c
+++ b/sys/powerpc/cpufreq/mpc85xx_jog.c
@@ -143,7 +143,7 @@ mpc85xx_jog_identify(driver_t *driver, device_t parent)
struct ofw_compat_data *compat;
/* Make sure we're not being doubly invoked. */
- if (device_find_child(parent, "mpc85xx_jog", -1) != NULL)
+ if (device_find_child(parent, "mpc85xx_jog", DEVICE_UNIT_ANY) != NULL)
return;
compat = mpc85xx_jog_devcompat();
@@ -154,7 +154,7 @@ mpc85xx_jog_identify(driver_t *driver, device_t parent)
* We attach a child for every CPU since settings need to
* be performed on every CPU in the SMP case.
*/
- if (BUS_ADD_CHILD(parent, 10, "jog", -1) == NULL)
+ if (BUS_ADD_CHILD(parent, 10, "jog", DEVICE_UNIT_ANY) == NULL)
device_printf(parent, "add jog child failed\n");
}
diff --git a/sys/powerpc/cpufreq/pcr.c b/sys/powerpc/cpufreq/pcr.c
index 235f2d155357..335a1d011a66 100644
--- a/sys/powerpc/cpufreq/pcr.c
+++ b/sys/powerpc/cpufreq/pcr.c
@@ -165,14 +165,14 @@ pcr_identify(driver_t *driver, device_t parent)
}
/* Make sure we're not being doubly invoked. */
- if (device_find_child(parent, "pcr", -1) != NULL)
+ if (device_find_child(parent, "pcr", DEVICE_UNIT_ANY) != NULL)
return;
/*
* We attach a child for every CPU since settings need to
* be performed on every CPU in the SMP case.
*/
- if (BUS_ADD_CHILD(parent, 10, "pcr", -1) == NULL)
+ if (BUS_ADD_CHILD(parent, 10, "pcr", DEVICE_UNIT_ANY) == NULL)
device_printf(parent, "add pcr child failed\n");
}
diff --git a/sys/powerpc/cpufreq/pmcr.c b/sys/powerpc/cpufreq/pmcr.c
index 8dd57079e3bd..dd489b607606 100644
--- a/sys/powerpc/cpufreq/pmcr.c
+++ b/sys/powerpc/cpufreq/pmcr.c
@@ -115,14 +115,14 @@ pmcr_identify(driver_t *driver, device_t parent)
{
/* Make sure we're not being doubly invoked. */
- if (device_find_child(parent, "pmcr", -1) != NULL)
+ if (device_find_child(parent, "pmcr", DEVICE_UNIT_ANY) != NULL)
return;
/*
* We attach a child for every CPU since settings need to
* be performed on every CPU in the SMP case.
*/
- if (BUS_ADD_CHILD(parent, 10, "pmcr", -1) == NULL)
+ if (BUS_ADD_CHILD(parent, 10, "pmcr", DEVICE_UNIT_ANY) == NULL)
device_printf(parent, "add pmcr child failed\n");
}
diff --git a/sys/powerpc/cpufreq/pmufreq.c b/sys/powerpc/cpufreq/pmufreq.c
index 5c8f413539b4..2603ccf0b725 100644
--- a/sys/powerpc/cpufreq/pmufreq.c
+++ b/sys/powerpc/cpufreq/pmufreq.c
@@ -89,14 +89,14 @@ pmufreq_identify(driver_t *driver, device_t parent)
return;
/* Make sure we're not being doubly invoked. */
- if (device_find_child(parent, "pmufreq", -1) != NULL)
+ if (device_find_child(parent, "pmufreq", DEVICE_UNIT_ANY) != NULL)
return;
/*
* We attach a child for every CPU since settings need to
* be performed on every CPU in the SMP case.
*/
- if (BUS_ADD_CHILD(parent, 10, "pmufreq", -1) == NULL)
+ if (BUS_ADD_CHILD(parent, 10, "pmufreq", DEVICE_UNIT_ANY) == NULL)
device_printf(parent, "add pmufreq child failed\n");
}
diff --git a/sys/powerpc/powermac/atibl.c b/sys/powerpc/powermac/atibl.c
index 1bc521f8bfad..74632fc77e59 100644
--- a/sys/powerpc/powermac/atibl.c
+++ b/sys/powerpc/powermac/atibl.c
@@ -105,7 +105,7 @@ atibl_identify(driver_t *driver, device_t parent)
{
if (OF_finddevice("mac-io/backlight") == -1)
return;
- if (device_find_child(parent, "backlight", -1) == NULL)
+ if (device_find_child(parent, "backlight", DEVICE_UNIT_ANY) == NULL)
device_add_child(parent, "backlight", DEVICE_UNIT_ANY);
}
diff --git a/sys/powerpc/powermac/nvbl.c b/sys/powerpc/powermac/nvbl.c
index 79e41c66b34d..d60ff5a7a099 100644
--- a/sys/powerpc/powermac/nvbl.c
+++ b/sys/powerpc/powermac/nvbl.c
@@ -83,7 +83,7 @@ nvbl_identify(driver_t *driver, device_t parent)
{
if (OF_finddevice("mac-io/backlight") == -1)
return;
- if (device_find_child(parent, "backlight", -1) == NULL)
+ if (device_find_child(parent, "backlight", DEVICE_UNIT_ANY) == NULL)
device_add_child(parent, "backlight", DEVICE_UNIT_ANY);
}
diff --git a/sys/powerpc/powernv/opal_i2c.c b/sys/powerpc/powernv/opal_i2c.c
index 4e3bc4a7384a..b5c5f740f4a3 100644
--- a/sys/powerpc/powernv/opal_i2c.c
+++ b/sys/powerpc/powernv/opal_i2c.c
@@ -137,7 +137,8 @@ opal_i2c_attach(device_t dev)
return (EINVAL);
OF_getencprop(ofw_bus_get_node(dev), "ibm,opal-id", &sc->opal_id, len);
- if ((sc->iicbus = device_add_child(dev, "iicbus", -1)) == NULL) {
+ if ((sc->iicbus = device_add_child(dev, "iicbus",
+ DEVICE_UNIT_ANY)) == NULL) {
device_printf(dev, "could not allocate iicbus instance\n");
return (EINVAL);
}
diff --git a/sys/powerpc/ps3/ps3bus.c b/sys/powerpc/ps3/ps3bus.c
index 8aa0a806f116..dc4026cb9a5e 100644
--- a/sys/powerpc/ps3/ps3bus.c
+++ b/sys/powerpc/ps3/ps3bus.c
@@ -157,7 +157,7 @@ ps3bus_identify(driver_t *driver, device_t parent)
if (strcmp(installed_platform(), "ps3") != 0)
return;
- if (device_find_child(parent, "ps3bus", -1) == NULL)
+ if (device_find_child(parent, "ps3bus", DEVICE_UNIT_ANY) == NULL)
BUS_ADD_CHILD(parent, 0, "ps3bus", 0);
}
diff --git a/sys/powerpc/ps3/ps3pic.c b/sys/powerpc/ps3/ps3pic.c
index c947b3e3e502..5463f6a6e3b6 100644
--- a/sys/powerpc/ps3/ps3pic.c
+++ b/sys/powerpc/ps3/ps3pic.c
@@ -99,7 +99,7 @@ ps3pic_identify(driver_t *driver, device_t parent)
if (strcmp(installed_platform(), "ps3") != 0)
return;
- if (device_find_child(parent, "ps3pic", -1) == NULL)
+ if (device_find_child(parent, "ps3pic", DEVICE_UNIT_ANY) == NULL)
BUS_ADD_CHILD(parent, 0, "ps3pic", 0);
}
diff --git a/sys/riscv/riscv/intc.c b/sys/riscv/riscv/intc.c
index 248175e8bea3..b700b9c97793 100644
--- a/sys/riscv/riscv/intc.c
+++ b/sys/riscv/riscv/intc.c
@@ -127,7 +127,7 @@ intc_identify(driver_t *driver, device_t parent)
device_t dev;
phandle_t node;
- if (device_find_child(parent, "intc", -1) != NULL)
+ if (device_find_child(parent, "intc", DEVICE_UNIT_ANY) != NULL)
return;
node = intc_ofw_find(parent, PCPU_GET(hart));
diff --git a/sys/riscv/riscv/sbi.c b/sys/riscv/riscv/sbi.c
index b0a05bd88ef1..2d8e96a22bbe 100644
--- a/sys/riscv/riscv/sbi.c
+++ b/sys/riscv/riscv/sbi.c
@@ -351,10 +351,10 @@ sbi_identify(driver_t *driver, device_t parent)
{
device_t dev;
- if (device_find_child(parent, "sbi", -1) != NULL)
+ if (device_find_child(parent, "sbi", DEVICE_UNIT_ANY) != NULL)
return;
- dev = BUS_ADD_CHILD(parent, 0, "sbi", -1);
+ dev = BUS_ADD_CHILD(parent, 0, "sbi", DEVICE_UNIT_ANY);
if (dev == NULL)
device_printf(parent, "Can't add sbi child\n");
}
@@ -389,7 +389,7 @@ sbi_attach(device_t dev)
#ifdef SMP
di = malloc(sizeof(*di), M_DEVBUF, M_WAITOK | M_ZERO);
resource_list_init(&di->rl);
- child = device_add_child(dev, "sbi_ipi", -1);
+ child = device_add_child(dev, "sbi_ipi", DEVICE_UNIT_ANY);
if (child == NULL) {
device_printf(dev, "Could not add sbi_ipi child\n");
return (ENXIO);
diff --git a/sys/x86/cpufreq/est.c b/sys/x86/cpufreq/est.c
index 19448ff127ef..82f35934aa99 100644
--- a/sys/x86/cpufreq/est.c
+++ b/sys/x86/cpufreq/est.c
@@ -920,11 +920,11 @@ est_identify(driver_t *driver, device_t parent)
* future.
*/
intel_hwpstate_identify(NULL, parent);
- if (device_find_child(parent, "hwpstate_intel", -1) != NULL)
+ if (device_find_child(parent, "hwpstate_intel", DEVICE_UNIT_ANY) != NULL)
return;
/* Make sure we're not being doubly invoked. */
- if (device_find_child(parent, "est", -1) != NULL)
+ if (device_find_child(parent, "est", DEVICE_UNIT_ANY) != NULL)
return;
/* Check that CPUID is supported and the vendor is Intel.*/
@@ -961,7 +961,8 @@ est_probe(device_t dev)
* If the ACPI perf driver has attached and is not just offering
* info, let it manage things.
*/
- perf_dev = device_find_child(device_get_parent(dev), "acpi_perf", -1);
+ perf_dev = device_find_child(device_get_parent(dev), "acpi_perf",
+ DEVICE_UNIT_ANY);
if (perf_dev && device_is_attached(perf_dev)) {
error = CPUFREQ_DRV_TYPE(perf_dev, &type);
if (error == 0 && (type & CPUFREQ_FLAG_INFO_ONLY) == 0)
@@ -1064,7 +1065,8 @@ est_acpi_info(device_t dev, freq_info **freqs, size_t *freqslen)
int count, error, i, j;
uint16_t saved_id16;
- perf_dev = device_find_child(device_get_parent(dev), "acpi_perf", -1);
+ perf_dev = device_find_child(device_get_parent(dev), "acpi_perf",
+ DEVICE_UNIT_ANY);
if (perf_dev == NULL || !device_is_attached(perf_dev))
return (ENXIO);
diff --git a/sys/x86/cpufreq/hwpstate_amd.c b/sys/x86/cpufreq/hwpstate_amd.c
index a9305e571ece..fc948dc90a15 100644
--- a/sys/x86/cpufreq/hwpstate_amd.c
+++ b/sys/x86/cpufreq/hwpstate_amd.c
@@ -342,7 +342,7 @@ static void
hwpstate_identify(driver_t *driver, device_t parent)
{
- if (device_find_child(parent, "hwpstate", -1) != NULL)
+ if (device_find_child(parent, "hwpstate", DEVICE_UNIT_ANY) != NULL)
return;
if ((cpu_vendor_id != CPU_VENDOR_AMD || CPUID_TO_FAMILY(cpu_id) < 0x10) &&
@@ -386,7 +386,8 @@ hwpstate_probe(device_t dev)
/*
* Check if acpi_perf has INFO only flag.
*/
- perf_dev = device_find_child(device_get_parent(dev), "acpi_perf", -1);
+ perf_dev = device_find_child(device_get_parent(dev), "acpi_perf",
+ DEVICE_UNIT_ANY);
error = TRUE;
if (perf_dev && device_is_attached(perf_dev)) {
error = CPUFREQ_DRV_TYPE(perf_dev, &type);
diff --git a/sys/x86/cpufreq/hwpstate_intel.c b/sys/x86/cpufreq/hwpstate_intel.c
index b4378154c408..259aeac399c8 100644
--- a/sys/x86/cpufreq/hwpstate_intel.c
+++ b/sys/x86/cpufreq/hwpstate_intel.c
@@ -328,7 +328,7 @@ out:
void
intel_hwpstate_identify(driver_t *driver, device_t parent)
{
- if (device_find_child(parent, "hwpstate_intel", -1) != NULL)
+ if (device_find_child(parent, "hwpstate_intel", DEVICE_UNIT_ANY) != NULL)
return;
if (cpu_vendor_id != CPU_VENDOR_INTEL)
diff --git a/sys/x86/cpufreq/p4tcc.c b/sys/x86/cpufreq/p4tcc.c
index 22e9cad25d4a..c3c35dee832b 100644
--- a/sys/x86/cpufreq/p4tcc.c
+++ b/sys/x86/cpufreq/p4tcc.c
@@ -122,7 +122,7 @@ p4tcc_identify(driver_t *driver, device_t parent)
return;
/* Make sure we're not being doubly invoked. */
- if (device_find_child(parent, "p4tcc", -1) != NULL)
+ if (device_find_child(parent, "p4tcc", DEVICE_UNIT_ANY) != NULL)
return;
/*
diff --git a/sys/x86/cpufreq/powernow.c b/sys/x86/cpufreq/powernow.c
index 93b1386c754d..2f3044d6077a 100644
--- a/sys/x86/cpufreq/powernow.c
+++ b/sys/x86/cpufreq/powernow.c
@@ -870,7 +870,7 @@ pn_identify(driver_t *driver, device_t parent)
default:
return;
}
- if (device_find_child(parent, "powernow", -1) != NULL)
+ if (device_find_child(parent, "powernow", DEVICE_UNIT_ANY) != NULL)
return;
if (BUS_ADD_CHILD(parent, 10, "powernow", device_get_unit(parent))
== NULL)
@@ -944,7 +944,8 @@ pn_attach(device_t dev)
int rv;
device_t child;
- child = device_find_child(device_get_parent(dev), "acpi_perf", -1);
+ child = device_find_child(device_get_parent(dev), "acpi_perf",
+ DEVICE_UNIT_ANY);
if (child) {
rv = pn_decode_acpi(dev, child);
if (rv)
diff --git a/sys/x86/cpufreq/smist.c b/sys/x86/cpufreq/smist.c
index 291c3b9af605..b84a4ba72a56 100644
--- a/sys/x86/cpufreq/smist.c
+++ b/sys/x86/cpufreq/smist.c
@@ -305,7 +305,7 @@ smist_identify(driver_t *driver, device_t parent)
if (bootverbose)
printf("smist: found supported isa bridge %s\n", id->desc);
- if (device_find_child(parent, "smist", -1) != NULL)
+ if (device_find_child(parent, "smist", DEVICE_UNIT_ANY) != NULL)
return;
if (BUS_ADD_CHILD(parent, 30, "smist", device_get_unit(parent))
== NULL)
@@ -330,13 +330,15 @@ smist_probe(device_t dev)
* If the ACPI perf or ICH SpeedStep drivers have attached and not
* just offering info, let them manage things.
*/
- perf_dev = device_find_child(device_get_parent(dev), "acpi_perf", -1);
+ perf_dev = device_find_child(device_get_parent(dev), "acpi_perf",
+ DEVICE_UNIT_ANY);
if (perf_dev && device_is_attached(perf_dev)) {
rv = CPUFREQ_DRV_TYPE(perf_dev, &type);
if (rv == 0 && (type & CPUFREQ_FLAG_INFO_ONLY) == 0)
return (ENXIO);
}
- ichss_dev = device_find_child(device_get_parent(dev), "ichss", -1);
+ ichss_dev = device_find_child(device_get_parent(dev), "ichss",
+ DEVICE_UNIT_ANY);
if (ichss_dev && device_is_attached(ichss_dev))
return (ENXIO);
diff --git a/sys/x86/pci/qpi.c b/sys/x86/pci/qpi.c
index 94dd46d26a92..21bf1b6738bc 100644
--- a/sys/x86/pci/qpi.c
+++ b/sys/x86/pci/qpi.c
@@ -80,7 +80,7 @@ qpi_identify(driver_t *driver, device_t parent)
return;
/* Add a qpi bus device. */
- if (BUS_ADD_CHILD(parent, 20, "qpi", -1) == NULL)
+ if (BUS_ADD_CHILD(parent, 20, "qpi", DEVICE_UNIT_ANY) == NULL)
panic("Failed to add qpi bus");
}