提交 b6c2e77d 编写于 作者: B Bartosz Golaszewski 提交者: Linus Walleij

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: NBartosz Golaszewski <brgl@bgdev.pl>
Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
上级 650b57b0
......@@ -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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册