]> git.baikalelectronics.ru Git - kernel.git/commit
gpio: sysfs: release irq after class-device deregistration
authorJohan Hovold <johan@kernel.org>
Mon, 4 May 2015 15:10:35 +0000 (17:10 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 12 May 2015 08:47:03 +0000 (10:47 +0200)
commit4616839346281eb9aae428d3cadf5e4943d82717
tree9d86f162d0488d13b5bca406e8f070e47802bb4d
parentc04d4c4b169a7b8056cf3d10f5a95031ef0c69e1
gpio: sysfs: release irq after class-device deregistration

Make sure to release any irq only after the class device has been
deregistered.

This avoids a race between gpiod_unexport and edge_store, where an irq
could be allocated just before the gpio class device is deregistered
without relying on FLAG_EXPORT and the global sysfs lock.

Note that there is no need to hold the sysfs lock when releasing the irq
after the class device is gone as kernfs will prevent further attribute
operations.

Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpiolib-sysfs.c