Skip to content

Commit 28bac28

Browse files
Evgenii IvanovVexedUXR
authored andcommitted
gpio: Fix incorrect dev being passed to gpiobus_detach_bus
Passing in the busdev will not detach from the bus correctly leaving the /dev/gpiocN entry Reviewed by: vexeduxr, imp Differential Revision: https://reviews.freebsd.org/D51857
1 parent 0e5e956 commit 28bac28

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

sys/dev/iicbus/gpio/pcf8574.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,7 @@ pcf8574_detach(device_t dev)
159159

160160
sc = device_get_softc(dev);
161161

162-
if (sc->busdev != NULL)
163-
gpiobus_detach_bus(sc->busdev);
164-
162+
gpiobus_detach_bus(dev);
165163
sx_destroy(&sc->lock);
166164
return (0);
167165
}

sys/dev/iicbus/gpio/tca64xx.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,7 @@ tca64xx_detach(device_t dev)
292292

293293
sc = device_get_softc(dev);
294294

295-
if (sc->busdev != NULL)
296-
gpiobus_detach_bus(sc->busdev);
297-
295+
gpiobus_detach_bus(dev);
298296
mtx_destroy(&sc->mtx);
299297

300298
return (0);

0 commit comments

Comments
 (0)