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:
@@ -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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user