diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2016-02-09 13:51:59 +0100 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2016-02-11 20:29:45 +0100 |
commit | 1c3cdb186172ee3be24005a7ff0e849bc17b67b8 (patch) | |
tree | 56802f31391f6f4448579f0525b766fb0379e475 /drivers/gpio/gpiolib.h | |
parent | gpio: move sysfs mock device to the gpio_device (diff) | |
download | linux-1c3cdb186172ee3be24005a7ff0e849bc17b67b8.tar.xz linux-1c3cdb186172ee3be24005a7ff0e849bc17b67b8.zip |
gpio: move descriptors into gpio_device
We need gpio_device to hold the descriptors so that they can
be lifecycled with the struct gpio_device held from userspace.
Move the descriptor array into gpio_device. Also rename it from
"desc" (singularis) to "descs" (pluralis) to reflect the fact
that it is an array.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpiolib.h')
-rw-r--r-- | drivers/gpio/gpiolib.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpio/gpiolib.h b/drivers/gpio/gpiolib.h index c5a5b57463c7..39b8301c98b6 100644 --- a/drivers/gpio/gpiolib.h +++ b/drivers/gpio/gpiolib.h @@ -32,6 +32,7 @@ struct acpi_device; * @owner: helps prevent removal of modules exporting active GPIOs * @chip: pointer to the corresponding gpiochip, holding static * data for this device + * @descs: array of ngpio descriptors. * @list: links gpio_device:s together for traversal * * This state container holds most of the runtime variable data @@ -46,6 +47,7 @@ struct gpio_device { struct device *mockdev; struct module *owner; struct gpio_chip *chip; + struct gpio_desc *descs; struct list_head list; }; @@ -152,7 +154,7 @@ int gpiod_hog(struct gpio_desc *desc, const char *name, */ static int __maybe_unused gpio_chip_hwgpio(const struct gpio_desc *desc) { - return desc - &desc->chip->desc[0]; + return desc - &desc->chip->gpiodev->descs[0]; } /* With descriptor prefix */ |