From 0bda96c5fe3064c71f190bc484e2ce59c51d5585 Mon Sep 17 00:00:00 2001 From: Jae Hyun Yoo Date: Fri, 19 Jul 2019 12:54:38 -0700 Subject: [PATCH] gpio: aspeed: temporary fix for gpiochip range setting Since we are still using fixed indices for gpio line numbers for sysfs interface, this commit set the gpiochip range as fixed temporariliy til we replace all index based gpio uses with name based uses. Signed-off-by: Jae Hyun Yoo --- drivers/gpio/gpio-aspeed.c | 2 +- drivers/gpio/sgpio-aspeed.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpio-aspeed.c b/drivers/gpio/gpio-aspeed.c index 39c50c53dae3..05945470bd89 100644 --- a/drivers/gpio/gpio-aspeed.c +++ b/drivers/gpio/gpio-aspeed.c @@ -1181,7 +1181,7 @@ static int __init aspeed_gpio_probe(struct platform_device *pdev) gpio->chip.set = aspeed_gpio_set; gpio->chip.set_config = aspeed_gpio_set_config; gpio->chip.label = dev_name(&pdev->dev); - gpio->chip.base = -1; + gpio->chip.base = 0; /* Allocate a cache of the output registers */ banks = DIV_ROUND_UP(gpio->chip.ngpio, 32); diff --git a/drivers/gpio/sgpio-aspeed.c b/drivers/gpio/sgpio-aspeed.c index 5028e9144a75..850539da43f5 100644 --- a/drivers/gpio/sgpio-aspeed.c +++ b/drivers/gpio/sgpio-aspeed.c @@ -681,7 +681,7 @@ static int __init aspeed_sgpio_probe(struct platform_device *pdev) gpio->chip.set = aspeed_sgpio_set; gpio->chip.set_config = aspeed_sgpio_set_config; gpio->chip.label = dev_name(&pdev->dev); - gpio->chip.base = -1; + gpio->chip.base = gpio->config->nr_pgpios; rc = aspeed_sgpio_setup_irqs(gpio, pdev); if (rc < 0) -- 2.7.4