summaryrefslogtreecommitdiffstats
path: root/include/linux/gpio
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2016-02-15 16:32:09 +0530
committerLaxman Dewangan <ldewangan@nvidia.com>2016-02-23 19:40:33 +0530
commit0cf3292cde22f8843ae5d1eeb8466d8121243c1a (patch)
tree3bc161eda1d422aa600434e3b03985ff736ea761 /include/linux/gpio
parente5451c8f8330e03ad3cfa16048b4daf961af434f (diff)
downloadlinux-0cf3292cde22f8843ae5d1eeb8466d8121243c1a.tar.gz
linux-0cf3292cde22f8843ae5d1eeb8466d8121243c1a.tar.bz2
linux-0cf3292cde22f8843ae5d1eeb8466d8121243c1a.zip
gpio: Add devm_ apis for gpiochip_add_data and gpiochip_remove
Add device managed APIs devm_gpiochip_add_data() and devm_gpiochip_remove() for the APIs gpiochip_add_data() and gpiochip_remove(). This helps in reducing code in error path and sometimes removal of .remove callback for driver unbind. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Diffstat (limited to 'include/linux/gpio')
-rw-r--r--include/linux/gpio/driver.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
index 639607658ed8..bee976f82788 100644
--- a/include/linux/gpio/driver.h
+++ b/include/linux/gpio/driver.h
@@ -192,6 +192,10 @@ static inline int gpiochip_add(struct gpio_chip *chip)
return gpiochip_add_data(chip, NULL);
}
extern void gpiochip_remove(struct gpio_chip *chip);
+extern int devm_gpiochip_add_data(struct device *dev, struct gpio_chip *chip,
+ void *data);
+extern void devm_gpiochip_remove(struct device *dev, struct gpio_chip *chip);
+
extern struct gpio_chip *gpiochip_find(void *data,
int (*match)(struct gpio_chip *chip, void *data));