mirror of
https://git.freebsd.org/src.git
synced 2026-01-11 19:57:22 +00:00
newbus: replace leftover device unit wildcards
Reviewed by: imp, jhb Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D50913
This commit is contained in:
parent
220cdd1b39
commit
b670c9bafc
119 changed files with 192 additions and 163 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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])) {
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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. */
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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)) {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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.*/
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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!");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue