diff options
author | Bartosz Golaszewski <brgl@bgdev.pl> | 2017-06-09 13:41:27 +0200 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2017-06-20 09:18:51 +0200 |
commit | b6c2e77d34ff775e4cf4ca803877dafd74737551 (patch) | |
tree | 8556aea69fe6bd6c3af6f7eeef7d8fef145f6792 | |
parent | 650b57b083ef22208c1d10e554f964571221bca4 (diff) |
gpio: mockup: refuse to accept an odd number of GPIO ranges
Currently we ignore the last odd range value, since each chip is
described by two values. Be more strict and require the user to
pass an even number of ranges.
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r-- | drivers/gpio/gpio-mockup.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-mockup.c b/drivers/gpio/gpio-mockup.c index d78e8e081f5a..d95d37aeb91f 100644 --- a/drivers/gpio/gpio-mockup.c +++ b/drivers/gpio/gpio-mockup.c @@ -334,7 +334,7 @@ static int gpio_mockup_probe(struct platform_device *pdev) int ret, i, base, ngpio; char *chip_name; - if (gpio_mockup_params_nr < 2) + if (gpio_mockup_params_nr < 2 || (gpio_mockup_params_nr % 2)) return -EINVAL; chips = devm_kzalloc(dev, |