aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/of_gpio.h
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2015-12-03 15:14:13 +0100
committerLinus Walleij <linus.walleij@linaro.org>2016-01-05 11:20:12 +0100
commitb08ea35a3296ee25c4cb53a977b752266dafa2c2 (patch)
treeac2742730a0b73af246fdf71247c45e7f704a61c /include/linux/of_gpio.h
parentgpio: pxa: checking IS_ERR() instead of NULL (diff)
downloadlinux-dev-b08ea35a3296ee25c4cb53a977b752266dafa2c2.tar.xz
linux-dev-b08ea35a3296ee25c4cb53a977b752266dafa2c2.zip
gpio: add a data pointer to gpio_chip
This adds a void * pointer to gpio_chip so that driver can assign and retrieve some states. This is done to get rid of container_of() calls for gpio_chips embedded inside state containers, so we can remove the need to have the gpio_chip or later (planned) struct gpio_device be dynamically allocated at registration time, so that its struct device can be properly reference counted and not bound to its parent device (e.g. a platform_device) but instead live on after unregistration if it is opened by e.g. a char device or sysfs. The data is added with the new function gpiochip_add_data() and for compatibility we add static inline wrapper function gpiochip_add() that will call gpiochip_add_data() with NULL as argument. The latter will be removed once we have exorcised gpiochip_add() from the kernel. gpiochip_get_data() is added as a static inline accessor for drivers to quickly get their data out. Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'include/linux/of_gpio.h')
0 files changed, 0 insertions, 0 deletions