From: Peter Korsgaard <jacmet@sunsite.dk>
Date: Mon, 10 Oct 2011 10:55:58 +0000 (+0900)
Subject: gpio/samsung: only register available gpio banks
X-Git-Tag: firefly_0821_release~3680^2~4183^2~1^2~22
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=8a8ab2e64e09b56dc1324fd2f7da12346166cad1;p=firefly-linux-kernel-4.4.55.git

gpio/samsung: only register available gpio banks

Only register gpio banks provided by SoC instead of the maximum possible
to lessen confusion, get rid of a warning from gpiolib and stop it from
eating into the extra gpios for configs with S3C24XX_GPIO_EXTRA != 0.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---

diff --git a/drivers/gpio/gpio-samsung.c b/drivers/gpio/gpio-samsung.c
index b6be77ae4973..c87b65af8c96 100644
--- a/drivers/gpio/gpio-samsung.c
+++ b/drivers/gpio/gpio-samsung.c
@@ -914,6 +914,10 @@ static void __init s3c24xx_gpiolib_add_chips(struct samsung_gpio_chip *chip,
 	struct gpio_chip *gc = &chip->chip;
 
 	for (i = 0 ; i < nr_chips; i++, chip++) {
+		/* skip banks not present on SoC */
+		if (chip->chip.base >= S3C_GPIO_END)
+			continue;
+
 		if (!chip->config)
 			chip->config = &s3c24xx_gpiocfg_default;
 		if (!chip->pm)