summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpio-aggregator.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpio/gpio-aggregator.c')
-rw-r--r--drivers/gpio/gpio-aggregator.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/gpio/gpio-aggregator.c b/drivers/gpio/gpio-aggregator.c
index 0cb2664085cf..6d17d262ad91 100644
--- a/drivers/gpio/gpio-aggregator.c
+++ b/drivers/gpio/gpio-aggregator.c
@@ -23,6 +23,7 @@
#include <linux/spinlock.h>
#include <linux/string.h>
+#define AGGREGATOR_MAX_GPIOS 512
/*
* GPIO Aggregator sysfs interface
@@ -64,7 +65,7 @@ static int aggr_parse(struct gpio_aggregator *aggr)
unsigned int i, n = 0;
int error = 0;
- bitmap = bitmap_alloc(ARCH_NR_GPIOS, GFP_KERNEL);
+ bitmap = bitmap_alloc(AGGREGATOR_MAX_GPIOS, GFP_KERNEL);
if (!bitmap)
return -ENOMEM;
@@ -84,13 +85,13 @@ static int aggr_parse(struct gpio_aggregator *aggr)
}
/* GPIO chip + offset(s) */
- error = bitmap_parselist(offsets, bitmap, ARCH_NR_GPIOS);
+ error = bitmap_parselist(offsets, bitmap, AGGREGATOR_MAX_GPIOS);
if (error) {
pr_err("Cannot parse %s: %d\n", offsets, error);
goto free_bitmap;
}
- for_each_set_bit(i, bitmap, ARCH_NR_GPIOS) {
+ for_each_set_bit(i, bitmap, AGGREGATOR_MAX_GPIOS) {
error = aggr_add_gpio(aggr, name, i, &n);
if (error)
goto free_bitmap;