Release the bus-recovery gpio pins in detach(), so that unload then
reload of the module works without "pin already allocated" errors.
This commit is contained in:
parent
d0ba99d943
commit
ecb53c096d
@ -469,6 +469,10 @@ i2c_detach(device_t dev)
|
|||||||
if (sc->iicbus != NULL)
|
if (sc->iicbus != NULL)
|
||||||
device_delete_child(dev, sc->iicbus);
|
device_delete_child(dev, sc->iicbus);
|
||||||
|
|
||||||
|
/* Release bus-recover pins; gpio_pin_release() handles NULL args. */
|
||||||
|
gpio_pin_release(sc->rb_sclpin);
|
||||||
|
gpio_pin_release(sc->rb_sdapin);
|
||||||
|
|
||||||
if (sc->res != NULL)
|
if (sc->res != NULL)
|
||||||
bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->res);
|
bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->res);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user