mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
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>
This commit is contained in:
parent
e5451c8f83
commit
0cf3292cde
2 changed files with 78 additions and 0 deletions
|
@ -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));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue