aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/iicbus
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2024-12-06 22:26:16 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2024-12-06 22:26:16 +0000
commit18250ec6c089c0c50cbd9fd87d78e03ff89916df (patch)
treef5dd88ced310b6c82afec1a89f7f23bc10b72913 /sys/dev/iicbus
parent723da5d92f40a413585107f8455280ea575fe410 (diff)
Diffstat (limited to 'sys/dev/iicbus')
-rw-r--r--sys/dev/iicbus/controller/opencores/iicoc_pci.c2
-rw-r--r--sys/dev/iicbus/controller/rockchip/rk_i2c.c2
-rw-r--r--sys/dev/iicbus/controller/twsi/twsi.c2
-rw-r--r--sys/dev/iicbus/controller/vybrid/vf_i2c.c2
-rw-r--r--sys/dev/iicbus/iicbb.c2
-rw-r--r--sys/dev/iicbus/iicbus.c2
-rw-r--r--sys/dev/iicbus/iichid.c7
-rw-r--r--sys/dev/iicbus/iicsmb.c2
-rw-r--r--sys/dev/iicbus/mux/iic_gpiomux.c2
-rw-r--r--sys/dev/iicbus/mux/ltc430x.c2
-rw-r--r--sys/dev/iicbus/mux/pca9547.c2
-rw-r--r--sys/dev/iicbus/mux/pca954x.c2
-rw-r--r--sys/dev/iicbus/ofw_iicbus.c3
-rw-r--r--sys/dev/iicbus/pmic/act8846.c3
14 files changed, 17 insertions, 18 deletions
diff --git a/sys/dev/iicbus/controller/opencores/iicoc_pci.c b/sys/dev/iicbus/controller/opencores/iicoc_pci.c
index 85fefdb7abe9..cecfa888349b 100644
--- a/sys/dev/iicbus/controller/opencores/iicoc_pci.c
+++ b/sys/dev/iicbus/controller/opencores/iicoc_pci.c
@@ -88,7 +88,7 @@ iicoc_attach(device_t dev)
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
index a335ceb81902..0ef65d1121f5 100644
--- a/sys/dev/iicbus/controller/rockchip/rk_i2c.c
+++ b/sys/dev/iicbus/controller/rockchip/rk_i2c.c
@@ -665,7 +665,7 @@ rk_i2c_attach(device_t dev)
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
index 55d12b6ee5ae..20d39aa7d93b 100644
--- a/sys/dev/iicbus/controller/twsi/twsi.c
+++ b/sys/dev/iicbus/controller/twsi/twsi.c
@@ -817,7 +817,7 @@ twsi_attach(device_t dev)
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
index ea0e1eeac7fb..f6d0eb4c2c59 100644
--- a/sys/dev/iicbus/controller/vybrid/vf_i2c.c
+++ b/sys/dev/iicbus/controller/vybrid/vf_i2c.c
@@ -193,7 +193,7 @@ vf_i2c_attach_common(device_t dev)
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
index a86871085fe6..dec5e4bc0c7e 100644
--- a/sys/dev/iicbus/iicbb.c
+++ b/sys/dev/iicbus/iicbb.c
@@ -164,7 +164,7 @@ iicbb_attach(device_t dev)
"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
index bfc86ebe28a9..97dc9c437866 100644
--- a/sys/dev/iicbus/iicbus.c
+++ b/sys/dev/iicbus/iicbus.c
@@ -127,7 +127,7 @@ iicbus_attach_common(device_t dev, u_int bus_freq)
#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
index 86b02250d5d3..ed016fa0e0cc 100644
--- a/sys/dev/iicbus/iichid.c
+++ b/sys/dev/iicbus/iichid.c
@@ -1199,11 +1199,8 @@ iichid_attach(device_t dev)
}
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
index 3e7e06a85f09..e502ad904070 100644
--- a/sys/dev/iicbus/iicsmb.c
+++ b/sys/dev/iicbus/iicsmb.c
@@ -155,7 +155,7 @@ iicsmb_attach(device_t dev)
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
index c4dbe4066bd0..929b0f961af4 100644
--- a/sys/dev/iicbus/mux/iic_gpiomux.c
+++ b/sys/dev/iicbus/mux/iic_gpiomux.c
@@ -212,7 +212,7 @@ gpiomux_attach(device_t dev)
/* 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
index 984f79223ee5..3dc410da0152 100644
--- a/sys/dev/iicbus/mux/ltc430x.c
+++ b/sys/dev/iicbus/mux/ltc430x.c
@@ -211,7 +211,7 @@ ltc430x_attach(device_t dev)
* 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
index b76f8d132b43..654a81e6f3e1 100644
--- a/sys/dev/iicbus/mux/pca9547.c
+++ b/sys/dev/iicbus/mux/pca9547.c
@@ -120,7 +120,7 @@ pca9547_attach(device_t dev)
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
index befa0db39172..1925f6c90e83 100644
--- a/sys/dev/iicbus/mux/pca954x.c
+++ b/sys/dev/iicbus/mux/pca954x.c
@@ -214,7 +214,7 @@ pca954x_attach(device_t dev)
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
index 4b0494f8fcc4..84ddcbbdd3d5 100644
--- a/sys/dev/iicbus/ofw_iicbus.c
+++ b/sys/dev/iicbus/ofw_iicbus.c
@@ -194,7 +194,8 @@ ofw_iicbus_attach(device_t dev)
/* 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
index e55fc70986a8..6e5d85fdc6b0 100644
--- a/sys/dev/iicbus/pmic/act8846.c
+++ b/sys/dev/iicbus/pmic/act8846.c
@@ -215,7 +215,8 @@ act8846_attach(device_t dev)
if (rv != 0)
goto fail;
- return (bus_generic_attach(dev));
+ bus_attach_children(dev);
+ return (0);
fail:
LOCK_DESTROY(sc);