Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F103290122
D47675.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
100 KB
Referenced Files
None
Subscribers
None
D47675.id.diff
View Options
diff --git a/sys/amd64/acpica/acpi_machdep.c b/sys/amd64/acpica/acpi_machdep.c
--- a/sys/amd64/acpica/acpi_machdep.c
+++ b/sys/amd64/acpica/acpi_machdep.c
@@ -270,8 +270,9 @@
bus_identify_children(dev);
if (BUS_ADD_CHILD(dev, 10, "acpi", 0) == NULL)
panic("failed to add acpi0 device");
+ bus_attach_children(dev);
- return (bus_generic_attach(dev));
+ return (0);
}
static device_method_t nexus_acpi_methods[] = {
diff --git a/sys/arm/allwinner/aw_rsb.c b/sys/arm/allwinner/aw_rsb.c
--- a/sys/arm/allwinner/aw_rsb.c
+++ b/sys/arm/allwinner/aw_rsb.c
@@ -449,7 +449,7 @@
goto fail;
}
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return (0);
diff --git a/sys/arm/annapurna/alpine/alpine_pci_msix.c b/sys/arm/annapurna/alpine/alpine_pci_msix.c
--- a/sys/arm/annapurna/alpine/alpine_pci_msix.c
+++ b/sys/arm/annapurna/alpine/alpine_pci_msix.c
@@ -216,7 +216,8 @@
device_printf(dev, "MSI-X SPI IRQ %d-%d\n", sc->irq_min, sc->irq_max);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
diff --git a/sys/arm/arm/gic_acpi.c b/sys/arm/arm/gic_acpi.c
--- a/sys/arm/arm/gic_acpi.c
+++ b/sys/arm/arm/gic_acpi.c
@@ -243,7 +243,7 @@
/* If we have children probe and attach them */
if (arm_gic_add_children(dev)) {
bus_identify_children(dev);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
}
return (0);
diff --git a/sys/arm/arm/gic_fdt.c b/sys/arm/arm/gic_fdt.c
--- a/sys/arm/arm/gic_fdt.c
+++ b/sys/arm/arm/gic_fdt.c
@@ -186,7 +186,7 @@
/* If we have children probe and attach them */
if (arm_gic_add_children(dev)) {
bus_identify_children(dev);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
}
return (0);
diff --git a/sys/arm/arm/nexus.c b/sys/arm/arm/nexus.c
--- a/sys/arm/arm/nexus.c
+++ b/sys/arm/arm/nexus.c
@@ -185,7 +185,7 @@
* Next, deal with the children we know about already.
*/
bus_identify_children(dev);
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return (0);
}
diff --git a/sys/arm/broadcom/bcm2835/bcm2835_clkman.c b/sys/arm/broadcom/bcm2835/bcm2835_clkman.c
--- a/sys/arm/broadcom/bcm2835/bcm2835_clkman.c
+++ b/sys/arm/broadcom/bcm2835/bcm2835_clkman.c
@@ -112,7 +112,8 @@
sc->sc_m_bst = rman_get_bustag(sc->sc_m_res);
sc->sc_m_bsh = rman_get_bushandle(sc->sc_m_res);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
uint32_t
diff --git a/sys/arm/broadcom/bcm2835/bcm2835_pwm.c b/sys/arm/broadcom/bcm2835/bcm2835_pwm.c
--- a/sys/arm/broadcom/bcm2835/bcm2835_pwm.c
+++ b/sys/arm/broadcom/bcm2835/bcm2835_pwm.c
@@ -460,7 +460,8 @@
sc->period2 = 10000; /* 12.5 khz */
sc->ratio2 = 2500; /* 25% */
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
diff --git a/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c b/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c
--- a/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c
+++ b/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c
@@ -354,7 +354,7 @@
SDHCI_BUFFER;
bus_identify_children(dev);
- bus_generic_attach(dev);
+ bus_attach_children(dev);
sdhci_start_slot(&sc->sc_slot);
diff --git a/sys/arm/broadcom/bcm2835/bcm2835_sdhost.c b/sys/arm/broadcom/bcm2835/bcm2835_sdhost.c
--- a/sys/arm/broadcom/bcm2835/bcm2835_sdhost.c
+++ b/sys/arm/broadcom/bcm2835/bcm2835_sdhost.c
@@ -473,7 +473,7 @@
sdhci_init_slot(dev, &sc->sc_slot, 0);
bus_identify_children(dev);
- bus_generic_attach(dev);
+ bus_attach_children(dev);
sdhci_start_slot(&sc->sc_slot);
diff --git a/sys/arm/broadcom/bcm2835/bcm2835_spi.c b/sys/arm/broadcom/bcm2835/bcm2835_spi.c
--- a/sys/arm/broadcom/bcm2835/bcm2835_spi.c
+++ b/sys/arm/broadcom/bcm2835/bcm2835_spi.c
@@ -299,8 +299,9 @@
#endif
device_add_child(dev, "spibus", DEVICE_UNIT_ANY);
+ bus_attach_children(dev);
- return (bus_generic_attach(dev));
+ return (0);
}
static int
diff --git a/sys/arm/broadcom/bcm2835/bcm2838_pci.c b/sys/arm/broadcom/bcm2835/bcm2838_pci.c
--- a/sys/arm/broadcom/bcm2835/bcm2838_pci.c
+++ b/sys/arm/broadcom/bcm2835/bcm2838_pci.c
@@ -745,7 +745,8 @@
/* Done. */
device_add_child(dev, "pci", DEVICE_UNIT_ANY);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
/*
diff --git a/sys/arm/freescale/vybrid/vf_spi.c b/sys/arm/freescale/vybrid/vf_spi.c
--- a/sys/arm/freescale/vybrid/vf_spi.c
+++ b/sys/arm/freescale/vybrid/vf_spi.c
@@ -197,7 +197,8 @@
WRITE4(sc, SPI_CTAR0, reg);
device_add_child(dev, "spibus", 0);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
diff --git a/sys/arm/mv/a37x0_iic.c b/sys/arm/mv/a37x0_iic.c
--- a/sys/arm/mv/a37x0_iic.c
+++ b/sys/arm/mv/a37x0_iic.c
@@ -237,7 +237,8 @@
}
/* Probe and attach the iicbus. */
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
diff --git a/sys/arm/mv/mv_pci.c b/sys/arm/mv/mv_pci.c
--- a/sys/arm/mv/mv_pci.c
+++ b/sys/arm/mv/mv_pci.c
@@ -562,7 +562,8 @@
}
mtx_init(&sc->sc_msi_mtx, "msi_mtx", NULL, MTX_DEF);
- return (bus_generic_attach(self));
+ bus_attach_children(self);
+ return (0);
error:
/* XXX SYS_RES_ should be released here */
diff --git a/sys/arm/mv/mv_pci_ctrl.c b/sys/arm/mv/mv_pci_ctrl.c
--- a/sys/arm/mv/mv_pci_ctrl.c
+++ b/sys/arm/mv/mv_pci_ctrl.c
@@ -149,7 +149,8 @@
if (err != 0)
return (err);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
diff --git a/sys/arm/mv/mvebu_gpio.c b/sys/arm/mv/mvebu_gpio.c
--- a/sys/arm/mv/mvebu_gpio.c
+++ b/sys/arm/mv/mvebu_gpio.c
@@ -810,7 +810,8 @@
return (ENXIO);
}
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
diff --git a/sys/arm/nvidia/as3722.c b/sys/arm/nvidia/as3722.c
--- a/sys/arm/nvidia/as3722.c
+++ b/sys/arm/nvidia/as3722.c
@@ -328,7 +328,8 @@
device_printf(dev, "Cannot setup interrupt.\n");
goto fail;
}
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
fail:
if (sc->irq_h != NULL)
diff --git a/sys/arm/nvidia/drm2/tegra_dc.c b/sys/arm/nvidia/drm2/tegra_dc.c
--- a/sys/arm/nvidia/drm2/tegra_dc.c
+++ b/sys/arm/nvidia/drm2/tegra_dc.c
@@ -1368,7 +1368,8 @@
goto fail;
}
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
fail:
TEGRA_DRM_DEREGISTER_CLIENT(device_get_parent(sc->dev), sc->dev);
diff --git a/sys/arm/nvidia/drm2/tegra_hdmi.c b/sys/arm/nvidia/drm2/tegra_hdmi.c
--- a/sys/arm/nvidia/drm2/tegra_hdmi.c
+++ b/sys/arm/nvidia/drm2/tegra_hdmi.c
@@ -1242,7 +1242,8 @@
device_printf(dev, "Cannot register DRM device\n");
goto fail;
}
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
fail:
TEGRA_DRM_DEREGISTER_CLIENT(device_get_parent(sc->dev), sc->dev);
diff --git a/sys/arm/nvidia/drm2/tegra_host1x.c b/sys/arm/nvidia/drm2/tegra_host1x.c
--- a/sys/arm/nvidia/drm2/tegra_host1x.c
+++ b/sys/arm/nvidia/drm2/tegra_host1x.c
@@ -571,7 +571,8 @@
goto fail;
}
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
fail:
if (sc->tegra_drm != NULL)
diff --git a/sys/arm/nvidia/tegra_abpmisc.c b/sys/arm/nvidia/tegra_abpmisc.c
--- a/sys/arm/nvidia/tegra_abpmisc.c
+++ b/sys/arm/nvidia/tegra_abpmisc.c
@@ -151,7 +151,8 @@
}
dev_sc = sc;
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
fail:
if (sc->abp_misc_res != NULL)
diff --git a/sys/arm/nvidia/tegra_efuse.c b/sys/arm/nvidia/tegra_efuse.c
--- a/sys/arm/nvidia/tegra_efuse.c
+++ b/sys/arm/nvidia/tegra_efuse.c
@@ -481,7 +481,8 @@
if (bootverbose)
tegra_efuse_dump_sku();
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
fail:
dev_sc = NULL;
diff --git a/sys/arm/nvidia/tegra_gpio.c b/sys/arm/nvidia/tegra_gpio.c
--- a/sys/arm/nvidia/tegra_gpio.c
+++ b/sys/arm/nvidia/tegra_gpio.c
@@ -824,7 +824,8 @@
return (ENXIO);
}
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
diff --git a/sys/arm/nvidia/tegra_i2c.c b/sys/arm/nvidia/tegra_i2c.c
--- a/sys/arm/nvidia/tegra_i2c.c
+++ b/sys/arm/nvidia/tegra_i2c.c
@@ -722,7 +722,8 @@
}
/* Probe and attach the iicbus. */
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
fail:
if (sc->irq_h != NULL)
diff --git a/sys/arm/nvidia/tegra_mc.c b/sys/arm/nvidia/tegra_mc.c
--- a/sys/arm/nvidia/tegra_mc.c
+++ b/sys/arm/nvidia/tegra_mc.c
@@ -260,7 +260,8 @@
/* Enable Interrupts */
WR4(sc, MC_INTMASK, MC_INT_INT_MASK);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
fail:
if (sc->clk != NULL)
diff --git a/sys/arm/nvidia/tegra_pcie.c b/sys/arm/nvidia/tegra_pcie.c
--- a/sys/arm/nvidia/tegra_pcie.c
+++ b/sys/arm/nvidia/tegra_pcie.c
@@ -1566,8 +1566,9 @@
goto out;
#endif
device_add_child(dev, "pci", DEVICE_UNIT_ANY);
+ bus_attach_children(dev);
- return (bus_generic_attach(dev));
+ return (0);
out:
diff --git a/sys/arm/nvidia/tegra_rtc.c b/sys/arm/nvidia/tegra_rtc.c
--- a/sys/arm/nvidia/tegra_rtc.c
+++ b/sys/arm/nvidia/tegra_rtc.c
@@ -246,7 +246,8 @@
*/
/* clock_register(dev, 1000000); */
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
fail:
if (sc->clk != NULL)
diff --git a/sys/arm/nvidia/tegra_sdhci.c b/sys/arm/nvidia/tegra_sdhci.c
--- a/sys/arm/nvidia/tegra_sdhci.c
+++ b/sys/arm/nvidia/tegra_sdhci.c
@@ -387,7 +387,7 @@
sc->gpio = sdhci_fdt_gpio_setup(sc->dev, &sc->slot);
bus_identify_children(dev);
- bus_generic_attach(dev);
+ bus_attach_children(dev);
sdhci_start_slot(&sc->slot);
diff --git a/sys/arm/nvidia/tegra_soctherm.c b/sys/arm/nvidia/tegra_soctherm.c
--- a/sys/arm/nvidia/tegra_soctherm.c
+++ b/sys/arm/nvidia/tegra_soctherm.c
@@ -780,7 +780,8 @@
}
OF_device_register_xref(OF_xref_from_node(node), dev);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
fail:
if (sc->irq_ih != NULL)
diff --git a/sys/arm/qualcomm/ipq4018_usb_hs_phy.c b/sys/arm/qualcomm/ipq4018_usb_hs_phy.c
--- a/sys/arm/qualcomm/ipq4018_usb_hs_phy.c
+++ b/sys/arm/qualcomm/ipq4018_usb_hs_phy.c
@@ -200,7 +200,8 @@
rv = ipq4018_usb_hs_usbphy_init_phy(sc, node);
if (rv != 0)
goto fail;
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
fail:
return (ENXIO);
diff --git a/sys/arm/qualcomm/ipq4018_usb_ss_phy.c b/sys/arm/qualcomm/ipq4018_usb_ss_phy.c
--- a/sys/arm/qualcomm/ipq4018_usb_ss_phy.c
+++ b/sys/arm/qualcomm/ipq4018_usb_ss_phy.c
@@ -180,7 +180,8 @@
rv = ipq4018_usb_ss_usbphy_init_phy(sc, node);
if (rv != 0)
goto fail;
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
fail:
return (ENXIO);
diff --git a/sys/arm/ti/am335x/am335x_ehrpwm.c b/sys/arm/ti/am335x/am335x_ehrpwm.c
--- a/sys/arm/ti/am335x/am335x_ehrpwm.c
+++ b/sys/arm/ti/am335x/am335x_ehrpwm.c
@@ -518,7 +518,8 @@
}
bus_identify_children(dev);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
fail:
PWM_LOCK_DESTROY(sc);
if (sc->sc_mem_res)
diff --git a/sys/arm/ti/am335x/am335x_pwmss.c b/sys/arm/ti/am335x/am335x_pwmss.c
--- a/sys/arm/ti/am335x/am335x_pwmss.c
+++ b/sys/arm/ti/am335x/am335x_pwmss.c
@@ -158,7 +158,8 @@
for (node = OF_child(node); node > 0; node = OF_peer(node))
simplebus_add_device(dev, node, 0, NULL, -1, NULL);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
diff --git a/sys/arm/ti/am335x/am335x_usb_phy.c b/sys/arm/ti/am335x/am335x_usb_phy.c
--- a/sys/arm/ti/am335x/am335x_usb_phy.c
+++ b/sys/arm/ti/am335x/am335x_usb_phy.c
@@ -85,7 +85,8 @@
/* FIXME: Add dev/phy/ interface */
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
diff --git a/sys/arm/ti/clk/ti_clkctrl.c b/sys/arm/ti/clk/ti_clkctrl.c
--- a/sys/arm/ti/clk/ti_clkctrl.c
+++ b/sys/arm/ti/clk/ti_clkctrl.c
@@ -241,7 +241,8 @@
if (err)
return (err);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
diff --git a/sys/arm/ti/clk/ti_divider_clock.c b/sys/arm/ti/clk/ti_divider_clock.c
--- a/sys/arm/ti/clk/ti_divider_clock.c
+++ b/sys/arm/ti/clk/ti_divider_clock.c
@@ -182,7 +182,8 @@
if (err) {
/* free_clkdef will be called in ti_divider_new_pass */
DPRINTF(sc->sc_dev, "find_parent_clock_names failed\n");
- return (bus_generic_attach(sc->sc_dev));
+ bus_attach_children(sc->sc_dev);
+ return (0);
}
err = register_clk(sc);
@@ -190,14 +191,16 @@
if (err) {
/* free_clkdef will be called in ti_divider_new_pass */
DPRINTF(sc->sc_dev, "register_clk failed\n");
- return (bus_generic_attach(sc->sc_dev));
+ bus_attach_children(sc->sc_dev);
+ return (0);
}
sc->attach_done = true;
free_clkdef(&sc->div_def.clkdef);
- return (bus_generic_attach(sc->sc_dev));
+ bus_attach_children(sc->sc_dev);
+ return (0);
}
static int
diff --git a/sys/arm/ti/clk/ti_dpll_clock.c b/sys/arm/ti/clk/ti_dpll_clock.c
--- a/sys/arm/ti/clk/ti_dpll_clock.c
+++ b/sys/arm/ti/clk/ti_dpll_clock.c
@@ -292,7 +292,8 @@
if (err) {
/* free_clkdef will be called in ti_dpll_new_pass */
DPRINTF(sc->dev, "find_parent_clock_names failed\n");
- return (bus_generic_attach(sc->dev));
+ bus_attach_children(sc->dev);
+ return (0);
}
err = register_clk(sc);
@@ -300,14 +301,16 @@
if (err) {
/* free_clkdef will be called in ti_dpll_new_pass */
DPRINTF(sc->dev, "register_clk failed\n");
- return (bus_generic_attach(sc->dev));
+ bus_attach_children(sc->dev);
+ return (0);
}
sc->attach_done = true;
free_clkdef(&sc->dpll_def.clkdef);
- return (bus_generic_attach(sc->dev));
+ bus_attach_children(sc->dev);
+ return (0);
}
static int
diff --git a/sys/arm/ti/clk/ti_gate_clock.c b/sys/arm/ti/clk/ti_gate_clock.c
--- a/sys/arm/ti/clk/ti_gate_clock.c
+++ b/sys/arm/ti/clk/ti_gate_clock.c
@@ -185,7 +185,8 @@
if (err) {
/* free_clkdef will be called in ti_gate_new_pass */
DPRINTF(sc->sc_dev, "find_parent_clock_names failed\n");
- return (bus_generic_attach(sc->sc_dev));
+ bus_attach_children(sc->dev);
+ return (0);
}
err = register_clk(sc);
@@ -193,14 +194,16 @@
if (err) {
/* free_clkdef will be called in ti_gate_new_pass */
DPRINTF(sc->sc_dev, "register_clk failed\n");
- return (bus_generic_attach(sc->sc_dev));
+ bus_attach_children(sc->dev);
+ return (0);
}
sc->attach_done = true;
free_clkdef(&sc->gate_def.clkdef);
- return (bus_generic_attach(sc->sc_dev));
+ bus_attach_children(sc->dev);
+ return (0);
}
static int
diff --git a/sys/arm/ti/clk/ti_mux_clock.c b/sys/arm/ti/clk/ti_mux_clock.c
--- a/sys/arm/ti/clk/ti_mux_clock.c
+++ b/sys/arm/ti/clk/ti_mux_clock.c
@@ -167,7 +167,8 @@
if (err) {
/* free_clkdef will be called in ti_mux_new_pass */
DPRINTF(sc->sc_dev, "find_parent_clock_names failed\n");
- return (bus_generic_attach(sc->sc_dev));
+ bus_attach_children(sc->dev);
+ return (0);
}
err = register_clk(sc);
@@ -175,14 +176,16 @@
if (err) {
/* free_clkdef will be called in ti_mux_new_pass */
DPRINTF(sc->sc_dev, "register_clk failed\n");
- return (bus_generic_attach(sc->sc_dev));
+ bus_attach_children(sc->dev);
+ return (0);
}
sc->attach_done = true;
free_clkdef(&sc->mux_def.clkdef);
- return (bus_generic_attach(sc->sc_dev));
+ bus_attach_children(sc->dev);
+ return (0);
}
static void
diff --git a/sys/arm/ti/cpsw/if_cpsw.c b/sys/arm/ti/cpsw/if_cpsw.c
--- a/sys/arm/ti/cpsw/if_cpsw.c
+++ b/sys/arm/ti/cpsw/if_cpsw.c
@@ -912,7 +912,7 @@
}
}
bus_identify_children(dev);
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return (0);
}
diff --git a/sys/arm/ti/ti_omap4_cm.c b/sys/arm/ti/ti_omap4_cm.c
--- a/sys/arm/ti/ti_omap4_cm.c
+++ b/sys/arm/ti/ti_omap4_cm.c
@@ -115,7 +115,8 @@
device_probe_and_attach(cdev);
}
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
diff --git a/sys/arm/ti/ti_prcm.c b/sys/arm/ti/ti_prcm.c
--- a/sys/arm/ti/ti_prcm.c
+++ b/sys/arm/ti/ti_prcm.c
@@ -192,8 +192,8 @@
for (child = OF_child(node); child != 0; child = OF_peer(child)) {
simplebus_add_device(dev, child, 0, NULL, -1, NULL);
}
-
- return (bus_generic_attach(sc->dev));
+ bus_attach_children(sc->dev);
+ return (0);
}
int
diff --git a/sys/arm/ti/ti_scm.c b/sys/arm/ti/ti_scm.c
--- a/sys/arm/ti/ti_scm.c
+++ b/sys/arm/ti/ti_scm.c
@@ -127,7 +127,8 @@
device_probe_and_attach(cdev);
}
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
diff --git a/sys/arm/ti/ti_scm_syscon.c b/sys/arm/ti/ti_scm_syscon.c
--- a/sys/arm/ti/ti_scm_syscon.c
+++ b/sys/arm/ti/ti_scm_syscon.c
@@ -190,7 +190,8 @@
simplebus_add_device(sc->dev, child, 0, NULL, -1, NULL);
}
- return (bus_generic_attach(sc->dev));
+ bus_attach_children(sc->dev);
+ return (0);
}
/* syscon interface */
diff --git a/sys/arm/ti/ti_sdhci.c b/sys/arm/ti/ti_sdhci.c
--- a/sys/arm/ti/ti_sdhci.c
+++ b/sys/arm/ti/ti_sdhci.c
@@ -688,7 +688,7 @@
sc->force_card_present = true;
bus_identify_children(dev);
- bus_generic_attach(dev);
+ bus_attach_children(dev);
sdhci_start_slot(&sc->slot);
return (0);
diff --git a/sys/arm/ti/ti_spi.c b/sys/arm/ti/ti_spi.c
--- a/sys/arm/ti/ti_spi.c
+++ b/sys/arm/ti/ti_spi.c
@@ -264,8 +264,9 @@
#endif
device_add_child(dev, "spibus", DEVICE_UNIT_ANY);
+ bus_attach_children(dev);
- return (bus_generic_attach(dev));
+ return (0);
}
static int
diff --git a/sys/arm/ti/ti_sysc.c b/sys/arm/ti/ti_sysc.c
--- a/sys/arm/ti/ti_sysc.c
+++ b/sys/arm/ti/ti_sysc.c
@@ -539,7 +539,8 @@
err = ti_sysc_attach_clocks(sc);
if (err) {
DPRINTF(sc->dev, "Failed to attach clocks\n");
- return (bus_generic_attach(sc->dev));
+ bus_attach_children(sc->dev);
+ return (0);
}
}
@@ -552,7 +553,8 @@
sc->attach_done = true;
- return (bus_generic_attach(sc->dev));
+ bus_attach_children(sc->dev);
+ return (0);
}
static int
@@ -593,7 +595,7 @@
}
sc->attach_done = true;
- bus_generic_attach(sc->dev);
+ bus_attach_children(sc->dev);
}
static device_method_t ti_sysc_methods[] = {
diff --git a/sys/arm/ti/twl/twl.c b/sys/arm/ti/twl/twl.c
--- a/sys/arm/ti/twl/twl.c
+++ b/sys/arm/ti/twl/twl.c
@@ -417,7 +417,8 @@
if ((sc->sc_clks = device_add_child(dev, "twl_clks", -1)) == NULL)
device_printf(dev, "could not allocate twl_clks instance\n");
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
diff --git a/sys/arm/ti/usb/omap_host.c b/sys/arm/ti/usb/omap_host.c
--- a/sys/arm/ti/usb/omap_host.c
+++ b/sys/arm/ti/usb/omap_host.c
@@ -420,7 +420,8 @@
*/
for (node = OF_child(node); node > 0; node = OF_peer(node))
simplebus_add_device(dev, node, 0, NULL, -1, NULL);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
error:
omap_uhh_detach(dev);
diff --git a/sys/arm64/arm64/gic_v3_acpi.c b/sys/arm64/arm64/gic_v3_acpi.c
--- a/sys/arm64/arm64/gic_v3_acpi.c
+++ b/sys/arm64/arm64/gic_v3_acpi.c
@@ -464,7 +464,7 @@
acpi_unmap_table(madt);
- bus_generic_attach(dev);
+ bus_attach_children(dev);
}
static struct resource_list *
diff --git a/sys/arm64/arm64/gic_v3_fdt.c b/sys/arm64/arm64/gic_v3_fdt.c
--- a/sys/arm64/arm64/gic_v3_fdt.c
+++ b/sys/arm64/arm64/gic_v3_fdt.c
@@ -376,7 +376,8 @@
}
}
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static struct resource_list *
diff --git a/sys/arm64/arm64/nexus.c b/sys/arm64/arm64/nexus.c
--- a/sys/arm64/arm64/nexus.c
+++ b/sys/arm64/arm64/nexus.c
@@ -178,7 +178,7 @@
panic("nexus_attach irq_rman");
bus_identify_children(dev);
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return (0);
}
diff --git a/sys/arm64/broadcom/brcmmdio/mdio_mux_iproc.c b/sys/arm64/broadcom/brcmmdio/mdio_mux_iproc.c
--- a/sys/arm64/broadcom/brcmmdio/mdio_mux_iproc.c
+++ b/sys/arm64/broadcom/brcmmdio/mdio_mux_iproc.c
@@ -362,7 +362,8 @@
node = ofw_bus_get_node(dev);
OF_device_register_xref(OF_xref_from_node(node), dev);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
error:
brcm_iproc_mdio_detach(dev);
diff --git a/sys/arm64/broadcom/brcmmdio/mdio_nexus_iproc.c b/sys/arm64/broadcom/brcmmdio/mdio_nexus_iproc.c
--- a/sys/arm64/broadcom/brcmmdio/mdio_nexus_iproc.c
+++ b/sys/arm64/broadcom/brcmmdio/mdio_nexus_iproc.c
@@ -174,7 +174,8 @@
if (err != 0)
return (err);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static const struct ofw_bus_devinfo *
diff --git a/sys/arm64/broadcom/brcmmdio/mdio_ns2_pcie_phy.c b/sys/arm64/broadcom/brcmmdio/mdio_ns2_pcie_phy.c
--- a/sys/arm64/broadcom/brcmmdio/mdio_ns2_pcie_phy.c
+++ b/sys/arm64/broadcom/brcmmdio/mdio_ns2_pcie_phy.c
@@ -154,5 +154,6 @@
if (ns2_pci_phy_init(dev) < 0)
return (EINVAL);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
diff --git a/sys/arm64/cavium/thunder_pcie_pem.c b/sys/arm64/cavium/thunder_pcie_pem.c
--- a/sys/arm64/cavium/thunder_pcie_pem.c
+++ b/sys/arm64/cavium/thunder_pcie_pem.c
@@ -907,8 +907,8 @@
}
device_add_child(dev, "pci", DEVICE_UNIT_ANY);
-
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
fail_io:
rman_fini(&sc->io_rman);
diff --git a/sys/arm64/nvidia/tegra210/max77620.c b/sys/arm64/nvidia/tegra210/max77620.c
--- a/sys/arm64/nvidia/tegra210/max77620.c
+++ b/sys/arm64/nvidia/tegra210/max77620.c
@@ -435,7 +435,8 @@
goto fail;
}
#endif
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
fail:
if (sc->irq_h != NULL)
diff --git a/sys/arm64/nvidia/tegra210/max77620_rtc.c b/sys/arm64/nvidia/tegra210/max77620_rtc.c
--- a/sys/arm64/nvidia/tegra210/max77620_rtc.c
+++ b/sys/arm64/nvidia/tegra210/max77620_rtc.c
@@ -355,7 +355,8 @@
clock_register(sc->dev, 1000000);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
fail:
LOCK_DESTROY(sc);
diff --git a/sys/arm64/qoriq/qoriq_dw_pci.c b/sys/arm64/qoriq/qoriq_dw_pci.c
--- a/sys/arm64/qoriq/qoriq_dw_pci.c
+++ b/sys/arm64/qoriq/qoriq_dw_pci.c
@@ -241,7 +241,8 @@
goto out;
}
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
out:
/* XXX Cleanup */
return (rv);
diff --git a/sys/arm64/qoriq/qoriq_therm.c b/sys/arm64/qoriq/qoriq_therm.c
--- a/sys/arm64/qoriq/qoriq_therm.c
+++ b/sys/arm64/qoriq/qoriq_therm.c
@@ -464,7 +464,8 @@
}
OF_device_register_xref(OF_xref_from_node(node), dev);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
fail:
if (sc->irq_ih != NULL)
diff --git a/sys/arm64/rockchip/rk3568_pcie.c b/sys/arm64/rockchip/rk3568_pcie.c
--- a/sys/arm64/rockchip/rk3568_pcie.c
+++ b/sys/arm64/rockchip/rk3568_pcie.c
@@ -362,7 +362,8 @@
goto fail;
}
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
fail:
rk3568_pcie_detach(dev);
return (ENXIO);
diff --git a/sys/arm64/rockchip/rk_pcie.c b/sys/arm64/rockchip/rk_pcie.c
--- a/sys/arm64/rockchip/rk_pcie.c
+++ b/sys/arm64/rockchip/rk_pcie.c
@@ -1354,7 +1354,8 @@
DELAY(250000);
device_add_child(dev, "pci", DEVICE_UNIT_ANY);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
out_full:
bus_teardown_intr(dev, sc->sys_irq_res, sc->sys_irq_cookie);
diff --git a/sys/arm64/rockchip/rk_pinctrl.c b/sys/arm64/rockchip/rk_pinctrl.c
--- a/sys/arm64/rockchip/rk_pinctrl.c
+++ b/sys/arm64/rockchip/rk_pinctrl.c
@@ -1537,7 +1537,8 @@
fdt_pinctrl_configure_tree(dev);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
diff --git a/sys/arm64/rockchip/rk_tsadc.c b/sys/arm64/rockchip/rk_tsadc.c
--- a/sys/arm64/rockchip/rk_tsadc.c
+++ b/sys/arm64/rockchip/rk_tsadc.c
@@ -818,7 +818,8 @@
}
OF_device_register_xref(OF_xref_from_node(node), dev);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
fail_sysctl:
sysctl_ctx_free(&tsadc_sysctl_ctx);
diff --git a/sys/arm64/rockchip/rk_usbphy.c b/sys/arm64/rockchip/rk_usbphy.c
--- a/sys/arm64/rockchip/rk_usbphy.c
+++ b/sys/arm64/rockchip/rk_usbphy.c
@@ -274,7 +274,8 @@
if (rv != 0)
goto fail;
}
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
fail:
return (ENXIO);
diff --git a/sys/compat/linuxkpi/common/src/linux_i2c.c b/sys/compat/linuxkpi/common/src/linux_i2c.c
--- a/sys/compat/linuxkpi/common/src/linux_i2c.c
+++ b/sys/compat/linuxkpi/common/src/linux_i2c.c
@@ -90,7 +90,7 @@
device_printf(dev, "Couldn't add iicbus child, aborting\n");
return (ENXIO);
}
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return (0);
}
@@ -316,7 +316,6 @@
lkpi_i2c_add_adapter(struct i2c_adapter *adapter)
{
device_t lkpi_iic;
- int error;
if (adapter->name[0] == '\0')
return (-EINVAL);
@@ -332,14 +331,8 @@
}
bus_topo_lock();
- error = bus_generic_attach(adapter->dev.parent->bsddev);
+ bus_attach_children(adapter->dev.parent->bsddev);
bus_topo_unlock();
- if (error) {
- device_printf(adapter->dev.parent->bsddev,
- "failed to attach child: error %d\n", error);
- sx_xunlock(&lkpi_sx_i2c);
- return (ENXIO);
- }
LKPI_IIC_ADD_ADAPTER(lkpi_iic, adapter);
sx_xunlock(&lkpi_sx_i2c);
return (0);
diff --git a/sys/compat/linuxkpi/common/src/linux_i2cbb.c b/sys/compat/linuxkpi/common/src/linux_i2cbb.c
--- a/sys/compat/linuxkpi/common/src/linux_i2cbb.c
+++ b/sys/compat/linuxkpi/common/src/linux_i2cbb.c
@@ -95,7 +95,7 @@
device_printf(dev, "Couldn't add iicbb child, aborting\n");
return (ENXIO);
}
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return (0);
}
@@ -303,7 +303,6 @@
lkpi_i2c_bit_add_bus(struct i2c_adapter *adapter)
{
device_t lkpi_iicbb;
- int error;
if (bootverbose)
device_printf(adapter->dev.parent->bsddev,
@@ -317,14 +316,8 @@
}
bus_topo_lock();
- error = bus_generic_attach(adapter->dev.parent->bsddev);
+ bus_attach_children(adapter->dev.parent->bsddev);
bus_topo_unlock();
- if (error) {
- device_printf(adapter->dev.parent->bsddev,
- "failed to attach child: error %d\n", error);
- sx_xunlock(&lkpi_sx_i2cbb);
- return (ENXIO);
- }
LKPI_IIC_ADD_ADAPTER(lkpi_iicbb, adapter);
sx_xunlock(&lkpi_sx_i2cbb);
return (0);
diff --git a/sys/contrib/vchiq/interface/vchiq_arm/vchiq_kmod.c b/sys/contrib/vchiq/interface/vchiq_arm/vchiq_kmod.c
--- a/sys/contrib/vchiq/interface/vchiq_arm/vchiq_kmod.c
+++ b/sys/contrib/vchiq/interface/vchiq_arm/vchiq_kmod.c
@@ -193,7 +193,7 @@
vchiq_init();
bus_identify_children(dev);
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return (0);
}
diff --git a/sys/dev/aac/aac.c b/sys/dev/aac/aac.c
--- a/sys/dev/aac/aac.c
+++ b/sys/dev/aac/aac.c
@@ -441,8 +441,7 @@
sc->aac_state &= ~AAC_STATE_SUSPEND;
/* poke the bus to actually attach the child devices */
- if (bus_generic_attach(sc->aac_dev))
- device_printf(sc->aac_dev, "bus_generic_attach failed\n");
+ bus_attach_children(sc->aac_dev);
/* disconnect ourselves from the intrhook chain */
config_intrhook_disestablish(&sc->aac_ich);
@@ -3324,7 +3323,7 @@
if (added) {
mtx_unlock(&sc->aac_io_lock);
bus_topo_lock();
- bus_generic_attach(sc->aac_dev);
+ bus_attach_children(sc->aac_dev);
bus_topo_unlock();
mtx_lock(&sc->aac_io_lock);
}
@@ -3808,5 +3807,5 @@
}
if (found)
- bus_generic_attach(sc->aac_dev);
+ bus_attach_children(sc->aac_dev);
}
diff --git a/sys/dev/aacraid/aacraid.c b/sys/dev/aacraid/aacraid.c
--- a/sys/dev/aacraid/aacraid.c
+++ b/sys/dev/aacraid/aacraid.c
@@ -335,7 +335,7 @@
aac_get_bus_info(sc);
/* poke the bus to actually attach the child devices */
- bus_generic_attach(sc->aac_dev);
+ bus_attach_children(sc->aac_dev);
/* mark the controller up */
sc->aac_state &= ~AAC_STATE_SUSPEND;
@@ -3631,7 +3631,7 @@
device_set_desc(child, aac_describe_code(aac_container_types,
mir->MntTable[0].VolType));
*/
- bus_generic_attach(sc->aac_dev);
+ bus_attach_children(sc->aac_dev);
}
static void
diff --git a/sys/dev/acpi_support/acpi_wmi.c b/sys/dev/acpi_support/acpi_wmi.c
--- a/sys/dev/acpi_support/acpi_wmi.c
+++ b/sys/dev/acpi_support/acpi_wmi.c
@@ -297,7 +297,7 @@
if (ret == 0) {
bus_identify_children(dev);
- ret = bus_generic_attach(dev);
+ bus_attach_children(dev);
}
return (ret);
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c
--- a/sys/dev/acpica/acpi.c
+++ b/sys/dev/acpica/acpi.c
@@ -2287,8 +2287,8 @@
bus_identify_children(bus);
/* Probe/attach all children, created statically and from the namespace. */
- ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "acpi bus_generic_attach\n"));
- bus_generic_attach(bus);
+ ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "acpi bus_attach_children\n"));
+ bus_attach_children(bus);
/*
* Reserve resources allocated to children but not yet allocated
diff --git a/sys/dev/acpica/acpi_container.c b/sys/dev/acpica/acpi_container.c
--- a/sys/dev/acpica/acpi_container.c
+++ b/sys/dev/acpica/acpi_container.c
@@ -104,7 +104,8 @@
{
bus_identify_children(dev);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
diff --git a/sys/dev/acpica/acpi_cpu.c b/sys/dev/acpica/acpi_cpu.c
--- a/sys/dev/acpica/acpi_cpu.c
+++ b/sys/dev/acpica/acpi_cpu.c
@@ -471,7 +471,7 @@
}
CPU_FOREACH(i) {
if ((sc = cpu_softc[i]) != NULL) {
- bus_generic_attach(sc->cpu_dev);
+ bus_attach_children(sc->cpu_dev);
attached = 1;
}
}
diff --git a/sys/dev/acpica/acpi_pcib_acpi.c b/sys/dev/acpica/acpi_pcib_acpi.c
--- a/sys/dev/acpica/acpi_pcib_acpi.c
+++ b/sys/dev/acpica/acpi_pcib_acpi.c
@@ -535,7 +535,8 @@
error = ENXIO;
goto errout;
}
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
errout:
device_printf(device_get_parent(dev), "couldn't attach pci bus\n");
diff --git a/sys/dev/adb/adb_bus.c b/sys/dev/adb/adb_bus.c
--- a/sys/dev/adb/adb_bus.c
+++ b/sys/dev/adb/adb_bus.c
@@ -182,7 +182,7 @@
}
}
- bus_generic_attach(dev);
+ bus_attach_children(dev);
config_intrhook_disestablish(&sc->enum_hook);
}
diff --git a/sys/dev/ahci/ahci.c b/sys/dev/ahci/ahci.c
--- a/sys/dev/ahci/ahci.c
+++ b/sys/dev/ahci/ahci.c
@@ -383,7 +383,7 @@
else
device_set_ivars(child, (void *)(intptr_t)AHCI_EM_UNIT);
}
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return (0);
}
diff --git a/sys/dev/alpm/alpm.c b/sys/dev/alpm/alpm.c
--- a/sys/dev/alpm/alpm.c
+++ b/sys/dev/alpm/alpm.c
@@ -223,7 +223,7 @@
alpm_detach(dev);
return (EINVAL);
}
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return (0);
}
diff --git a/sys/dev/amdpm/amdpm.c b/sys/dev/amdpm/amdpm.c
--- a/sys/dev/amdpm/amdpm.c
+++ b/sys/dev/amdpm/amdpm.c
@@ -220,7 +220,7 @@
return (EINVAL);
}
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return (0);
}
diff --git a/sys/dev/amdsmb/amdsmb.c b/sys/dev/amdsmb/amdsmb.c
--- a/sys/dev/amdsmb/amdsmb.c
+++ b/sys/dev/amdsmb/amdsmb.c
@@ -165,7 +165,7 @@
return (EINVAL);
}
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return (0);
}
diff --git a/sys/dev/ata/ata-pci.c b/sys/dev/ata/ata-pci.c
--- a/sys/dev/ata/ata-pci.c
+++ b/sys/dev/ata/ata-pci.c
@@ -126,7 +126,7 @@
else
device_set_ivars(child, (void *)(intptr_t)unit);
}
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return 0;
}
diff --git a/sys/dev/ata/chipsets/ata-jmicron.c b/sys/dev/ata/chipsets/ata-jmicron.c
--- a/sys/dev/ata/chipsets/ata-jmicron.c
+++ b/sys/dev/ata/chipsets/ata-jmicron.c
@@ -113,7 +113,7 @@
child = device_add_child(dev, NULL, DEVICE_UNIT_ANY);
if (child != NULL) {
device_set_ivars(child, (void *)(intptr_t)-1);
- bus_generic_attach(dev);
+ bus_attach_children(dev);
}
}
ctlr->ch_attach = ata_jmicron_ch_attach;
diff --git a/sys/dev/ata/chipsets/ata-marvell.c b/sys/dev/ata/chipsets/ata-marvell.c
--- a/sys/dev/ata/chipsets/ata-marvell.c
+++ b/sys/dev/ata/chipsets/ata-marvell.c
@@ -128,7 +128,7 @@
child = device_add_child(dev, NULL, DEVICE_UNIT_ANY);
if (child != NULL) {
device_set_ivars(child, (void *)(intptr_t)-1);
- bus_generic_attach(dev);
+ bus_attach_children(dev);
}
}
ctlr->ch_attach = ata_marvell_ch_attach;
diff --git a/sys/dev/atkbdc/atkbdc_isa.c b/sys/dev/atkbdc/atkbdc_isa.c
--- a/sys/dev/atkbdc/atkbdc_isa.c
+++ b/sys/dev/atkbdc/atkbdc_isa.c
@@ -239,7 +239,7 @@
*(atkbdc_softc_t **)device_get_softc(dev) = sc;
bus_identify_children(dev);
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return 0;
}
diff --git a/sys/dev/atopcase/atopcase.c b/sys/dev/atopcase/atopcase.c
--- a/sys/dev/atopcase/atopcase.c
+++ b/sys/dev/atopcase/atopcase.c
@@ -533,7 +533,8 @@
if (sc->sc_tq != NULL)
taskqueue_enqueue_timeout(sc->sc_tq, &sc->sc_task, hz / 120);
- return (bus_generic_attach(sc->sc_dev));
+ bus_attach_children(sc->sc_dev);
+ return (0);
err:
return (err);
diff --git a/sys/dev/bhnd/bhndb/bhndb_pci.c b/sys/dev/bhnd/bhndb/bhndb_pci.c
--- a/sys/dev/bhnd/bhndb/bhndb_pci.c
+++ b/sys/dev/bhnd/bhndb/bhndb_pci.c
@@ -458,8 +458,7 @@
goto cleanup;
/* Probe and attach our children */
- if ((error = bus_generic_attach(dev)))
- goto cleanup;
+ bus_attach_children(dev);
bhndb_pci_probe_free_core_table(cores);
diff --git a/sys/dev/bhnd/cores/chipc/chipc.c b/sys/dev/bhnd/cores/chipc/chipc.c
--- a/sys/dev/bhnd/cores/chipc/chipc.c
+++ b/sys/dev/bhnd/cores/chipc/chipc.c
@@ -211,13 +211,12 @@
* response to ChipCommin API requests.
*
* Since our children may need access to ChipCommon, this must be done
- * before attaching our children below (via bus_generic_attach).
+ * before attaching our children below (via bus_attach_children).
*/
if ((error = bhnd_register_provider(dev, BHND_SERVICE_CHIPC)))
goto failed;
- if ((error = bus_generic_attach(dev)))
- goto failed;
+ bus_attach_children(dev);
return (0);
diff --git a/sys/dev/bhnd/cores/chipc/chipc_spi.c b/sys/dev/bhnd/cores/chipc/chipc_spi.c
--- a/sys/dev/bhnd/cores/chipc/chipc_spi.c
+++ b/sys/dev/bhnd/cores/chipc/chipc_spi.c
@@ -115,8 +115,7 @@
/* Let spibus perform full attach before we try to call
* BUS_ADD_CHILD() */
- if ((error = bus_generic_attach(dev)))
- goto failed;
+ bus_attach_children(dev);
/* Determine flash type and add the flash child */
ccaps = BHND_CHIPC_GET_CAPS(device_get_parent(dev));
diff --git a/sys/dev/bhnd/cores/pci/bhnd_pci.c b/sys/dev/bhnd/cores/pci/bhnd_pci.c
--- a/sys/dev/bhnd/cores/pci/bhnd_pci.c
+++ b/sys/dev/bhnd/cores/pci/bhnd_pci.c
@@ -125,7 +125,6 @@
bhnd_pci_generic_attach(device_t dev)
{
struct bhnd_pci_softc *sc;
- int error;
sc = device_get_softc(dev);
sc->dev = dev;
@@ -141,16 +140,9 @@
BHND_PCI_LOCK_INIT(sc);
/* Probe and attach children */
- if ((error = bus_generic_attach(dev)))
- goto cleanup;
+ bus_attach_children(dev);
return (0);
-
-cleanup:
- bhnd_release_resource(dev, SYS_RES_MEMORY, sc->mem_rid, sc->mem_res);
- BHND_PCI_LOCK_DESTROY(sc);
-
- return (error);
}
int
diff --git a/sys/dev/bhnd/cores/pcie2/bhnd_pcie2.c b/sys/dev/bhnd/cores/pcie2/bhnd_pcie2.c
--- a/sys/dev/bhnd/cores/pcie2/bhnd_pcie2.c
+++ b/sys/dev/bhnd/cores/pcie2/bhnd_pcie2.c
@@ -89,7 +89,6 @@
bhnd_pcie2_generic_attach(device_t dev)
{
struct bhnd_pcie2_softc *sc;
- int error;
sc = device_get_softc(dev);
sc->dev = dev;
@@ -105,16 +104,9 @@
BHND_PCIE2_LOCK_INIT(sc);
/* Probe and attach children */
- if ((error = bus_generic_attach(dev)))
- goto cleanup;
+ bus_attach_children(dev);
return (0);
-
-cleanup:
- bhnd_release_resource(dev, SYS_RES_MEMORY, sc->mem_rid, sc->mem_res);
- BHND_PCIE2_LOCK_DESTROY(sc);
-
- return (error);
}
int
diff --git a/sys/dev/cfi/cfi_core.c b/sys/dev/cfi/cfi_core.c
--- a/sys/dev/cfi/cfi_core.c
+++ b/sys/dev/cfi/cfi_core.c
@@ -446,7 +446,7 @@
#endif
device_add_child(dev, "cfid", DEVICE_UNIT_ANY);
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return (0);
}
diff --git a/sys/dev/clk/allwinner/aw_ccu.c b/sys/dev/clk/allwinner/aw_ccu.c
--- a/sys/dev/clk/allwinner/aw_ccu.c
+++ b/sys/dev/clk/allwinner/aw_ccu.c
@@ -220,7 +220,8 @@
device_probe_and_attach(cdev);
}
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static device_method_t aw_ccu_methods[] = {
diff --git a/sys/dev/clk/clk_bus.c b/sys/dev/clk/clk_bus.c
--- a/sys/dev/clk/clk_bus.c
+++ b/sys/dev/clk/clk_bus.c
@@ -69,7 +69,8 @@
device_probe_and_attach(cdev);
}
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static device_method_t ofw_clkbus_methods[] = {
diff --git a/sys/dev/clk/clk_fixed.c b/sys/dev/clk/clk_fixed.c
--- a/sys/dev/clk/clk_fixed.c
+++ b/sys/dev/clk/clk_fixed.c
@@ -269,7 +269,8 @@
OF_prop_free(__DECONST(char *, def.clkdef.name));
OF_prop_free(def.clkdef.parent_names);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
fail:
OF_prop_free(__DECONST(char *, def.clkdef.name));
diff --git a/sys/dev/cxgb/cxgb_main.c b/sys/dev/cxgb/cxgb_main.c
--- a/sys/dev/cxgb/cxgb_main.c
+++ b/sys/dev/cxgb/cxgb_main.c
@@ -641,8 +641,7 @@
sc->portdev[i] = child;
device_set_softc(child, pi);
}
- if ((error = bus_generic_attach(dev)) != 0)
- goto out;
+ bus_attach_children(dev);
/* initialize sge private state */
t3_sge_init_adapter(sc);
diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c
--- a/sys/dev/cxgbe/t4_main.c
+++ b/sys/dev/cxgbe/t4_main.c
@@ -1635,12 +1635,7 @@
*/
sc->flags |= CHK_MBOX_ACCESS;
- rc = bus_generic_attach(dev);
- if (rc != 0) {
- device_printf(dev,
- "failed to attach all child ports: %d\n", rc);
- goto done;
- }
+ bus_attach_children(dev);
t4_calibration_start(sc);
device_printf(dev,
@@ -2775,7 +2770,7 @@
cxgbe_sysctls(pi);
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return (0);
}
diff --git a/sys/dev/cxgbe/t4_vf.c b/sys/dev/cxgbe/t4_vf.c
--- a/sys/dev/cxgbe/t4_vf.c
+++ b/sys/dev/cxgbe/t4_vf.c
@@ -755,12 +755,7 @@
goto done;
}
- rc = bus_generic_attach(dev);
- if (rc != 0) {
- device_printf(dev,
- "failed to attach all child ports: %d\n", rc);
- goto done;
- }
+ bus_attach_children(dev);
device_printf(dev,
"%d ports, %d %s interrupt%s, %d eq, %d iq\n",
diff --git a/sys/dev/dpaa/bman_portals.c b/sys/dev/dpaa/bman_portals.c
--- a/sys/dev/dpaa/bman_portals.c
+++ b/sys/dev/dpaa/bman_portals.c
@@ -67,7 +67,8 @@
/* Set portal properties for XX_VirtToPhys() */
XX_PortalSetInfo(dev);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
int
diff --git a/sys/dev/dpaa/fman.c b/sys/dev/dpaa/fman.c
--- a/sys/dev/dpaa/fman.c
+++ b/sys/dev/dpaa/fman.c
@@ -473,7 +473,8 @@
goto err;
}
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
err:
fman_detach(dev);
diff --git a/sys/dev/dpaa/qman_portals.c b/sys/dev/dpaa/qman_portals.c
--- a/sys/dev/dpaa/qman_portals.c
+++ b/sys/dev/dpaa/qman_portals.c
@@ -72,7 +72,8 @@
/* Set portal properties for XX_VirtToPhys() */
XX_PortalSetInfo(dev);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
int
diff --git a/sys/dev/dpaa2/dpaa2_mc.c b/sys/dev/dpaa2/dpaa2_mc.c
--- a/sys/dev/dpaa2/dpaa2_mc.c
+++ b/sys/dev/dpaa2/dpaa2_mc.c
@@ -269,7 +269,7 @@
return (ENXIO);
}
bus_identify_children(dev);
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return (0);
}
diff --git a/sys/dev/dpaa2/dpaa2_rc.c b/sys/dev/dpaa2/dpaa2_rc.c
--- a/sys/dev/dpaa2/dpaa2_rc.c
+++ b/sys/dev/dpaa2/dpaa2_rc.c
@@ -2827,11 +2827,7 @@
}
/* Probe and attach MC portals. */
bus_identify_children(rcdev);
- rc = bus_generic_attach(rcdev);
- if (rc) {
- DPAA2_CMD_RC_CLOSE(rcdev, child, &cmd);
- return (rc);
- }
+ bus_attach_children(rcdev);
/* Add managed devices (except DPMCPs) to the resource container. */
for (uint32_t i = 0; i < obj_count; i++) {
@@ -2855,11 +2851,7 @@
}
/* Probe and attach managed devices properly. */
bus_identify_children(rcdev);
- rc = bus_generic_attach(rcdev);
- if (rc) {
- DPAA2_CMD_RC_CLOSE(rcdev, child, &cmd);
- return (rc);
- }
+ bus_attach_children(rcdev);
/* Add other devices to the resource container. */
for (uint32_t i = 0; i < obj_count; i++) {
@@ -2880,7 +2872,8 @@
/* Probe and attach the rest of devices. */
bus_identify_children(rcdev);
- return (bus_generic_attach(rcdev));
+ bus_attach_children(rcdev);
+ return (0);
}
/**
@@ -2987,7 +2980,7 @@
* container and add them as children to perform a proper initialization.
*
* NOTE: It must be called together with bus_identify_children() and
- * bus_generic_attach() before dpaa2_rc_add_child().
+ * bus_attach_children() before dpaa2_rc_add_child().
*/
static int
dpaa2_rc_add_managed_child(struct dpaa2_rc_softc *sc, struct dpaa2_cmd *cmd,
diff --git a/sys/dev/dpaa2/memac_mdio_acpi.c b/sys/dev/dpaa2/memac_mdio_acpi.c
--- a/sys/dev/dpaa2/memac_mdio_acpi.c
+++ b/sys/dev/dpaa2/memac_mdio_acpi.c
@@ -263,7 +263,7 @@
memac_mdio_acpi_probe_child, &ctx);
if (ctx.countok > 0) {
bus_identify_children(dev);
- bus_generic_attach(dev);
+ bus_attach_children(dev);
}
return (0);
diff --git a/sys/dev/drm2/drm_dp_iic_helper.c b/sys/dev/drm2/drm_dp_iic_helper.c
--- a/sys/dev/drm2/drm_dp_iic_helper.c
+++ b/sys/dev/drm2/drm_dp_iic_helper.c
@@ -211,7 +211,7 @@
if (aux_data->port == NULL)
return (ENXIO);
device_quiet(aux_data->port);
- bus_generic_attach(idev);
+ bus_attach_children(idev);
return (0);
}
diff --git a/sys/dev/dwwdt/dwwdt.c b/sys/dev/dwwdt/dwwdt.c
--- a/sys/dev/dwwdt/dwwdt.c
+++ b/sys/dev/dwwdt/dwwdt.c
@@ -290,7 +290,8 @@
sc->sc_evtag = EVENTHANDLER_REGISTER(watchdog_list, dwwdt_event, sc, 0);
sc->sc_status = DWWDT_STOPPED;
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
err_no_freq:
clk_release(sc->sc_clk);
diff --git a/sys/dev/etherswitch/ar40xx/ar40xx_main.c b/sys/dev/etherswitch/ar40xx/ar40xx_main.c
--- a/sys/dev/etherswitch/ar40xx/ar40xx_main.c
+++ b/sys/dev/etherswitch/ar40xx/ar40xx_main.c
@@ -484,7 +484,7 @@
bus_identify_children(dev);
bus_enumerate_hinted_children(dev);
- ret = bus_generic_attach(dev);
+ bus_attach_children(dev);
/* Start timer */
callout_init_mtx(&sc->sc_phy_callout, &sc->sc_mtx, 0);
diff --git a/sys/dev/etherswitch/arswitch/arswitch.c b/sys/dev/etherswitch/arswitch/arswitch.c
--- a/sys/dev/etherswitch/arswitch/arswitch.c
+++ b/sys/dev/etherswitch/arswitch/arswitch.c
@@ -651,12 +651,7 @@
bus_identify_children(dev);
bus_enumerate_hinted_children(dev);
- err = bus_generic_attach(dev);
- if (err != 0) {
- DPRINTF(sc, ARSWITCH_DBG_ANY,
- "%s: bus_generic_attach: err=%d\n", __func__, err);
- return (err);
- }
+ bus_attach_children(dev);
callout_init_mtx(&sc->callout_tick, &sc->sc_mtx, 0);
diff --git a/sys/dev/etherswitch/e6000sw/e6000sw.c b/sys/dev/etherswitch/e6000sw/e6000sw.c
--- a/sys/dev/etherswitch/e6000sw/e6000sw.c
+++ b/sys/dev/etherswitch/e6000sw/e6000sw.c
@@ -643,7 +643,7 @@
E6000SW_UNLOCK(sc);
bus_identify_children(dev);
- bus_generic_attach(dev);
+ bus_attach_children(dev);
taskqueue_enqueue_timeout(sc->sc_tq, &sc->sc_tt, hz);
diff --git a/sys/dev/etherswitch/e6000sw/e6060sw.c b/sys/dev/etherswitch/e6000sw/e6060sw.c
--- a/sys/dev/etherswitch/e6000sw/e6060sw.c
+++ b/sys/dev/etherswitch/e6000sw/e6060sw.c
@@ -308,9 +308,7 @@
bus_identify_children(dev);
bus_enumerate_hinted_children(dev);
- err = bus_generic_attach(dev);
- if (err != 0)
- return (err);
+ bus_attach_children(dev);
callout_init(&sc->callout_tick, 0);
diff --git a/sys/dev/etherswitch/felix/felix.c b/sys/dev/etherswitch/felix/felix.c
--- a/sys/dev/etherswitch/felix/felix.c
+++ b/sys/dev/etherswitch/felix/felix.c
@@ -464,7 +464,7 @@
/* Allow etherswitch to attach as our child. */
bus_identify_children(dev);
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return (0);
diff --git a/sys/dev/etherswitch/infineon/adm6996fc.c b/sys/dev/etherswitch/infineon/adm6996fc.c
--- a/sys/dev/etherswitch/infineon/adm6996fc.c
+++ b/sys/dev/etherswitch/infineon/adm6996fc.c
@@ -260,9 +260,7 @@
bus_identify_children(dev);
bus_enumerate_hinted_children(dev);
- err = bus_generic_attach(dev);
- if (err != 0)
- goto failed;
+ bus_attach_children(dev);
callout_init(&sc->callout_tick, 0);
diff --git a/sys/dev/etherswitch/ip17x/ip17x.c b/sys/dev/etherswitch/ip17x/ip17x.c
--- a/sys/dev/etherswitch/ip17x/ip17x.c
+++ b/sys/dev/etherswitch/ip17x/ip17x.c
@@ -259,9 +259,7 @@
bus_identify_children(dev);
bus_enumerate_hinted_children(dev);
- err = bus_generic_attach(dev);
- if (err != 0)
- return (err);
+ bus_attach_children(dev);
if (sc->miipoll) {
callout_init(&sc->callout_tick, 0);
diff --git a/sys/dev/etherswitch/micrel/ksz8995ma.c b/sys/dev/etherswitch/micrel/ksz8995ma.c
--- a/sys/dev/etherswitch/micrel/ksz8995ma.c
+++ b/sys/dev/etherswitch/micrel/ksz8995ma.c
@@ -310,9 +310,7 @@
bus_identify_children(dev);
bus_enumerate_hinted_children(dev);
- err = bus_generic_attach(dev);
- if (err != 0)
- goto failed;
+ bus_attach_children(dev);
callout_init(&sc->callout_tick, 0);
diff --git a/sys/dev/etherswitch/miiproxy.c b/sys/dev/etherswitch/miiproxy.c
--- a/sys/dev/etherswitch/miiproxy.c
+++ b/sys/dev/etherswitch/miiproxy.c
@@ -265,7 +265,8 @@
* The ethernet interface needs to call mii_attach_proxy() to pass
* the relevant parameters for rendezvous with the MDIO target.
*/
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
@@ -348,7 +349,8 @@
{
rendezvous_register_target(dev, mdioproxy_rendezvous_callback);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
@@ -368,7 +370,6 @@
mii_attach_proxy(device_t dev)
{
struct miiproxy_softc *sc;
- int error;
const char *name;
device_t miiproxy;
@@ -381,11 +382,7 @@
}
miiproxy = device_add_child(dev, miiproxy_driver.name, DEVICE_UNIT_ANY);
- error = bus_generic_attach(dev);
- if (error != 0) {
- device_printf(dev, "can't attach miiproxy\n");
- return (NULL);
- }
+ bus_attach_children(dev);
sc = device_get_softc(miiproxy);
sc->parent = dev;
sc->proxy = miiproxy;
diff --git a/sys/dev/etherswitch/mtkswitch/mtkswitch.c b/sys/dev/etherswitch/mtkswitch/mtkswitch.c
--- a/sys/dev/etherswitch/mtkswitch/mtkswitch.c
+++ b/sys/dev/etherswitch/mtkswitch/mtkswitch.c
@@ -233,10 +233,7 @@
bus_identify_children(dev);
bus_enumerate_hinted_children(dev);
- err = bus_generic_attach(dev);
- DPRINTF(dev, "%s: bus_generic_attach: err=%d\n", __func__, err);
- if (err != 0)
- return (err);
+ bus_attach_children(dev);
callout_init_mtx(&sc->callout_tick, &sc->sc_mtx, 0);
diff --git a/sys/dev/etherswitch/rtl8366/rtl8366rb.c b/sys/dev/etherswitch/rtl8366/rtl8366rb.c
--- a/sys/dev/etherswitch/rtl8366/rtl8366rb.c
+++ b/sys/dev/etherswitch/rtl8366/rtl8366rb.c
@@ -256,9 +256,7 @@
bus_identify_children(dev);
bus_enumerate_hinted_children(dev);
- err = bus_generic_attach(dev);
- if (err != 0)
- return (err);
+ bus_attach_children(dev);
callout_init_mtx(&sc->callout_tick, &sc->callout_mtx, 0);
rtl8366rb_tick(sc);
diff --git a/sys/dev/etherswitch/ukswitch/ukswitch.c b/sys/dev/etherswitch/ukswitch/ukswitch.c
--- a/sys/dev/etherswitch/ukswitch/ukswitch.c
+++ b/sys/dev/etherswitch/ukswitch/ukswitch.c
@@ -211,9 +211,7 @@
bus_identify_children(dev);
bus_enumerate_hinted_children(dev);
- err = bus_generic_attach(dev);
- if (err != 0)
- return (err);
+ bus_attach_children(dev);
callout_init(&sc->callout_tick, 0);
diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c
--- a/sys/dev/fdc/fdc.c
+++ b/sys/dev/fdc/fdc.c
@@ -1840,7 +1840,7 @@
fdc_hints_probe(device_t dev)
{
const char *name, *dname;
- int i, error, dunit;
+ int i, dunit;
/*
* Probe and attach any children. We should probably detect
@@ -1853,8 +1853,7 @@
fdc_add_child(dev, dname, dunit);
}
- if ((error = bus_generic_attach(dev)) != 0)
- return (error);
+ bus_attach_children(dev);
return (0);
}
diff --git a/sys/dev/fdc/fdc_acpi.c b/sys/dev/fdc/fdc_acpi.c
--- a/sys/dev/fdc/fdc_acpi.c
+++ b/sys/dev/fdc/fdc_acpi.c
@@ -178,7 +178,8 @@
free(ctx, M_TEMP);
/* Attach any children found during the probe. */
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static ACPI_STATUS
diff --git a/sys/dev/fdt/simple_mfd.c b/sys/dev/fdt/simple_mfd.c
--- a/sys/dev/fdt/simple_mfd.c
+++ b/sys/dev/fdt/simple_mfd.c
@@ -223,7 +223,8 @@
return (ENXIO);
}
}
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
diff --git a/sys/dev/fdt/simplebus.c b/sys/dev/fdt/simplebus.c
--- a/sys/dev/fdt/simplebus.c
+++ b/sys/dev/fdt/simplebus.c
@@ -182,7 +182,8 @@
if (rv != 0)
return (rv);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
int
diff --git a/sys/dev/firewire/firewire.c b/sys/dev/firewire/firewire.c
--- a/sys/dev/firewire/firewire.c
+++ b/sys/dev/firewire/firewire.c
@@ -455,7 +455,7 @@
bus_identify_children(dev);
/* launch attachement of the added children */
- bus_generic_attach(dev);
+ bus_attach_children(dev);
/* bus_reset */
FW_GLOCK(fc);
diff --git a/sys/dev/firewire/fwohci_pci.c b/sys/dev/firewire/fwohci_pci.c
--- a/sys/dev/firewire/fwohci_pci.c
+++ b/sys/dev/firewire/fwohci_pci.c
@@ -315,7 +315,7 @@
/* probe and attach a child device(firewire) */
bus_identify_children(self);
- bus_generic_attach(self);
+ bus_attach_children(self);
return 0;
}
diff --git a/sys/dev/firmware/arm/scmi.c b/sys/dev/firmware/arm/scmi.c
--- a/sys/dev/firmware/arm/scmi.c
+++ b/sys/dev/firmware/arm/scmi.c
@@ -182,9 +182,9 @@
for (node = OF_child(node); node > 0; node = OF_peer(node))
simplebus_add_device(dev, node, 0, NULL, -1, NULL);
- error = bus_generic_attach(dev);
+ bus_attach_children(dev);
- return (error);
+ return (0);
}
static int
diff --git a/sys/dev/firmware/xilinx/zynqmp_firmware.c b/sys/dev/firmware/xilinx/zynqmp_firmware.c
--- a/sys/dev/firmware/xilinx/zynqmp_firmware.c
+++ b/sys/dev/firmware/xilinx/zynqmp_firmware.c
@@ -477,7 +477,8 @@
device_probe_and_attach(cdev);
}
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static device_method_t zynqmp_firmware_methods[] = {
diff --git a/sys/dev/flash/cqspi.c b/sys/dev/flash/cqspi.c
--- a/sys/dev/flash/cqspi.c
+++ b/sys/dev/flash/cqspi.c
@@ -620,7 +620,7 @@
sc = arg;
cqspi_add_devices(sc->dev);
- bus_generic_attach(sc->dev);
+ bus_attach_children(sc->dev);
config_intrhook_disestablish(&sc->config_intrhook);
}
diff --git a/sys/dev/gpio/dwgpio/dwgpio_bus.c b/sys/dev/gpio/dwgpio/dwgpio_bus.c
--- a/sys/dev/gpio/dwgpio/dwgpio_bus.c
+++ b/sys/dev/gpio/dwgpio/dwgpio_bus.c
@@ -102,7 +102,8 @@
for (node = OF_child(node); node > 0; node = OF_peer(node))
simplebus_add_device(dev, node, 0, NULL, -1, NULL);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
diff --git a/sys/dev/gpio/gpiobus.c b/sys/dev/gpio/gpiobus.c
--- a/sys/dev/gpio/gpiobus.c
+++ b/sys/dev/gpio/gpiobus.c
@@ -307,7 +307,7 @@
#ifdef FDT
ofw_gpiobus_register_provider(dev);
#endif
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return (busdev);
}
@@ -563,7 +563,8 @@
bus_identify_children(dev);
bus_enumerate_hinted_children(dev);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
/*
@@ -713,7 +714,7 @@
* hints or drivers have arrived since we last tried.
*/
bus_enumerate_hinted_children(dev);
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return (0);
}
diff --git a/sys/dev/gpio/gpioiic.c b/sys/dev/gpio/gpioiic.c
--- a/sys/dev/gpio/gpioiic.c
+++ b/sys/dev/gpio/gpioiic.c
@@ -321,7 +321,8 @@
/* Add the bitbang driver as our only child; it will add iicbus. */
device_add_child(sc->dev, "iicbb", DEVICE_UNIT_ANY);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
diff --git a/sys/dev/gpio/gpiospi.c b/sys/dev/gpio/gpiospi.c
--- a/sys/dev/gpio/gpiospi.c
+++ b/sys/dev/gpio/gpiospi.c
@@ -178,7 +178,8 @@
gpio_spi_chip_deactivate(sc, -1);
device_add_child(dev, "spibus", DEVICE_UNIT_ANY);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
diff --git a/sys/dev/gpio/ofw_gpiobus.c b/sys/dev/gpio/ofw_gpiobus.c
--- a/sys/dev/gpio/ofw_gpiobus.c
+++ b/sys/dev/gpio/ofw_gpiobus.c
@@ -440,7 +440,8 @@
continue;
}
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static device_t
diff --git a/sys/dev/hid/hidbus.c b/sys/dev/hid/hidbus.c
--- a/sys/dev/hid/hidbus.c
+++ b/sys/dev/hid/hidbus.c
@@ -272,9 +272,10 @@
if (sc->nest != 0)
return (0);
- if (hid_is_keyboard(sc->rdesc.data, sc->rdesc.len) != 0)
- error = bus_generic_attach(dev);
- else
+ if (hid_is_keyboard(sc->rdesc.data, sc->rdesc.len) != 0) {
+ bus_attach_children(dev);
+ error = 0;
+ } else
error = bus_delayed_attach_children(dev);
if (error != 0)
device_printf(dev, "failed to attach child: error %d\n", error);
diff --git a/sys/dev/hyperv/input/hv_hid.c b/sys/dev/hyperv/input/hv_hid.c
--- a/sys/dev/hyperv/input/hv_hid.c
+++ b/sys/dev/hyperv/input/hv_hid.c
@@ -443,9 +443,7 @@
goto out;
}
device_set_ivars(child, &sc->hdi);
- ret = bus_generic_attach(dev);
- if (ret != 0)
- device_printf(sc->dev, "failed to attach hidbus\n");
+ bus_attach_children(dev);
out:
if (ret != 0)
hv_hid_detach(dev);
diff --git a/sys/dev/hyperv/pcib/vmbus_pcib.c b/sys/dev/hyperv/pcib/vmbus_pcib.c
--- a/sys/dev/hyperv/pcib/vmbus_pcib.c
+++ b/sys/dev/hyperv/pcib/vmbus_pcib.c
@@ -1571,7 +1571,7 @@
goto vmbus_close;
}
- bus_generic_attach(dev);
+ bus_attach_children(dev);
hbus->state = hv_pcibus_installed;
diff --git a/sys/dev/hyperv/vmbus/vmbus.c b/sys/dev/hyperv/vmbus/vmbus.c
--- a/sys/dev/hyperv/vmbus/vmbus.c
+++ b/sys/dev/hyperv/vmbus/vmbus.c
@@ -560,7 +560,7 @@
* Identify, probe and attach for non-channel devices.
*/
bus_identify_children(sc->vmbus_dev);
- bus_generic_attach(sc->vmbus_dev);
+ bus_attach_children(sc->vmbus_dev);
/*
* This taskqueue serializes vmbus devices' attach and detach
diff --git a/sys/dev/ichiic/ig4_iic.c b/sys/dev/ichiic/ig4_iic.c
--- a/sys/dev/ichiic/ig4_iic.c
+++ b/sys/dev/ichiic/ig4_iic.c
@@ -1069,11 +1069,7 @@
"Unable to setup irq: error %d\n", error);
}
- error = bus_generic_attach(sc->dev);
- if (error) {
- device_printf(sc->dev,
- "failed to attach child: error %d\n", error);
- }
+ bus_attach_children(sc->dev);
done:
return (error);
diff --git a/sys/dev/ida/ida.c b/sys/dev/ida/ida.c
--- a/sys/dev/ida/ida.c
+++ b/sys/dev/ida/ida.c
@@ -333,7 +333,7 @@
config_intrhook_disestablish(&ida->ich);
bus_topo_lock();
- bus_generic_attach(ida->dev);
+ bus_attach_children(ida->dev);
bus_topo_unlock();
}
diff --git a/sys/dev/iicbus/controller/opencores/iicoc_pci.c b/sys/dev/iicbus/controller/opencores/iicoc_pci.c
--- a/sys/dev/iicbus/controller/opencores/iicoc_pci.c
+++ b/sys/dev/iicbus/controller/opencores/iicoc_pci.c
@@ -88,7 +88,7 @@
mtx_destroy(&sc->sc_mtx);
return (-1);
}
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return (0);
}
diff --git a/sys/dev/iicbus/controller/rockchip/rk_i2c.c b/sys/dev/iicbus/controller/rockchip/rk_i2c.c
--- a/sys/dev/iicbus/controller/rockchip/rk_i2c.c
+++ b/sys/dev/iicbus/controller/rockchip/rk_i2c.c
@@ -665,7 +665,7 @@
goto fail;
}
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return (0);
diff --git a/sys/dev/iicbus/controller/twsi/twsi.c b/sys/dev/iicbus/controller/twsi/twsi.c
--- a/sys/dev/iicbus/controller/twsi/twsi.c
+++ b/sys/dev/iicbus/controller/twsi/twsi.c
@@ -817,7 +817,7 @@
twsi_detach(dev);
return (ENXIO);
}
- bus_generic_attach(dev);
+ bus_attach_children(dev);
config_intrhook_oneshot(twsi_intr_start, dev);
diff --git a/sys/dev/iicbus/controller/vybrid/vf_i2c.c b/sys/dev/iicbus/controller/vybrid/vf_i2c.c
--- a/sys/dev/iicbus/controller/vybrid/vf_i2c.c
+++ b/sys/dev/iicbus/controller/vybrid/vf_i2c.c
@@ -193,7 +193,7 @@
return (ENXIO);
}
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return (0);
}
diff --git a/sys/dev/iicbus/iicbb.c b/sys/dev/iicbus/iicbb.c
--- a/sys/dev/iicbus/iicbb.c
+++ b/sys/dev/iicbus/iicbb.c
@@ -164,7 +164,7 @@
"io_latency", CTLFLAG_RWTUN, &sc->io_latency,
0, "Estimate of pin toggling latency, microseconds");
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return (0);
}
diff --git a/sys/dev/iicbus/iicbus.c b/sys/dev/iicbus/iicbus.c
--- a/sys/dev/iicbus/iicbus.c
+++ b/sys/dev/iicbus/iicbus.c
@@ -127,7 +127,7 @@
#endif
bus_identify_children(dev);
bus_enumerate_hinted_children(dev);
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return (0);
}
diff --git a/sys/dev/iicbus/iichid.c b/sys/dev/iicbus/iichid.c
--- a/sys/dev/iicbus/iichid.c
+++ b/sys/dev/iicbus/iichid.c
@@ -1199,11 +1199,8 @@
}
device_set_ivars(child, &sc->hw);
- error = bus_generic_attach(dev);
- if (error) {
- device_printf(dev, "failed to attach child: error %d\n", error);
- iichid_detach(dev);
- }
+ bus_attach_children(dev);
+ error = 0;
done:
iicbus_request_bus(device_get_parent(dev), dev, IIC_WAIT);
if (!sc->open) {
diff --git a/sys/dev/iicbus/iicsmb.c b/sys/dev/iicbus/iicsmb.c
--- a/sys/dev/iicbus/iicsmb.c
+++ b/sys/dev/iicbus/iicsmb.c
@@ -155,7 +155,7 @@
sc->smbus = device_add_child(dev, "smbus", DEVICE_UNIT_ANY);
/* probe and attach the smbus */
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return (0);
}
diff --git a/sys/dev/iicbus/mux/iic_gpiomux.c b/sys/dev/iicbus/mux/iic_gpiomux.c
--- a/sys/dev/iicbus/mux/iic_gpiomux.c
+++ b/sys/dev/iicbus/mux/iic_gpiomux.c
@@ -212,7 +212,7 @@
/* Init the core driver, have it add our child downstream buses. */
if ((err = iicmux_attach(dev, busdev, numchannels)) == 0)
- bus_generic_attach(dev);
+ bus_attach_children(dev);
errexit:
diff --git a/sys/dev/iicbus/mux/ltc430x.c b/sys/dev/iicbus/mux/ltc430x.c
--- a/sys/dev/iicbus/mux/ltc430x.c
+++ b/sys/dev/iicbus/mux/ltc430x.c
@@ -211,7 +211,7 @@
* the probe and attach code of any child iicbus instances it added.
*/
if ((err = iicmux_attach(dev, device_get_parent(dev), numchan)) == 0)
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return (err);
}
diff --git a/sys/dev/iicbus/mux/pca9547.c b/sys/dev/iicbus/mux/pca9547.c
--- a/sys/dev/iicbus/mux/pca9547.c
+++ b/sys/dev/iicbus/mux/pca9547.c
@@ -120,7 +120,7 @@
rv = iicmux_attach(sc->dev, device_get_parent(dev), 8);
if (rv != 0)
return (rv);
- rv = bus_generic_attach(dev);
+ bus_attach_children(dev);
return (rv);
}
diff --git a/sys/dev/iicbus/mux/pca954x.c b/sys/dev/iicbus/mux/pca954x.c
--- a/sys/dev/iicbus/mux/pca954x.c
+++ b/sys/dev/iicbus/mux/pca954x.c
@@ -214,7 +214,7 @@
sc->descr = descr = pca954x_find_chip(dev);
error = iicmux_attach(dev, device_get_parent(dev), descr->numchannels);
if (error == 0)
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return (error);
}
diff --git a/sys/dev/iicbus/ofw_iicbus.c b/sys/dev/iicbus/ofw_iicbus.c
--- a/sys/dev/iicbus/ofw_iicbus.c
+++ b/sys/dev/iicbus/ofw_iicbus.c
@@ -194,7 +194,8 @@
/* Register bus */
OF_device_register_xref(OF_xref_from_node(node), dev);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static device_t
diff --git a/sys/dev/iicbus/pmic/act8846.c b/sys/dev/iicbus/pmic/act8846.c
--- a/sys/dev/iicbus/pmic/act8846.c
+++ b/sys/dev/iicbus/pmic/act8846.c
@@ -215,7 +215,8 @@
if (rv != 0)
goto fail;
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
fail:
LOCK_DESTROY(sc);
diff --git a/sys/dev/imcsmb/imcsmb.c b/sys/dev/imcsmb/imcsmb.c
--- a/sys/dev/imcsmb/imcsmb.c
+++ b/sys/dev/imcsmb/imcsmb.c
@@ -99,9 +99,8 @@
}
/* Attach the smbus child. */
- if ((rc = bus_generic_attach(dev)) != 0) {
- device_printf(dev, "Failed to attach smbus: %d\n", rc);
- }
+ bus_attach_children(dev);
+ rc = 0;
out:
return (rc);
diff --git a/sys/dev/imcsmb/imcsmb_pci.c b/sys/dev/imcsmb/imcsmb_pci.c
--- a/sys/dev/imcsmb/imcsmb_pci.c
+++ b/sys/dev/imcsmb/imcsmb_pci.c
@@ -188,10 +188,8 @@
}
/* Attach the imcsmbX children. */
- if ((rc = bus_generic_attach(dev)) != 0) {
- device_printf(dev, "failed to attach children: %d\n", rc);
- goto out;
- }
+ bus_attach_children(dev);
+ rc = 0;
out:
return (rc);
diff --git a/sys/dev/ips/ips.c b/sys/dev/ips/ips.c
--- a/sys/dev/ips/ips.c
+++ b/sys/dev/ips/ips.c
@@ -273,9 +273,7 @@
device_set_ivars(sc->diskdev[i],(void *)(uintptr_t) i);
}
}
- if(bus_generic_attach(sc->dev)){
- device_printf(sc->dev, "Attaching bus failed\n");
- }
+ bus_attach_children(sc->dev);
return 0;
}
diff --git a/sys/dev/ismt/ismt.c b/sys/dev/ismt/ismt.c
--- a/sys/dev/ismt/ismt.c
+++ b/sys/dev/ismt/ismt.c
@@ -607,11 +607,7 @@
sc->mmio_handle = rman_get_bushandle(sc->mmio_res);
/* Attach "smbus" child */
- if ((err = bus_generic_attach(dev)) != 0) {
- device_printf(dev, "failed to attach child: %d\n", err);
- err = ENXIO;
- goto fail;
- }
+ bus_attach_children(dev);
bus_dma_tag_create(bus_get_dma_tag(dev), 4, PAGE_SIZE,
BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL,
diff --git a/sys/dev/mdio/mdio.c b/sys/dev/mdio/mdio.c
--- a/sys/dev/mdio/mdio.c
+++ b/sys/dev/mdio/mdio.c
@@ -56,7 +56,8 @@
bus_identify_children(dev);
bus_enumerate_hinted_children(dev);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
diff --git a/sys/dev/mfi/mfi.c b/sys/dev/mfi/mfi.c
--- a/sys/dev/mfi/mfi.c
+++ b/sys/dev/mfi/mfi.c
@@ -776,7 +776,7 @@
"Don't detach the mfid device for a busy volume that is deleted");
device_add_child(sc->mfi_dev, "mfip", DEVICE_UNIT_ANY);
- bus_generic_attach(sc->mfi_dev);
+ bus_attach_children(sc->mfi_dev);
/* Start the timeout watchdog */
callout_init(&sc->mfi_watchdog_callout, 1);
@@ -1932,7 +1932,7 @@
device_set_ivars(child, ld_info);
device_set_desc(child, "MFI Logical Disk");
- bus_generic_attach(sc->mfi_dev);
+ bus_attach_children(sc->mfi_dev);
bus_topo_unlock();
mtx_lock(&sc->mfi_io_lock);
}
@@ -2020,7 +2020,7 @@
device_set_ivars(child, pd_info);
device_set_desc(child, "MFI System PD");
- bus_generic_attach(sc->mfi_dev);
+ bus_attach_children(sc->mfi_dev);
bus_topo_unlock();
mtx_lock(&sc->mfi_io_lock);
}
diff --git a/sys/dev/mge/if_mge.c b/sys/dev/mge/if_mge.c
--- a/sys/dev/mge/if_mge.c
+++ b/sys/dev/mge/if_mge.c
@@ -919,7 +919,7 @@
if (sc->switch_attached) {
MGE_WRITE(sc, MGE_REG_PHYDEV, MGE_SWITCH_PHYDEV);
device_add_child(dev, "mdio", DEVICE_UNIT_ANY);
- bus_generic_attach(dev);
+ bus_attach_children(dev);
}
return (0);
diff --git a/sys/dev/mii/mii.c b/sys/dev/mii/mii.c
--- a/sys/dev/mii/mii.c
+++ b/sys/dev/mii/mii.c
@@ -147,7 +147,8 @@
if_setcapenablebit(mii->mii_ifp, IFCAP_LINKSTATE, 0);
LIST_INIT(&mii->mii_phys);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
@@ -520,16 +521,12 @@
rv = ENXIO;
goto fail;
}
- rv = bus_generic_attach(dev);
- if (rv != 0)
- goto fail;
+ bus_attach_children(dev);
/* Attaching of the PHY drivers is done in miibus_attach(). */
return (0);
}
- rv = bus_generic_attach(*miibus);
- if (rv != 0)
- goto fail;
+ bus_attach_children(*miibus);
return (0);
diff --git a/sys/dev/mlx/mlx.c b/sys/dev/mlx/mlx.c
--- a/sys/dev/mlx/mlx.c
+++ b/sys/dev/mlx/mlx.c
@@ -522,7 +522,7 @@
{
struct mlx_enq_sys_drive *mes;
struct mlx_sysdrive *dr;
- int i, error;
+ int i;
debug_called(1);
@@ -567,8 +567,7 @@
}
}
free(mes, M_DEVBUF);
- if ((error = bus_generic_attach(sc->mlx_dev)) != 0)
- device_printf(sc->mlx_dev, "bus_generic_attach returned %d", error);
+ bus_attach_children(sc->mlx_dev);
/* mark controller back up */
MLX_IO_LOCK(sc);
diff --git a/sys/dev/mmc/mmc.c b/sys/dev/mmc/mmc.c
--- a/sys/dev/mmc/mmc.c
+++ b/sys/dev/mmc/mmc.c
@@ -2457,7 +2457,7 @@
device_printf(dev, "Failed to release bus after scanning\n");
return;
}
- (void)bus_generic_attach(dev);
+ bus_attach_children(dev);
}
static int
diff --git a/sys/dev/msk/if_msk.c b/sys/dev/msk/if_msk.c
--- a/sys/dev/msk/if_msk.c
+++ b/sys/dev/msk/if_msk.c
@@ -1972,11 +1972,7 @@
device_set_ivars(sc->msk_devs[MSK_PORT_B], mmd);
}
- error = bus_generic_attach(dev);
- if (error) {
- device_printf(dev, "failed to attach port(s)\n");
- goto fail;
- }
+ bus_attach_children(dev);
/* Hook interrupt last to avoid having to lock softc. */
error = bus_setup_intr(dev, sc->msk_irq[0], INTR_TYPE_NET |
diff --git a/sys/dev/mvs/mvs_pci.c b/sys/dev/mvs/mvs_pci.c
--- a/sys/dev/mvs/mvs_pci.c
+++ b/sys/dev/mvs/mvs_pci.c
@@ -168,7 +168,7 @@
else
device_set_ivars(child, (void *)(intptr_t)unit);
}
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return 0;
}
diff --git a/sys/dev/mvs/mvs_soc.c b/sys/dev/mvs/mvs_soc.c
--- a/sys/dev/mvs/mvs_soc.c
+++ b/sys/dev/mvs/mvs_soc.c
@@ -172,7 +172,7 @@
else
device_set_ivars(child, (void *)(intptr_t)unit);
}
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return 0;
}
diff --git a/sys/dev/neta/if_mvneta.c b/sys/dev/neta/if_mvneta.c
--- a/sys/dev/neta/if_mvneta.c
+++ b/sys/dev/neta/if_mvneta.c
@@ -807,8 +807,8 @@
mvneta_detach(self);
return (ENXIO);
}
- bus_generic_attach(sc->dev);
- bus_generic_attach(child);
+ bus_attach_children(sc->dev);
+ bus_attach_children(child);
}
/* Configure MAC media */
diff --git a/sys/dev/nfsmb/nfsmb.c b/sys/dev/nfsmb/nfsmb.c
--- a/sys/dev/nfsmb/nfsmb.c
+++ b/sys/dev/nfsmb/nfsmb.c
@@ -202,7 +202,7 @@
return (EINVAL);
}
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return (0);
}
@@ -265,7 +265,7 @@
break;
}
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return (0);
}
diff --git a/sys/dev/ntb/ntb.c b/sys/dev/ntb/ntb.c
--- a/sys/dev/ntb/ntb.c
+++ b/sys/dev/ntb/ntb.c
@@ -142,7 +142,7 @@
i++;
}
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return (0);
}
diff --git a/sys/dev/ntb/ntb_transport.c b/sys/dev/ntb/ntb_transport.c
--- a/sys/dev/ntb/ntb_transport.c
+++ b/sys/dev/ntb/ntb_transport.c
@@ -511,7 +511,7 @@
if (enable_xeon_watchdog != 0)
callout_reset(&nt->link_watchdog, 0, xeon_link_watchdog_hb, nt);
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return (0);
err:
diff --git a/sys/dev/nvdimm/nvdimm_acpi.c b/sys/dev/nvdimm/nvdimm_acpi.c
--- a/sys/dev/nvdimm/nvdimm_acpi.c
+++ b/sys/dev/nvdimm/nvdimm_acpi.c
@@ -188,9 +188,7 @@
error = nvdimm_root_create_devs(dev, nfitbl);
if (error != 0)
return (error);
- error = bus_generic_attach(dev);
- if (error != 0)
- return (error);
+ bus_attach_children(dev);
root = device_get_softc(dev);
error = nvdimm_root_create_spas(root, nfitbl);
AcpiPutTable(&nfitbl->Header);
diff --git a/sys/dev/ofw/ofw_cpu.c b/sys/dev/ofw/ofw_cpu.c
--- a/sys/dev/ofw/ofw_cpu.c
+++ b/sys/dev/ofw/ofw_cpu.c
@@ -134,7 +134,8 @@
device_set_ivars(cdev, dinfo);
}
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static const struct ofw_bus_devinfo *
@@ -298,7 +299,8 @@
device_printf(dev, "Nominal frequency %dMhz\n",
sc->sc_nominal_mhz);
bus_identify_children(dev);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
diff --git a/sys/dev/ofw/ofw_firmware.c b/sys/dev/ofw/ofw_firmware.c
--- a/sys/dev/ofw/ofw_firmware.c
+++ b/sys/dev/ofw/ofw_firmware.c
@@ -150,7 +150,8 @@
device_probe_and_attach(cdev);
}
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static device_method_t ofw_firmware_methods[] = {
diff --git a/sys/dev/ofw/ofw_pcib.c b/sys/dev/ofw/ofw_pcib.c
--- a/sys/dev/ofw/ofw_pcib.c
+++ b/sys/dev/ofw/ofw_pcib.c
@@ -303,7 +303,8 @@
}
device_add_child(dev, "pci", DEVICE_UNIT_ANY);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
diff --git a/sys/dev/ofw/ofwbus.c b/sys/dev/ofw/ofwbus.c
--- a/sys/dev/ofw/ofwbus.c
+++ b/sys/dev/ofw/ofwbus.c
@@ -125,7 +125,8 @@
for (node = OF_child(node); node > 0; node = OF_peer(node))
simplebus_add_device(dev, node, 0, NULL, -1, NULL);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static struct resource *
diff --git a/sys/dev/ow/ow.c b/sys/dev/ow/ow.c
--- a/sys/dev/ow/ow.c
+++ b/sys/dev/ow/ow.c
@@ -558,7 +558,8 @@
sc->dev = ndev;
mtx_init(&sc->mtx, device_get_nameunit(sc->dev), "ow", MTX_DEF);
ow_enumerate(ndev, ow_search_rom, ow_device_found);
- return bus_generic_attach(ndev);
+ bus_attach_children(ndev);
+ return (0);
}
static int
diff --git a/sys/dev/p2sb/lewisburg_gpiocm.c b/sys/dev/p2sb/lewisburg_gpiocm.c
--- a/sys/dev/p2sb/lewisburg_gpiocm.c
+++ b/sys/dev/p2sb/lewisburg_gpiocm.c
@@ -318,7 +318,8 @@
group->dev = device_add_child(dev, "gpio", -1);
}
sc->community->ngroups = i;
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
diff --git a/sys/dev/p2sb/p2sb.c b/sys/dev/p2sb/p2sb.c
--- a/sys/dev/p2sb/p2sb.c
+++ b/sys/dev/p2sb/p2sb.c
@@ -149,7 +149,8 @@
for (i = 0; i < nitems(lbg_communities); ++i)
device_add_child(dev, "lbggpiocm", i);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
/* Detach device. */
diff --git a/sys/dev/pcf/pcf_isa.c b/sys/dev/pcf/pcf_isa.c
--- a/sys/dev/pcf/pcf_isa.c
+++ b/sys/dev/pcf/pcf_isa.c
@@ -164,7 +164,7 @@
device_printf(dev, "could not allocate iicbus instance\n");
/* probe and attach the iicbus */
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return (0);
diff --git a/sys/dev/pci/controller/pci_n1sdp.c b/sys/dev/pci/controller/pci_n1sdp.c
--- a/sys/dev/pci/controller/pci_n1sdp.c
+++ b/sys/dev/pci/controller/pci_n1sdp.c
@@ -223,7 +223,8 @@
return (err);
device_add_child(dev, "pci", DEVICE_UNIT_ANY);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
diff --git a/sys/dev/pci/hostb_pci.c b/sys/dev/pci/hostb_pci.c
--- a/sys/dev/pci/hostb_pci.c
+++ b/sys/dev/pci/hostb_pci.c
@@ -77,7 +77,7 @@
*/
if (pci_find_cap(dev, PCIY_AGP, NULL) == 0)
device_add_child(dev, "agp", DEVICE_UNIT_ANY);
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return (0);
}
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c
--- a/sys/dev/pci/pci.c
+++ b/sys/dev/pci/pci.c
@@ -4495,7 +4495,8 @@
domain = pcib_get_domain(dev);
busno = pcib_get_bus(dev);
pci_add_children(dev, domain, busno);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
int
diff --git a/sys/dev/pci/pci_dw_mv.c b/sys/dev/pci/pci_dw_mv.c
--- a/sys/dev/pci/pci_dw_mv.c
+++ b/sys/dev/pci/pci_dw_mv.c
@@ -306,7 +306,8 @@
goto out;
}
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
out:
/* XXX Cleanup */
return (rv);
diff --git a/sys/dev/pci/pci_host_generic_acpi.c b/sys/dev/pci/pci_host_generic_acpi.c
--- a/sys/dev/pci/pci_host_generic_acpi.c
+++ b/sys/dev/pci/pci_host_generic_acpi.c
@@ -336,7 +336,8 @@
return (error);
device_add_child(dev, "pci", DEVICE_UNIT_ANY);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
diff --git a/sys/dev/pci/pci_host_generic_den0115.c b/sys/dev/pci/pci_host_generic_den0115.c
--- a/sys/dev/pci/pci_host_generic_den0115.c
+++ b/sys/dev/pci/pci_host_generic_den0115.c
@@ -194,7 +194,8 @@
}
device_add_child(dev, "pci", -1);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static uint32_t
diff --git a/sys/dev/pci/pci_host_generic_fdt.c b/sys/dev/pci/pci_host_generic_fdt.c
--- a/sys/dev/pci/pci_host_generic_fdt.c
+++ b/sys/dev/pci/pci_host_generic_fdt.c
@@ -171,7 +171,8 @@
return (error);
device_add_child(dev, "pci", DEVICE_UNIT_ANY);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
diff --git a/sys/dev/pci/pci_iov.c b/sys/dev/pci/pci_iov.c
--- a/sys/dev/pci/pci_iov.c
+++ b/sys/dev/pci/pci_iov.c
@@ -670,7 +670,7 @@
}
}
- bus_generic_attach(bus);
+ bus_attach_children(bus);
}
static int
diff --git a/sys/dev/pci/pci_pci.c b/sys/dev/pci/pci_pci.c
--- a/sys/dev/pci/pci_pci.c
+++ b/sys/dev/pci/pci_pci.c
@@ -1114,7 +1114,7 @@
if (pcib_hotplug_present(sc) != 0) {
if (sc->child == NULL) {
sc->child = device_add_child(dev, "pci", DEVICE_UNIT_ANY);
- bus_generic_attach(dev);
+ bus_attach_children(dev);
}
} else {
if (sc->child != NULL) {
@@ -1533,7 +1533,8 @@
#endif
sc->child = device_add_child(dev, "pci", DEVICE_UNIT_ANY);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
int
diff --git a/sys/dev/pci/vga_pci.c b/sys/dev/pci/vga_pci.c
--- a/sys/dev/pci/vga_pci.c
+++ b/sys/dev/pci/vga_pci.c
@@ -370,7 +370,7 @@
/* Always create a drmn child for now to make it easier on drm. */
device_add_child(dev, "drmn", DEVICE_UNIT_ANY);
- bus_generic_attach(dev);
+ bus_attach_children(dev);
if (vga_pci_is_boot_display(dev))
device_printf(dev, "Boot video device\n");
diff --git a/sys/dev/ppbus/ppbconf.c b/sys/dev/ppbus/ppbconf.c
--- a/sys/dev/ppbus/ppbconf.c
+++ b/sys/dev/ppbus/ppbconf.c
@@ -414,7 +414,7 @@
#endif /* !DONTPROBE_1284 */
/* launch attachment of the added children */
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return (0);
}
diff --git a/sys/dev/psci/psci.c b/sys/dev/psci/psci.c
--- a/sys/dev/psci/psci.c
+++ b/sys/dev/psci/psci.c
@@ -350,7 +350,7 @@
if (sc->smccc_dev == NULL)
device_printf(dev, "Unable to add SMCCC device\n");
- bus_generic_attach(dev);
+ bus_attach_children(dev);
#endif
return (0);
diff --git a/sys/dev/psci/smccc.c b/sys/dev/psci/smccc.c
--- a/sys/dev/psci/smccc.c
+++ b/sys/dev/psci/smccc.c
@@ -91,7 +91,8 @@
static int
smccc_attach(device_t dev)
{
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
uint32_t
diff --git a/sys/dev/pst/pst-pci.c b/sys/dev/pst/pst-pci.c
--- a/sys/dev/pst/pst-pci.c
+++ b/sys/dev/pst/pst-pci.c
@@ -94,7 +94,8 @@
if (!iop_init(sc))
return 0;
- return bus_generic_attach(dev);
+ bus_attach_children(dev);
+ return (0);
}
static int
diff --git a/sys/dev/pwm/controller/allwinner/aw_pwm.c b/sys/dev/pwm/controller/allwinner/aw_pwm.c
--- a/sys/dev/pwm/controller/allwinner/aw_pwm.c
+++ b/sys/dev/pwm/controller/allwinner/aw_pwm.c
@@ -190,7 +190,8 @@
sc->busdev = device_add_child(dev, "pwmbus", DEVICE_UNIT_ANY);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
fail:
aw_pwm_detach(dev);
diff --git a/sys/dev/pwm/controller/rockchip/rk_pwm.c b/sys/dev/pwm/controller/rockchip/rk_pwm.c
--- a/sys/dev/pwm/controller/rockchip/rk_pwm.c
+++ b/sys/dev/pwm/controller/rockchip/rk_pwm.c
@@ -214,7 +214,8 @@
sc->busdev = device_add_child(dev, "pwmbus", DEVICE_UNIT_ANY);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
fail:
rk_pwm_detach(dev);
diff --git a/sys/dev/pwm/ofw_pwmbus.c b/sys/dev/pwm/ofw_pwmbus.c
--- a/sys/dev/pwm/ofw_pwmbus.c
+++ b/sys/dev/pwm/ofw_pwmbus.c
@@ -185,8 +185,9 @@
}
bus_enumerate_hinted_children(dev);
bus_identify_children(dev);
+ bus_attach_children(dev);
- return (bus_generic_attach(dev));
+ return (0);
}
static device_method_t ofw_pwmbus_methods[] = {
diff --git a/sys/dev/pwm/pwmbus.c b/sys/dev/pwm/pwmbus.c
--- a/sys/dev/pwm/pwmbus.c
+++ b/sys/dev/pwm/pwmbus.c
@@ -183,8 +183,9 @@
bus_enumerate_hinted_children(dev);
bus_identify_children(dev);
+ bus_attach_children(dev);
- return (bus_generic_attach(dev));
+ return (0);
}
static int
diff --git a/sys/dev/qcom_dwc3/qcom_dwc3.c b/sys/dev/qcom_dwc3/qcom_dwc3.c
--- a/sys/dev/qcom_dwc3/qcom_dwc3.c
+++ b/sys/dev/qcom_dwc3/qcom_dwc3.c
@@ -156,7 +156,8 @@
device_probe_and_attach(cdev);
}
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static device_method_t qcom_dwc3_methods[] = {
diff --git a/sys/dev/qcom_qup/qcom_spi.c b/sys/dev/qcom_qup/qcom_spi.c
--- a/sys/dev/qcom_qup/qcom_spi.c
+++ b/sys/dev/qcom_qup/qcom_spi.c
@@ -429,7 +429,8 @@
/* Register for debug sysctl */
qcom_spi_sysctl_attach(sc);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
error:
if (sc->sc_irq_h)
bus_teardown_intr(dev, sc->sc_irq_res, sc->sc_irq_h);
diff --git a/sys/dev/regulator/regulator_bus.c b/sys/dev/regulator/regulator_bus.c
--- a/sys/dev/regulator/regulator_bus.c
+++ b/sys/dev/regulator/regulator_bus.c
@@ -64,7 +64,8 @@
simplebus_add_device(dev, child, 0, NULL, -1, NULL);
}
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static device_method_t ofw_regulator_bus_methods[] = {
diff --git a/sys/dev/regulator/regulator_fixed.c b/sys/dev/regulator/regulator_fixed.c
--- a/sys/dev/regulator/regulator_fixed.c
+++ b/sys/dev/regulator/regulator_fixed.c
@@ -485,14 +485,17 @@
/* Try to get and configure GPIO. */
rv = regfix_get_gpio(sc);
- if (rv != 0)
- return (bus_generic_attach(dev));
+ if (rv != 0) {
+ bus_attach_children(dev);
+ return (0);
+ }
/* Register regulator. */
regnode_fixed_register(sc->dev, &sc->init_def);
sc->attach_done = true;
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static device_method_t regfix_methods[] = {
diff --git a/sys/dev/sdhci/fsl_sdhci.c b/sys/dev/sdhci/fsl_sdhci.c
--- a/sys/dev/sdhci/fsl_sdhci.c
+++ b/sys/dev/sdhci/fsl_sdhci.c
@@ -926,7 +926,7 @@
sc->slot_init_done = true;
bus_identify_children(dev);
- bus_generic_attach(dev);
+ bus_attach_children(dev);
sdhci_start_slot(&sc->slot);
diff --git a/sys/dev/sdhci/sdhci_fsl_fdt.c b/sys/dev/sdhci/sdhci_fsl_fdt.c
--- a/sys/dev/sdhci/sdhci_fsl_fdt.c
+++ b/sys/dev/sdhci/sdhci_fsl_fdt.c
@@ -995,7 +995,8 @@
sc->slot_init_done = true;
sdhci_start_slot(&sc->slot);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
err_free_gpio:
sdhci_fdt_gpio_teardown(sc->gpio);
diff --git a/sys/dev/siis/siis.c b/sys/dev/siis/siis.c
--- a/sys/dev/siis/siis.c
+++ b/sys/dev/siis/siis.c
@@ -195,7 +195,7 @@
else
device_set_ivars(child, (void *)(intptr_t)unit);
}
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return 0;
}
diff --git a/sys/dev/sk/if_sk.c b/sys/dev/sk/if_sk.c
--- a/sys/dev/sk/if_sk.c
+++ b/sys/dev/sk/if_sk.c
@@ -1718,11 +1718,7 @@
/* Turn on the 'driver is loaded' LED. */
CSR_WRITE_2(sc, SK_LED, SK_LED_GREEN_ON);
- error = bus_generic_attach(dev);
- if (error) {
- device_printf(dev, "failed to attach port(s)\n");
- goto fail;
- }
+ bus_attach_children(dev);
/* Hook interrupt last to avoid having to lock softc */
error = bus_setup_intr(dev, sc->sk_res[1], INTR_TYPE_NET|INTR_MPSAFE,
diff --git a/sys/dev/smbus/smbus.c b/sys/dev/smbus/smbus.c
--- a/sys/dev/smbus/smbus.c
+++ b/sys/dev/smbus/smbus.c
@@ -69,7 +69,7 @@
mtx_init(&sc->lock, device_get_nameunit(dev), "smbus", MTX_DEF);
bus_identify_children(dev);
bus_enumerate_hinted_children(dev);
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return (0);
}
diff --git a/sys/dev/sound/pci/csa.c b/sys/dev/sound/pci/csa.c
--- a/sys/dev/sound/pci/csa.c
+++ b/sys/dev/sound/pci/csa.c
@@ -286,7 +286,7 @@
scp->midi = device_add_child(dev, "midi", DEVICE_UNIT_ANY);
device_set_ivars(scp->midi, func);
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return (0);
diff --git a/sys/dev/sound/pci/emu10kx.c b/sys/dev/sound/pci/emu10kx.c
--- a/sys/dev/sound/pci/emu10kx.c
+++ b/sys/dev/sound/pci/emu10kx.c
@@ -3318,7 +3318,8 @@
device_set_ivars(sc->midi[1], func);
}
#endif
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
bad:
/* XXX can we just call emu_pci_detach here? */
diff --git a/sys/dev/sound/pci/fm801.c b/sys/dev/sound/pci/fm801.c
--- a/sys/dev/sound/pci/fm801.c
+++ b/sys/dev/sound/pci/fm801.c
@@ -649,7 +649,7 @@
goto oops;
fm801->radio = device_add_child(dev, "radio", DEVICE_UNIT_ANY);
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return 0;
diff --git a/sys/dev/sound/pci/hda/hdaa.c b/sys/dev/sound/pci/hda/hdaa.c
--- a/sys/dev/sound/pci/hda/hdaa.c
+++ b/sys/dev/sound/pci/hda/hdaa.c
@@ -6468,7 +6468,7 @@
hdaa_unconfigure(dev);
hdaa_configure(dev);
hdaa_unlock(devinfo);
- bus_generic_attach(dev);
+ bus_attach_children(dev);
HDA_BOOTHVERBOSE(
device_printf(dev, "Reconfiguration done\n");
);
@@ -6674,7 +6674,7 @@
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
"init_clear", CTLFLAG_RW,
&devinfo->init_clear, 1,"Clear initial pin widget configuration");
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return (0);
}
diff --git a/sys/dev/sound/pci/hda/hdac.c b/sys/dev/sound/pci/hda/hdac.c
--- a/sys/dev/sound/pci/hda/hdac.c
+++ b/sys/dev/sound/pci/hda/hdac.c
@@ -1625,7 +1625,7 @@
sc->codecs[i].dev = child;
}
}
- bus_generic_attach(sc->dev);
+ bus_attach_children(sc->dev);
SYSCTL_ADD_PROC(device_get_sysctl_ctx(sc->dev),
SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)), OID_AUTO,
diff --git a/sys/dev/sound/pci/hda/hdacc.c b/sys/dev/sound/pci/hda/hdacc.c
--- a/sys/dev/sound/pci/hda/hdacc.c
+++ b/sys/dev/sound/pci/hda/hdacc.c
@@ -530,7 +530,7 @@
device_set_ivars(child, &codec->fgs[n]);
}
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return (0);
}
diff --git a/sys/dev/sound/pci/hdsp.c b/sys/dev/sound/pci/hdsp.c
--- a/sys/dev/sound/pci/hdsp.c
+++ b/sys/dev/sound/pci/hdsp.c
@@ -952,7 +952,8 @@
"Analog input level ('LowGain', '+4dBU', '-10dBV')");
}
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static void
diff --git a/sys/dev/sound/pci/hdspe.c b/sys/dev/sound/pci/hdspe.c
--- a/sys/dev/sound/pci/hdspe.c
+++ b/sys/dev/sound/pci/hdspe.c
@@ -623,7 +623,8 @@
sc, 0, hdspe_sysctl_sample_rate, "A",
"Force sample rate (32000, 44100, 48000, ... 192000)");
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static void
diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c
--- a/sys/dev/sound/usb/uaudio.c
+++ b/sys/dev/sound/usb/uaudio.c
@@ -1135,10 +1135,7 @@
&sc->sc_sndcard_func);
}
- if (bus_generic_attach(dev)) {
- DPRINTF("child attach failed\n");
- goto detach;
- }
+ bus_attach_children(dev);
if (uaudio_handle_hid) {
if (uaudio_hid_probe(sc, uaa) == 0) {
diff --git a/sys/dev/spibus/controller/allwinner/aw_spi.c b/sys/dev/spibus/controller/allwinner/aw_spi.c
--- a/sys/dev/spibus/controller/allwinner/aw_spi.c
+++ b/sys/dev/spibus/controller/allwinner/aw_spi.c
@@ -237,7 +237,8 @@
sc->spibus = device_add_child(dev, "spibus", DEVICE_UNIT_ANY);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
fail:
aw_spi_detach(dev);
diff --git a/sys/dev/spibus/controller/rockchip/rk_spi.c b/sys/dev/spibus/controller/rockchip/rk_spi.c
--- a/sys/dev/spibus/controller/rockchip/rk_spi.c
+++ b/sys/dev/spibus/controller/rockchip/rk_spi.c
@@ -338,7 +338,8 @@
RK_SPI_WRITE_4(sc, RK_SPI_TXFTLR, sc->fifo_size/2 - 1);
RK_SPI_WRITE_4(sc, RK_SPI_RXFTLR, sc->fifo_size/2 - 1);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
fail:
rk_spi_detach(dev);
diff --git a/sys/dev/spibus/ofw_spibus.c b/sys/dev/spibus/ofw_spibus.c
--- a/sys/dev/spibus/ofw_spibus.c
+++ b/sys/dev/spibus/ofw_spibus.c
@@ -156,7 +156,8 @@
device_set_ivars(childdev, dinfo);
}
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static device_t
diff --git a/sys/dev/spibus/spibus.c b/sys/dev/spibus/spibus.c
--- a/sys/dev/spibus/spibus.c
+++ b/sys/dev/spibus/spibus.c
@@ -57,7 +57,8 @@
sc->dev = dev;
bus_enumerate_hinted_children(dev);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
/*
diff --git a/sys/dev/sram/mmio_sram.c b/sys/dev/sram/mmio_sram.c
--- a/sys/dev/sram/mmio_sram.c
+++ b/sys/dev/sram/mmio_sram.c
@@ -102,7 +102,8 @@
for (node = OF_child(node); node > 0; node = OF_peer(node))
simplebus_add_device(dev, node, 0, NULL, -1, NULL);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
diff --git a/sys/dev/superio/superio.c b/sys/dev/superio/superio.c
--- a/sys/dev/superio/superio.c
+++ b/sys/dev/superio/superio.c
@@ -718,7 +718,7 @@
}
bus_identify_children(dev);
- bus_generic_attach(dev);
+ bus_attach_children(dev);
sc->chardev = make_dev(&superio_cdevsw, device_get_unit(dev),
UID_ROOT, GID_WHEEL, 0600, "superio%d", device_get_unit(dev));
diff --git a/sys/dev/syscon/syscon_generic.c b/sys/dev/syscon/syscon_generic.c
--- a/sys/dev/syscon/syscon_generic.c
+++ b/sys/dev/syscon/syscon_generic.c
@@ -194,7 +194,8 @@
sc->simplebus_attached = true;
}
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
diff --git a/sys/dev/usb/controller/dwc3/aw_dwc3.c b/sys/dev/usb/controller/dwc3/aw_dwc3.c
--- a/sys/dev/usb/controller/dwc3/aw_dwc3.c
+++ b/sys/dev/usb/controller/dwc3/aw_dwc3.c
@@ -125,7 +125,8 @@
device_probe_and_attach(cdev);
}
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static device_method_t aw_dwc3_methods[] = {
diff --git a/sys/dev/usb/controller/dwc3/rk_dwc3.c b/sys/dev/usb/controller/dwc3/rk_dwc3.c
--- a/sys/dev/usb/controller/dwc3/rk_dwc3.c
+++ b/sys/dev/usb/controller/dwc3/rk_dwc3.c
@@ -182,7 +182,8 @@
device_probe_and_attach(cdev);
}
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static device_method_t rk_dwc3_methods[] = {
diff --git a/sys/dev/usb/controller/xlnx_dwc3.c b/sys/dev/usb/controller/xlnx_dwc3.c
--- a/sys/dev/usb/controller/xlnx_dwc3.c
+++ b/sys/dev/usb/controller/xlnx_dwc3.c
@@ -133,7 +133,8 @@
device_probe_and_attach(cdev);
}
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static device_method_t xlnx_dwc3_methods[] = {
diff --git a/sys/dev/usb/input/usbhid.c b/sys/dev/usb/input/usbhid.c
--- a/sys/dev/usb/input/usbhid.c
+++ b/sys/dev/usb/input/usbhid.c
@@ -842,12 +842,7 @@
}
device_set_ivars(child, &sc->sc_hw);
- error = bus_generic_attach(dev);
- if (error) {
- device_printf(dev, "failed to attach child: %d\n", error);
- usbhid_detach(dev);
- return (error);
- }
+ bus_attach_children(dev);
return (0); /* success */
}
diff --git a/sys/dev/usb/misc/cp2112.c b/sys/dev/usb/misc/cp2112.c
--- a/sys/dev/usb/misc/cp2112.c
+++ b/sys/dev/usb/misc/cp2112.c
@@ -1340,7 +1340,7 @@
err = ENXIO;
goto detach;
}
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return (0);
detach:
diff --git a/sys/dev/usb/misc/i2ctinyusb.c b/sys/dev/usb/misc/i2ctinyusb.c
--- a/sys/dev/usb/misc/i2ctinyusb.c
+++ b/sys/dev/usb/misc/i2ctinyusb.c
@@ -173,7 +173,7 @@
err = ENXIO;
goto detach;
}
- err = bus_generic_attach(dev);
+ bus_attach_children(dev);
return (0);
diff --git a/sys/dev/viapm/viapm.c b/sys/dev/viapm/viapm.c
--- a/sys/dev/viapm/viapm.c
+++ b/sys/dev/viapm/viapm.c
@@ -374,7 +374,7 @@
viapm->smbus = device_add_child(dev, "smbus", DEVICE_UNIT_ANY);
/* probe and attach the smbus */
- bus_generic_attach(dev);
+ bus_attach_children(dev);
/* disable slave function */
VIAPM_OUTB(SMBSCTRL, VIAPM_INB(SMBSCTRL) & ~SMBSCTRL_ENABLE);
@@ -426,7 +426,7 @@
if (!(viapm->iicbb = device_add_child(dev, "iicbb", -1)))
goto error;
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return 0;
diff --git a/sys/dev/vmd/vmd.c b/sys/dev/vmd/vmd.c
--- a/sys/dev/vmd/vmd.c
+++ b/sys/dev/vmd/vmd.c
@@ -384,7 +384,8 @@
sc->vmd_dma_tag = bus_get_dma_tag(dev);
sc->psc.child = device_add_child(dev, "pci", DEVICE_UNIT_ANY);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
fail:
vmd_free(sc);
diff --git a/sys/dev/vnic/mrml_bridge.c b/sys/dev/vnic/mrml_bridge.c
--- a/sys/dev/vnic/mrml_bridge.c
+++ b/sys/dev/vnic/mrml_bridge.c
@@ -108,7 +108,8 @@
if (err != 0)
return (err);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
/* OFW bus interface */
diff --git a/sys/dev/vnic/thunder_mdio_fdt.c b/sys/dev/vnic/thunder_mdio_fdt.c
--- a/sys/dev/vnic/thunder_mdio_fdt.c
+++ b/sys/dev/vnic/thunder_mdio_fdt.c
@@ -167,7 +167,8 @@
if (err != 0)
return (err);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
/* OFW bus interface */
diff --git a/sys/dev/xen/bus/xenpv.c b/sys/dev/xen/bus/xenpv.c
--- a/sys/dev/xen/bus/xenpv.c
+++ b/sys/dev/xen/bus/xenpv.c
@@ -127,10 +127,9 @@
* found.
*/
bus_identify_children(dev);
+ bus_attach_children(dev);
- error = bus_generic_attach(dev);
-
- return (error);
+ return (0);
}
static int
diff --git a/sys/dev/xen/pcifront/pcifront.c b/sys/dev/xen/pcifront/pcifront.c
--- a/sys/dev/xen/pcifront/pcifront.c
+++ b/sys/dev/xen/pcifront/pcifront.c
@@ -502,7 +502,8 @@
}
out:
- return bus_generic_attach(dev);
+ bus_attach_children(dev);
+ return (0);
}
static devclass_t xpcife_devclass;
@@ -559,7 +560,8 @@
DPRINTF("xpcib attach (bus=%d)\n", sc->bus);
device_add_child(dev, "pci", DEVICE_UNIT_ANY);
- return bus_generic_attach(dev);
+ bus_attach_children(dev);
+ return (0);
}
static int
diff --git a/sys/dev/xen/xenstore/xenstore.c b/sys/dev/xen/xenstore/xenstore.c
--- a/sys/dev/xen/xenstore/xenstore.c
+++ b/sys/dev/xen/xenstore/xenstore.c
@@ -1069,7 +1069,7 @@
{
bus_identify_children(xs.xs_dev);
- bus_generic_attach(xs.xs_dev);
+ bus_attach_children(xs.xs_dev);
config_intrhook_disestablish(&xs.xs_attachcb);
}
@@ -1080,7 +1080,7 @@
KASSERT((pending == 1), ("xs late attach queued several times"));
bus_identify_children(xs.xs_dev);
- bus_generic_attach(xs.xs_dev);
+ bus_attach_children(xs.xs_dev);
}
/**
diff --git a/sys/dev/xilinx/axi_quad_spi.c b/sys/dev/xilinx/axi_quad_spi.c
--- a/sys/dev/xilinx/axi_quad_spi.c
+++ b/sys/dev/xilinx/axi_quad_spi.c
@@ -149,7 +149,8 @@
WRITE4(sc, SPI_CR, reg);
device_add_child(dev, "spibus", 0);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
diff --git a/sys/i386/acpica/acpi_machdep.c b/sys/i386/acpica/acpi_machdep.c
--- a/sys/i386/acpica/acpi_machdep.c
+++ b/sys/i386/acpica/acpi_machdep.c
@@ -290,7 +290,8 @@
if (BUS_ADD_CHILD(dev, 10, "acpi", 0) == NULL)
panic("failed to add acpi0 device");
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static device_method_t nexus_acpi_methods[] = {
diff --git a/sys/isa/isa_common.c b/sys/isa/isa_common.c
--- a/sys/isa/isa_common.c
+++ b/sys/isa/isa_common.c
@@ -1115,9 +1115,10 @@
device_t child;
child = device_add_child(dev, "isa", 0);
- if (child != NULL)
- return (bus_generic_attach(dev));
- return (ENXIO);
+ if (child == NULL)
+ return (ENXIO);
+ bus_attach_children(dev);
+ return (0);
}
char *
diff --git a/sys/isa/vga_isa.c b/sys/isa/vga_isa.c
--- a/sys/isa/vga_isa.c
+++ b/sys/isa/vga_isa.c
@@ -191,7 +191,7 @@
#if 0 /* experimental */
device_add_child(dev, "fb", DEVICE_UNIT_ANY);
- bus_generic_attach(dev);
+ bus_attach_children(dev);
#endif
return (0);
@@ -260,7 +260,7 @@
{
bus_identify_children(dev);
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return (0);
}
diff --git a/sys/powerpc/mambo/mambo.c b/sys/powerpc/mambo/mambo.c
--- a/sys/powerpc/mambo/mambo.c
+++ b/sys/powerpc/mambo/mambo.c
@@ -91,5 +91,6 @@
mambobus_attach(device_t dev)
{
bus_identify_children(dev);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
diff --git a/sys/powerpc/mpc85xx/fsl_espi.c b/sys/powerpc/mpc85xx/fsl_espi.c
--- a/sys/powerpc/mpc85xx/fsl_espi.c
+++ b/sys/powerpc/mpc85xx/fsl_espi.c
@@ -195,8 +195,8 @@
FSL_ESPI_WRITE(sc, ESPI_SPIM, 0);
device_add_child(dev, "spibus", DEVICE_UNIT_ANY);
-
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
diff --git a/sys/powerpc/mpc85xx/i2c.c b/sys/powerpc/mpc85xx/i2c.c
--- a/sys/powerpc/mpc85xx/i2c.c
+++ b/sys/powerpc/mpc85xx/i2c.c
@@ -239,7 +239,7 @@
return (ENXIO);
}
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return (IIC_NOERR);
}
static int
diff --git a/sys/powerpc/mpc85xx/lbc.c b/sys/powerpc/mpc85xx/lbc.c
--- a/sys/powerpc/mpc85xx/lbc.c
+++ b/sys/powerpc/mpc85xx/lbc.c
@@ -665,7 +665,8 @@
lbc_banks_enable(sc);
OF_prop_free(rangesptr);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
fail:
OF_prop_free(rangesptr);
diff --git a/sys/powerpc/ofw/ofw_pcibus.c b/sys/powerpc/ofw/ofw_pcibus.c
--- a/sys/powerpc/ofw/ofw_pcibus.c
+++ b/sys/powerpc/ofw/ofw_pcibus.c
@@ -145,7 +145,8 @@
if (!ofw_devices_only)
ofw_pcibus_enum_bus(dev, domain, busno);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
struct pci_devinfo *
diff --git a/sys/powerpc/powermac/cuda.c b/sys/powerpc/powermac/cuda.c
--- a/sys/powerpc/powermac/cuda.c
+++ b/sys/powerpc/powermac/cuda.c
@@ -254,7 +254,8 @@
EVENTHANDLER_REGISTER(shutdown_final, cuda_shutdown, sc,
SHUTDOWN_PRI_LAST);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int cuda_detach(device_t dev) {
diff --git a/sys/powerpc/powermac/kiic.c b/sys/powerpc/powermac/kiic.c
--- a/sys/powerpc/powermac/kiic.c
+++ b/sys/powerpc/powermac/kiic.c
@@ -241,7 +241,8 @@
/* Add the IIC bus layer */
sc->sc_iicbus = device_add_child(self, "iicbus", DEVICE_UNIT_ANY);
- return (bus_generic_attach(self));
+ bus_attach_children(self);
+ return (0);
}
static void
diff --git a/sys/powerpc/powermac/macgpio.c b/sys/powerpc/powermac/macgpio.c
--- a/sys/powerpc/powermac/macgpio.c
+++ b/sys/powerpc/powermac/macgpio.c
@@ -211,7 +211,8 @@
device_set_ivars(cdev, dinfo);
}
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
diff --git a/sys/powerpc/powermac/macio.c b/sys/powerpc/powermac/macio.c
--- a/sys/powerpc/powermac/macio.c
+++ b/sys/powerpc/powermac/macio.c
@@ -461,7 +461,8 @@
}
#endif
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
diff --git a/sys/powerpc/powermac/pmu.c b/sys/powerpc/powermac/pmu.c
--- a/sys/powerpc/powermac/pmu.c
+++ b/sys/powerpc/powermac/pmu.c
@@ -517,7 +517,8 @@
EVENTHANDLER_REGISTER(shutdown_final, pmu_shutdown, sc,
SHUTDOWN_PRI_LAST);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
diff --git a/sys/powerpc/powermac/smu.c b/sys/powerpc/powermac/smu.c
--- a/sys/powerpc/powermac/smu.c
+++ b/sys/powerpc/powermac/smu.c
@@ -400,7 +400,8 @@
EVENTHANDLER_REGISTER(shutdown_final, smu_shutdown, dev,
SHUTDOWN_PRI_LAST);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static const struct ofw_bus_devinfo *
@@ -1478,7 +1479,8 @@
/* Add the IIC bus layer */
device_add_child(dev, "iicbus", DEVICE_UNIT_ANY);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
diff --git a/sys/powerpc/powermac/uninorth.c b/sys/powerpc/powermac/uninorth.c
--- a/sys/powerpc/powermac/uninorth.c
+++ b/sys/powerpc/powermac/uninorth.c
@@ -418,7 +418,8 @@
if (strcmp(compat, "gmac") == 0)
unin_enable_gmac(dev);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
diff --git a/sys/powerpc/powernv/opal_console.c b/sys/powerpc/powernv/opal_console.c
--- a/sys/powerpc/powernv/opal_console.c
+++ b/sys/powerpc/powernv/opal_console.c
@@ -578,7 +578,8 @@
device_set_ivars(cdev, dinfo);
}
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static const struct ofw_bus_devinfo *
diff --git a/sys/powerpc/powernv/opal_dev.c b/sys/powerpc/powernv/opal_dev.c
--- a/sys/powerpc/powernv/opal_dev.c
+++ b/sys/powerpc/powernv/opal_dev.c
@@ -227,7 +227,8 @@
device_set_ivars(cdev, dinfo);
}
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
diff --git a/sys/powerpc/powernv/opal_i2c.c b/sys/powerpc/powernv/opal_i2c.c
--- a/sys/powerpc/powernv/opal_i2c.c
+++ b/sys/powerpc/powernv/opal_i2c.c
@@ -144,7 +144,8 @@
I2C_LOCK_INIT(sc);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
diff --git a/sys/powerpc/powernv/opal_i2cm.c b/sys/powerpc/powernv/opal_i2cm.c
--- a/sys/powerpc/powernv/opal_i2cm.c
+++ b/sys/powerpc/powernv/opal_i2cm.c
@@ -108,7 +108,8 @@
device_set_ivars(cdev, dinfo);
}
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static const struct ofw_bus_devinfo *
diff --git a/sys/powerpc/powernv/opal_sensor.c b/sys/powerpc/powernv/opal_sensor.c
--- a/sys/powerpc/powernv/opal_sensor.c
+++ b/sys/powerpc/powernv/opal_sensor.c
@@ -290,7 +290,8 @@
device_set_ivars(cdev, dinfo);
}
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static const struct ofw_bus_devinfo *
diff --git a/sys/powerpc/powernv/powernv_centaur.c b/sys/powerpc/powernv/powernv_centaur.c
--- a/sys/powerpc/powernv/powernv_centaur.c
+++ b/sys/powerpc/powernv/powernv_centaur.c
@@ -107,7 +107,8 @@
device_set_ivars(cdev, dinfo);
}
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static const struct ofw_bus_devinfo *
diff --git a/sys/powerpc/powernv/powernv_xscom.c b/sys/powerpc/powernv/powernv_xscom.c
--- a/sys/powerpc/powernv/powernv_xscom.c
+++ b/sys/powerpc/powernv/powernv_xscom.c
@@ -107,7 +107,8 @@
device_set_ivars(cdev, dinfo);
}
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static const struct ofw_bus_devinfo *
diff --git a/sys/powerpc/powerpc/nexus.c b/sys/powerpc/powerpc/nexus.c
--- a/sys/powerpc/powerpc/nexus.c
+++ b/sys/powerpc/powerpc/nexus.c
@@ -142,7 +142,7 @@
/* Now, probe children. */
bus_identify_children(dev);
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return (0);
}
diff --git a/sys/powerpc/ps3/ps3bus.c b/sys/powerpc/ps3/ps3bus.c
--- a/sys/powerpc/ps3/ps3bus.c
+++ b/sys/powerpc/ps3/ps3bus.c
@@ -479,7 +479,8 @@
clock_register(self, 1000);
- return (bus_generic_attach(self));
+ bus_attach_children(self);
+ return (0);
}
static int
diff --git a/sys/powerpc/pseries/vdevice.c b/sys/powerpc/pseries/vdevice.c
--- a/sys/powerpc/pseries/vdevice.c
+++ b/sys/powerpc/pseries/vdevice.c
@@ -156,7 +156,8 @@
device_set_ivars(cdev, dinfo);
}
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static const struct ofw_bus_devinfo *
diff --git a/sys/powerpc/psim/ata_iobus.c b/sys/powerpc/psim/ata_iobus.c
--- a/sys/powerpc/psim/ata_iobus.c
+++ b/sys/powerpc/psim/ata_iobus.c
@@ -112,7 +112,8 @@
* to add two
*/
device_add_child(dev, "ata", DEVICE_UNIT_ANY);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
diff --git a/sys/powerpc/psim/iobus.c b/sys/powerpc/psim/iobus.c
--- a/sys/powerpc/psim/iobus.c
+++ b/sys/powerpc/psim/iobus.c
@@ -240,7 +240,8 @@
}
}
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
diff --git a/sys/riscv/riscv/nexus.c b/sys/riscv/riscv/nexus.c
--- a/sys/riscv/riscv/nexus.c
+++ b/sys/riscv/riscv/nexus.c
@@ -172,7 +172,7 @@
nexus_add_child(dev, 2, "ofwbus", 0);
bus_identify_children(dev);
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return (0);
}
diff --git a/sys/riscv/riscv/riscv_console.c b/sys/riscv/riscv/riscv_console.c
--- a/sys/riscv/riscv/riscv_console.c
+++ b/sys/riscv/riscv/riscv_console.c
@@ -243,7 +243,7 @@
sc = device_get_softc(dev);
sc->dev = dev;
- bus_generic_attach(sc->dev);
+ bus_attach_children(sc->dev);
return (0);
}
diff --git a/sys/riscv/sifive/fu740_pci_dw.c b/sys/riscv/sifive/fu740_pci_dw.c
--- a/sys/riscv/sifive/fu740_pci_dw.c
+++ b/sys/riscv/sifive/fu740_pci_dw.c
@@ -425,7 +425,8 @@
if (error != 0)
goto fail;
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
fail:
/* XXX Cleanup */
diff --git a/sys/x86/pci/pci_bus.c b/sys/x86/pci/pci_bus.c
--- a/sys/x86/pci/pci_bus.c
+++ b/sys/x86/pci/pci_bus.c
@@ -524,7 +524,8 @@
}
#endif
device_add_child(dev, "pci", DEVICE_UNIT_ANY);
- return bus_generic_attach(dev);
+ bus_attach_children(dev);
+ return (0);
}
int
diff --git a/sys/x86/pci/qpi.c b/sys/x86/pci/qpi.c
--- a/sys/x86/pci/qpi.c
+++ b/sys/x86/pci/qpi.c
@@ -155,7 +155,8 @@
for (bus = PCI_BUSMAX; bus >= 0; bus--)
qpi_probe_pcib(dev, bus);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
@@ -227,7 +228,8 @@
{
device_add_child(dev, "pci", DEVICE_UNIT_ANY);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
diff --git a/sys/x86/x86/legacy.c b/sys/x86/x86/legacy.c
--- a/sys/x86/x86/legacy.c
+++ b/sys/x86/x86/legacy.c
@@ -162,7 +162,7 @@
* found.
*/
bus_identify_children(dev);
- bus_generic_attach(dev);
+ bus_attach_children(dev);
/*
* If we didn't see ISA on a PCI bridge, add a top-level bus.
@@ -343,7 +343,7 @@
cpu_attach(device_t dev)
{
bus_identify_children(dev);
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return (0);
}
diff --git a/sys/x86/x86/mptable_pci.c b/sys/x86/x86/mptable_pci.c
--- a/sys/x86/x86/mptable_pci.c
+++ b/sys/x86/x86/mptable_pci.c
@@ -66,7 +66,8 @@
mptable_pci_host_res_init(dev);
device_add_child(dev, "pci", DEVICE_UNIT_ANY);
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
}
static int
diff --git a/sys/x86/x86/nexus.c b/sys/x86/x86/nexus.c
--- a/sys/x86/x86/nexus.c
+++ b/sys/x86/x86/nexus.c
@@ -271,7 +271,7 @@
*/
if (BUS_ADD_CHILD(dev, 10, "legacy", 0) == NULL)
panic("legacy: could not attach");
- bus_generic_attach(dev);
+ bus_attach_children(dev);
return (0);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 24, 3:03 AM (15 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14773620
Default Alt Text
D47675.id.diff (100 KB)
Attached To
Mode
D47675: Replace calls to bus_generic_attach with bus_attach_children
Attached
Detach File
Event Timeline
Log In to Comment