Replace calls to bus_generic_attach with bus_attach_children

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D47675
This commit is contained in:
John Baldwin 2024-12-06 17:26:16 -05:00
parent 723da5d92f
commit 18250ec6c0
270 changed files with 491 additions and 449 deletions

View file

@ -270,8 +270,9 @@ nexus_acpi_attach(device_t dev)
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[] = {

View file

@ -449,7 +449,7 @@ rsb_attach(device_t dev)
goto fail;
}
bus_generic_attach(dev);
bus_attach_children(dev);
return (0);

View file

@ -216,7 +216,8 @@ al_msix_attach(device_t dev)
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

View file

@ -243,7 +243,7 @@ gic_acpi_attach(device_t dev)
/* 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);

View file

@ -186,7 +186,7 @@ gic_fdt_attach(device_t dev)
/* 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);

View file

@ -185,7 +185,7 @@ nexus_attach(device_t dev)
* Next, deal with the children we know about already.
*/
bus_identify_children(dev);
bus_generic_attach(dev);
bus_attach_children(dev);
return (0);
}

View file

@ -112,7 +112,8 @@ bcm2835_clkman_attach(device_t dev)
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

View file

@ -460,7 +460,8 @@ bcm_pwm_attach(device_t dev)
sc->period2 = 10000; /* 12.5 khz */
sc->ratio2 = 2500; /* 25% */
return (bus_generic_attach(dev));
bus_attach_children(dev);
return (0);
}
static int

View file

@ -354,7 +354,7 @@ bcm_sdhci_attach(device_t dev)
SDHCI_BUFFER;
bus_identify_children(dev);
bus_generic_attach(dev);
bus_attach_children(dev);
sdhci_start_slot(&sc->sc_slot);

View file

@ -473,7 +473,7 @@ bcm_sdhost_attach(device_t dev)
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);

View file

@ -299,8 +299,9 @@ bcm_spi_attach(device_t dev)
#endif
device_add_child(dev, "spibus", DEVICE_UNIT_ANY);
bus_attach_children(dev);
return (bus_generic_attach(dev));
return (0);
}
static int

View file

@ -745,7 +745,8 @@ bcm_pcib_attach(device_t dev)
/* Done. */
device_add_child(dev, "pci", DEVICE_UNIT_ANY);
return (bus_generic_attach(dev));
bus_attach_children(dev);
return (0);
}
/*

View file

@ -197,7 +197,8 @@ spi_attach(device_t dev)
WRITE4(sc, SPI_CTAR0, reg);
device_add_child(dev, "spibus", 0);
return (bus_generic_attach(dev));
bus_attach_children(dev);
return (0);
}
static int

View file

@ -237,7 +237,8 @@ a37x0_iic_attach(device_t dev)
}
/* Probe and attach the iicbus. */
return (bus_generic_attach(dev));
bus_attach_children(dev);
return (0);
}
static int

View file

@ -562,7 +562,8 @@ mv_pcib_attach(device_t self)
}
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 */

View file

@ -149,7 +149,8 @@ mv_pcib_ctrl_attach(device_t dev)
if (err != 0)
return (err);
return (bus_generic_attach(dev));
bus_attach_children(dev);
return (0);
}
static int

View file

@ -810,7 +810,8 @@ mvebu_gpio_attach(device_t dev)
return (ENXIO);
}
return (bus_generic_attach(dev));
bus_attach_children(dev);
return (0);
}
static int

View file

@ -328,7 +328,8 @@ as3722_attach(device_t dev)
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)

View file

@ -1368,7 +1368,8 @@ dc_attach(device_t dev)
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);

View file

@ -1242,7 +1242,8 @@ hdmi_attach(device_t dev)
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);

View file

@ -571,7 +571,8 @@ host1x_attach(device_t dev)
goto fail;
}
return (bus_generic_attach(dev));
bus_attach_children(dev);
return (0);
fail:
if (sc->tegra_drm != NULL)

View file

@ -151,7 +151,8 @@ tegra_abpmisc_attach(device_t dev)
}
dev_sc = sc;
return (bus_generic_attach(dev));
bus_attach_children(dev);
return (0);
fail:
if (sc->abp_misc_res != NULL)

View file

@ -481,7 +481,8 @@ tegra_efuse_attach(device_t dev)
if (bootverbose)
tegra_efuse_dump_sku();
return (bus_generic_attach(dev));
bus_attach_children(dev);
return (0);
fail:
dev_sc = NULL;

View file

@ -824,7 +824,8 @@ tegra_gpio_attach(device_t dev)
return (ENXIO);
}
return (bus_generic_attach(dev));
bus_attach_children(dev);
return (0);
}
static int

View file

@ -722,7 +722,8 @@ tegra_i2c_attach(device_t dev)
}
/* Probe and attach the iicbus. */
return (bus_generic_attach(dev));
bus_attach_children(dev);
return (0);
fail:
if (sc->irq_h != NULL)

View file

@ -260,7 +260,8 @@ tegra_mc_attach(device_t dev)
/* 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)

View file

@ -1566,8 +1566,9 @@ tegra_pcib_attach(device_t dev)
goto out;
#endif
device_add_child(dev, "pci", DEVICE_UNIT_ANY);
bus_attach_children(dev);
return (bus_generic_attach(dev));
return (0);
out:

View file

@ -246,7 +246,8 @@ tegra_rtc_attach(device_t dev)
*/
/* clock_register(dev, 1000000); */
return (bus_generic_attach(dev));
bus_attach_children(dev);
return (0);
fail:
if (sc->clk != NULL)

View file

@ -387,7 +387,7 @@ tegra_sdhci_attach(device_t dev)
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);

View file

@ -780,7 +780,8 @@ soctherm_attach(device_t dev)
}
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)

View file

@ -200,7 +200,8 @@ ipq4018_usb_hs_usbphy_attach(device_t dev)
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);

View file

@ -180,7 +180,8 @@ ipq4018_usb_ss_usbphy_attach(device_t dev)
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);

View file

@ -518,7 +518,8 @@ am335x_ehrpwm_attach(device_t dev)
}
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)

View file

@ -158,7 +158,8 @@ am335x_pwmss_attach(device_t dev)
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

View file

@ -85,7 +85,8 @@ ti_usb_phy_attach(device_t dev)
/* FIXME: Add dev/phy/ interface */
return (bus_generic_attach(dev));
bus_attach_children(dev);
return (0);
}
static int

View file

@ -241,7 +241,8 @@ cleanup:
if (err)
return (err);
return (bus_generic_attach(dev));
bus_attach_children(dev);
return (0);
}
static int

View file

@ -182,7 +182,8 @@ ti_divider_attach(device_t dev)
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 @@ ti_divider_attach(device_t dev)
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

View file

@ -292,7 +292,8 @@ ti_dpll_attach(device_t dev)
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 @@ ti_dpll_attach(device_t dev)
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

View file

@ -185,7 +185,8 @@ ti_gate_attach(device_t dev)
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 @@ ti_gate_attach(device_t dev)
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

View file

@ -167,7 +167,8 @@ ti_mux_attach(device_t dev)
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 @@ ti_mux_attach(device_t dev)
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

View file

@ -912,7 +912,7 @@ cpsw_attach(device_t dev)
}
}
bus_identify_children(dev);
bus_generic_attach(dev);
bus_attach_children(dev);
return (0);
}

View file

@ -115,7 +115,8 @@ ti_omap4_cm_attach(device_t dev)
device_probe_and_attach(cdev);
}
return (bus_generic_attach(dev));
bus_attach_children(dev);
return (0);
}
static int

View file

@ -192,8 +192,8 @@ ti_prcm_attach(device_t dev)
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

View file

@ -127,7 +127,8 @@ ti_scm_attach(device_t dev)
device_probe_and_attach(cdev);
}
return (bus_generic_attach(dev));
bus_attach_children(dev);
return (0);
}
static int

View file

@ -190,7 +190,8 @@ ti_scm_syscon_attach(device_t dev)
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 */

View file

@ -688,7 +688,7 @@ ti_sdhci_attach(device_t dev)
sc->force_card_present = true;
bus_identify_children(dev);
bus_generic_attach(dev);
bus_attach_children(dev);
sdhci_start_slot(&sc->slot);
return (0);

View file

@ -264,8 +264,9 @@ ti_spi_attach(device_t dev)
#endif
device_add_child(dev, "spibus", DEVICE_UNIT_ANY);
bus_attach_children(dev);
return (bus_generic_attach(dev));
return (0);
}
static int

View file

@ -539,7 +539,8 @@ ti_sysc_attach(device_t dev)
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 @@ ti_sysc_attach(device_t dev)
sc->attach_done = true;
return (bus_generic_attach(sc->dev));
bus_attach_children(sc->dev);
return (0);
}
static int
@ -593,7 +595,7 @@ ti_sysc_new_pass(device_t dev)
}
sc->attach_done = true;
bus_generic_attach(sc->dev);
bus_attach_children(sc->dev);
}
static device_method_t ti_sysc_methods[] = {

View file

@ -417,7 +417,8 @@ twl_attach(device_t dev)
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

View file

@ -420,7 +420,8 @@ omap_uhh_attach(device_t dev)
*/
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);

View file

@ -464,7 +464,7 @@ gic_v3_acpi_bus_attach(device_t dev)
acpi_unmap_table(madt);
bus_generic_attach(dev);
bus_attach_children(dev);
}
static struct resource_list *

View file

@ -376,7 +376,8 @@ gic_v3_ofw_bus_attach(device_t dev)
}
}
return (bus_generic_attach(dev));
bus_attach_children(dev);
return (0);
}
static struct resource_list *

View file

@ -178,7 +178,7 @@ nexus_attach(device_t dev)
panic("nexus_attach irq_rman");
bus_identify_children(dev);
bus_generic_attach(dev);
bus_attach_children(dev);
return (0);
}

View file

@ -362,7 +362,8 @@ brcm_iproc_mdio_attach(device_t dev)
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);

View file

@ -174,7 +174,8 @@ brcm_mdionexus_fdt_attach(device_t dev)
if (err != 0)
return (err);
return (bus_generic_attach(dev));
bus_attach_children(dev);
return (0);
}
static const struct ofw_bus_devinfo *

View file

@ -154,5 +154,6 @@ ns2_pcie_phy_fdt_attach(device_t dev)
if (ns2_pci_phy_init(dev) < 0)
return (EINVAL);
return (bus_generic_attach(dev));
bus_attach_children(dev);
return (0);
}

View file

@ -907,8 +907,8 @@ thunder_pem_attach(device_t dev)
}
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);

View file

@ -435,7 +435,8 @@ max77620_attach(device_t dev)
goto fail;
}
#endif
return (bus_generic_attach(dev));
bus_attach_children(dev);
return (0);
fail:
if (sc->irq_h != NULL)

View file

@ -355,7 +355,8 @@ max77620_rtc_attach(device_t dev)
clock_register(sc->dev, 1000000);
return (bus_generic_attach(dev));
bus_attach_children(dev);
return (0);
fail:
LOCK_DESTROY(sc);

View file

@ -241,7 +241,8 @@ qorif_dw_pci_attach(device_t dev)
goto out;
}
return (bus_generic_attach(dev));
bus_attach_children(dev);
return (0);
out:
/* XXX Cleanup */
return (rv);

View file

@ -464,7 +464,8 @@ qoriq_therm_attach(device_t dev)
}
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)

View file

@ -362,7 +362,8 @@ rk3568_pcie_attach(device_t dev)
goto fail;
}
return (bus_generic_attach(dev));
bus_attach_children(dev);
return (0);
fail:
rk3568_pcie_detach(dev);
return (ENXIO);

View file

@ -1354,7 +1354,8 @@ rk_pcie_attach(device_t dev)
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);

View file

@ -1537,7 +1537,8 @@ rk_pinctrl_attach(device_t dev)
fdt_pinctrl_configure_tree(dev);
return (bus_generic_attach(dev));
bus_attach_children(dev);
return (0);
}
static int

View file

@ -818,7 +818,8 @@ tsadc_attach(device_t dev)
}
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);

View file

@ -274,7 +274,8 @@ rk_usbphy_attach(device_t dev)
if (rv != 0)
goto fail;
}
return (bus_generic_attach(dev));
bus_attach_children(dev);
return (0);
fail:
return (ENXIO);

View file

@ -90,7 +90,7 @@ lkpi_iic_attach(device_t dev)
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 @@ int
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 @@ lkpi_i2c_add_adapter(struct i2c_adapter *adapter)
}
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);

View file

@ -95,7 +95,7 @@ lkpi_iicbb_attach(device_t dev)
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 @@ int
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 @@ lkpi_i2c_bit_add_bus(struct i2c_adapter *adapter)
}
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);

View file

@ -193,7 +193,7 @@ bcm_vchiq_attach(device_t dev)
vchiq_init();
bus_identify_children(dev);
bus_generic_attach(dev);
bus_attach_children(dev);
return (0);
}

View file

@ -441,8 +441,7 @@ aac_startup(void *arg)
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 @@ aac_handle_aif(struct aac_softc *sc, struct aac_fib *fib)
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 @@ aac_get_bus_info(struct aac_softc *sc)
}
if (found)
bus_generic_attach(sc->aac_dev);
bus_attach_children(sc->aac_dev);
}

View file

@ -335,7 +335,7 @@ aacraid_attach(struct aac_softc *sc)
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 @@ aac_container_bus(struct aac_softc *sc)
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

View file

@ -297,7 +297,7 @@ acpi_wmi_attach(device_t dev)
if (ret == 0) {
bus_identify_children(dev);
ret = bus_generic_attach(dev);
bus_attach_children(dev);
}
return (ret);

View file

@ -2282,8 +2282,8 @@ acpi_probe_children(device_t bus)
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

View file

@ -104,7 +104,8 @@ acpi_syscont_attach(device_t dev)
{
bus_identify_children(dev);
return (bus_generic_attach(dev));
bus_attach_children(dev);
return (0);
}
static int

View file

@ -471,7 +471,7 @@ acpi_cpu_postattach(void *unused __unused)
}
CPU_FOREACH(i) {
if ((sc = cpu_softc[i]) != NULL) {
bus_generic_attach(sc->cpu_dev);
bus_attach_children(sc->cpu_dev);
attached = 1;
}
}

View file

@ -535,7 +535,8 @@ acpi_pcib_acpi_attach(device_t dev)
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");

View file

@ -182,7 +182,7 @@ adb_bus_enumerate(void *xdev)
}
}
bus_generic_attach(dev);
bus_attach_children(dev);
config_intrhook_disestablish(&sc->enum_hook);
}

View file

@ -383,7 +383,7 @@ ahci_attach(device_t dev)
else
device_set_ivars(child, (void *)(intptr_t)AHCI_EM_UNIT);
}
bus_generic_attach(dev);
bus_attach_children(dev);
return (0);
}

View file

@ -223,7 +223,7 @@ alpm_attach(device_t dev)
alpm_detach(dev);
return (EINVAL);
}
bus_generic_attach(dev);
bus_attach_children(dev);
return (0);
}

View file

@ -220,7 +220,7 @@ amdpm_attach(device_t dev)
return (EINVAL);
}
bus_generic_attach(dev);
bus_attach_children(dev);
return (0);
}

View file

@ -165,7 +165,7 @@ amdsmb_attach(device_t dev)
return (EINVAL);
}
bus_generic_attach(dev);
bus_attach_children(dev);
return (0);
}

View file

@ -126,7 +126,7 @@ ata_pci_attach(device_t dev)
else
device_set_ivars(child, (void *)(intptr_t)unit);
}
bus_generic_attach(dev);
bus_attach_children(dev);
return 0;
}

View file

@ -113,7 +113,7 @@ ata_jmicron_chipinit(device_t dev)
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;

View file

@ -128,7 +128,7 @@ ata_marvell_chipinit(device_t dev)
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;

View file

@ -239,7 +239,7 @@ atkbdc_isa_attach(device_t dev)
*(atkbdc_softc_t **)device_get_softc(dev) = sc;
bus_identify_children(dev);
bus_generic_attach(dev);
bus_attach_children(dev);
return 0;
}

View file

@ -533,7 +533,8 @@ atopcase_init(struct atopcase_softc *sc)
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);

View file

@ -458,8 +458,7 @@ bhndb_pci_attach(device_t dev)
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);

View file

@ -211,13 +211,12 @@ chipc_attach(device_t dev)
* 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);

View file

@ -115,8 +115,7 @@ chipc_spi_attach(device_t dev)
/* 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));

View file

@ -125,7 +125,6 @@ int
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_generic_attach(device_t dev)
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

View file

@ -89,7 +89,6 @@ int
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_generic_attach(device_t dev)
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

View file

@ -446,7 +446,7 @@ cfi_attach(device_t dev)
#endif
device_add_child(dev, "cfid", DEVICE_UNIT_ANY);
bus_generic_attach(dev);
bus_attach_children(dev);
return (0);
}

View file

@ -220,7 +220,8 @@ aw_ccu_attach(device_t dev)
device_probe_and_attach(cdev);
}
return (bus_generic_attach(dev));
bus_attach_children(dev);
return (0);
}
static device_method_t aw_ccu_methods[] = {

View file

@ -69,7 +69,8 @@ ofw_clkbus_attach(device_t dev)
device_probe_and_attach(cdev);
}
return (bus_generic_attach(dev));
bus_attach_children(dev);
return (0);
}
static device_method_t ofw_clkbus_methods[] = {

View file

@ -269,7 +269,8 @@ clk_fixed_attach(device_t dev)
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));

View file

@ -641,8 +641,7 @@ cxgb_controller_attach(device_t dev)
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);

View file

@ -1635,12 +1635,7 @@ t4_attach(device_t dev)
*/
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_attach(device_t dev)
cxgbe_sysctls(pi);
bus_generic_attach(dev);
bus_attach_children(dev);
return (0);
}

View file

@ -755,12 +755,7 @@ t4vf_attach(device_t dev)
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",

View file

@ -67,7 +67,8 @@ bman_portals_attach(device_t dev)
/* Set portal properties for XX_VirtToPhys() */
XX_PortalSetInfo(dev);
return (bus_generic_attach(dev));
bus_attach_children(dev);
return (0);
}
int

View file

@ -473,7 +473,8 @@ fman_attach(device_t dev)
goto err;
}
return (bus_generic_attach(dev));
bus_attach_children(dev);
return (0);
err:
fman_detach(dev);

Some files were not shown because too many files have changed in this diff Show more