realtek: fix RTL8231 gpio count
authorSander Vanheule <sander@svanheule.net>
Sat, 20 Nov 2021 19:11:31 +0000 (20:11 +0100)
committerStijn Tintel <stijn@linux-ipv6.be>
Thu, 17 Feb 2022 17:11:17 +0000 (19:11 +0200)
The RTL8231's gpio_chip.ngpio was set to 36, which is the largest valid
GPIO index. Fix the allowed number of GPIOs by setting ngpio to 37, the
actual line count.

Reported-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Signed-off-by: Sander Vanheule <sander@svanheule.net>
Tested-by: Stijn Tintel <stijn@linux-ipv6.be>
target/linux/realtek/files-5.10/drivers/gpio/gpio-rtl8231.c

index f4f5621e0c1bc6e3e16cfed37fe4144c35755167..f06c2d81df79e5d371690e61d10b5e50d7142ed4 100644 (file)
@@ -312,7 +312,7 @@ static int rtl8231_gpio_probe(struct platform_device *pdev)
 
        gpios->dev = dev;
        gpios->gc.base = 160;
-       gpios->gc.ngpio = 36;
+       gpios->gc.ngpio = 37;
        gpios->gc.label = "rtl8231";
        gpios->gc.parent = dev;
        gpios->gc.owner = THIS_MODULE;