gpio: gpio-aspeed-sgpio: Return error if ngpios is not multiple of 8.
authorSteven Lee <steven_lee@aspeedtech.com>
Mon, 12 Jul 2021 10:03:16 +0000 (18:03 +0800)
committerBartosz Golaszewski <bgolaszewski@baylibre.com>
Thu, 5 Aug 2021 19:16:54 +0000 (21:16 +0200)
commitf43837f4f63b1a58084d7147b8b34c0f3dd261f6
tree3908b4e379d24c4e429e72775980c5fad1442809
parent1f857b675237d77590d439f16c5927ec3e4b1f0e
gpio: gpio-aspeed-sgpio: Return error if ngpios is not multiple of 8.

Add an else-if condition in the probe function to check whether ngpios is
multiple of 8.
Per AST datasheet, numbers of available serial GPIO pins in Serial GPIO
Configuration Register must be n bytes. For instance, if n = 1, it means
AST SoC supports 8 GPIO pins.

Signed-off-by: Steven Lee <steven_lee@aspeedtech.com>
Reviewed-by: Andrew Jeffery <andrew@aj.id.au>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
drivers/gpio/gpio-aspeed-sgpio.c