aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/gpio/gpioiic.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/gpio/gpioiic.c')
-rw-r--r--sys/dev/gpio/gpioiic.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/gpio/gpioiic.c b/sys/dev/gpio/gpioiic.c
index 4f24dac23e51..2197d238cf2b 100644
--- a/sys/dev/gpio/gpioiic.c
+++ b/sys/dev/gpio/gpioiic.c
@@ -320,8 +320,9 @@ gpioiic_attach(device_t dev)
#endif
/* Add the bitbang driver as our only child; it will add iicbus. */
- device_add_child(sc->dev, "iicbb", -1);
- return (bus_generic_attach(dev));
+ device_add_child(sc->dev, "iicbb", DEVICE_UNIT_ANY);
+ bus_attach_children(dev);
+ return (0);
}
static int
@@ -330,7 +331,7 @@ gpioiic_detach(device_t dev)
struct gpioiic_softc *sc = device_get_softc(dev);
int err;
- if ((err = bus_generic_detach(dev)) != 0)
+ if ((err = bus_detach_children(dev)) != 0)
return (err);
gpioiic_cleanup(sc);