diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2017-05-25 16:08:38 +0300 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2017-05-29 11:32:22 +0200 |
commit | 923a654c186c43734cfac5d7af6940093051bcbc (patch) | |
tree | d52a8d7e1d2010d11d5caa1fd50ee931ecfff8ea /drivers/gpio | |
parent | 193d092939dd8a8de7474c888ccab3c2eccbc223 (diff) |
gpiolib: Re-use bitmap_fill() instead of open coded loop
Re-use bitmap_fill() instead of open coded loop for setting an area of
bits in a bitmap.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpiolib.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 300b1ff4513b..be8097097326 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -1,4 +1,4 @@ -#include <linux/bitops.h> +#include <linux/bitmap.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/interrupt.h> @@ -1482,8 +1482,7 @@ static int gpiochip_irqchip_init_valid_mask(struct gpio_chip *gpiochip) return -ENOMEM; /* Assume by default all GPIOs are valid */ - for (i = 0; i < gpiochip->ngpio; i++) - set_bit(i, gpiochip->irq_valid_mask); + bitmap_fill(gpiochip->irq_valid_mask, gpiochip->ngpio); return 0; } |