gpio: move sysfs mock device to the gpio_device

Since gpio_device is the struct that survives if the backing
gpio_chip is removed, move the sysfs mock device to this state
container so it becomes part of the dangling state of the
GPIO device on removal.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
Linus Walleij 2016-02-09 13:21:06 +01:00
parent 9efd9e6956
commit afbc4f312b
4 changed files with 21 additions and 19 deletions

View file

@ -24,7 +24,6 @@ struct gpio_device;
* @label: for diagnostics
* @gpiodev: the internal state holder, opaque struct
* @parent: optional parent device providing the GPIOs
* @cdev: class device used by sysfs interface (may be NULL)
* @owner: helps prevent removal of modules exporting active GPIOs
* @data: per-instance data assigned by the driver
* @request: optional hook for chip-specific activation, such as
@ -110,7 +109,6 @@ struct gpio_chip {
const char *label;
struct gpio_device *gpiodev;
struct device *parent;
struct device *cdev;
struct module *owner;
void *data;