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:
Ian Lepore 2019-05-23 14:21:23 +00:00
parent d0ba99d943
commit ecb53c096d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=348166

View File

@ -469,6 +469,10 @@ i2c_detach(device_t dev)
if (sc->iicbus != NULL)
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)
bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->res);