summaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpiolib-of.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2022-04-08 20:18:50 +0200
committerBartosz Golaszewski <brgl@bgdev.pl>2022-04-09 22:37:48 +0200
commit57017edd46f835c85642fe8299f13b0db61d4c31 (patch)
tree81235681e68566e5b4717ba9d0cdc4782f3a209e /drivers/gpio/gpiolib-of.c
parentgpiolib: Move error message out of a spinlock (diff)
downloadlinux-57017edd46f835c85642fe8299f13b0db61d4c31.tar.xz
linux-57017edd46f835c85642fe8299f13b0db61d4c31.zip
gpiolib: Embed iterator variable into for_each_gpio_desc_with_flag()
The iterator loop is used exclusively to get a descriptor, which in its turn is what is being used by the caller. Embed the iterator variable into the loop in the for_each_gpio_desc_with_flag() macro helper. Suggested-by: Bartosz Golaszewski <brgl@bgdev.pl> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Diffstat (limited to 'drivers/gpio/gpiolib-of.c')
-rw-r--r--drivers/gpio/gpiolib-of.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
index ae1ce319cd78..47c0e07802d6 100644
--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
@@ -712,9 +712,8 @@ static void of_gpiochip_remove_hog(struct gpio_chip *chip,
struct device_node *hog)
{
struct gpio_desc *desc;
- unsigned int i;
- for_each_gpio_desc_with_flag(i, chip, desc, FLAG_IS_HOGGED)
+ for_each_gpio_desc_with_flag(chip, desc, FLAG_IS_HOGGED)
if (desc->hog == hog)
gpiochip_free_own_desc(desc);
}