[openwrt/openwrt] realtek: fix RTL8231 gpio count

LEDE Commits lede-commits at lists.infradead.org
Thu Feb 17 09:12:50 PST 2022


stintel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/851212a71454735ebabf401d07845a642700e11e

commit 851212a71454735ebabf401d07845a642700e11e
Author: Sander Vanheule <sander at svanheule.net>
AuthorDate: Sat Nov 20 20:11:31 2021 +0100

    realtek: fix RTL8231 gpio count
    
    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 at gmail.com>
    Signed-off-by: Sander Vanheule <sander at svanheule.net>
    Tested-by: Stijn Tintel <stijn at linux-ipv6.be>
---
 target/linux/realtek/files-5.10/drivers/gpio/gpio-rtl8231.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/realtek/files-5.10/drivers/gpio/gpio-rtl8231.c b/target/linux/realtek/files-5.10/drivers/gpio/gpio-rtl8231.c
index f4f5621e0c..f06c2d81df 100644
--- a/target/linux/realtek/files-5.10/drivers/gpio/gpio-rtl8231.c
+++ b/target/linux/realtek/files-5.10/drivers/gpio/gpio-rtl8231.c
@@ -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;



More information about the lede-commits mailing list