gpio: sysfs: clean up chip class-device handling
authorJohan Hovold <johan@kernel.org>
Mon, 4 May 2015 15:10:31 +0000 (17:10 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 12 May 2015 08:46:44 +0000 (10:46 +0200)
commit6a4b6b0a3b55f23f4cc9ad85a1539c581bcb0874
tree2c4e625f5c707fdea60096b8aa64c991f19b217a
parent3ff74be5c1a72df6d304dcb453f68e3c3bea3bdd
gpio: sysfs: clean up chip class-device handling

Clean gpio-chip class device registration and deregistration.

The class device is registered when a gpio-chip is added (or from
gpiolib_sysfs_init post-core init call), and deregistered when the chip
is removed.

Store the class device in struct gpio_chip directly rather than do a
class-device lookup on deregistration. This also removes the need for
the exported flag.

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
include/linux/gpio/driver.h