Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Revert "pinctrl: remove pinctrl_remove_gpio_range"

This reverts earlier commit which removed
pinctrl_remove_gpio_range(), because at that time there
weren't any more users of that routine. It was removed as the
removal of ranges was done in unregister of pinctrl.

But as we are now registering stuff from gpiolib, we may
remove and insert a gpio module multiple times. So, we
need this routine again.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Viresh Kumar and committed by
Linus Walleij
7e10ee68 afa538c2

+16
+14
drivers/pinctrl/core.c
··· 346 346 EXPORT_SYMBOL_GPL(pinctrl_add_gpio_ranges); 347 347 348 348 /** 349 + * pinctrl_remove_gpio_range() - remove a range of GPIOs fro a pin controller 350 + * @pctldev: pin controller device to remove the range from 351 + * @range: the GPIO range to remove 352 + */ 353 + void pinctrl_remove_gpio_range(struct pinctrl_dev *pctldev, 354 + struct pinctrl_gpio_range *range) 355 + { 356 + mutex_lock(&pinctrl_mutex); 357 + list_del(&range->node); 358 + mutex_unlock(&pinctrl_mutex); 359 + } 360 + EXPORT_SYMBOL_GPL(pinctrl_remove_gpio_range); 361 + 362 + /** 349 363 * pinctrl_get_group_selector() - returns the group selector for a group 350 364 * @pctldev: the pin controller handling the group 351 365 * @pin_group: the pin group to look up
+2
include/linux/pinctrl/pinctrl.h
··· 134 134 extern void pinctrl_add_gpio_ranges(struct pinctrl_dev *pctldev, 135 135 struct pinctrl_gpio_range *ranges, 136 136 unsigned nranges); 137 + extern void pinctrl_remove_gpio_range(struct pinctrl_dev *pctldev, 138 + struct pinctrl_gpio_range *range); 137 139 extern const char *pinctrl_dev_get_name(struct pinctrl_dev *pctldev); 138 140 extern void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev); 139 141 #else