From 32b6cb3872883861f3a2669cce880f3a7ef8979a Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Tue, 18 May 2010 19:07:05 +0900 Subject: ARM: SAMSUNG: Fix additional increment when running through gpios The pm-gpio.c code was incrementing the gpio_nr from the nr_gpios field and the bank-bank offset inside the loop, and also in the for() loop with a ++. Remove the ++, as the number is already at the next GPIO, thus ensuring that we don't skip a gpio bank by accident. Signed-off-by: Ben Dooks --- arch/arm/plat-samsung/pm-gpio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/arm/plat-samsung/pm-gpio.c') diff --git a/arch/arm/plat-samsung/pm-gpio.c b/arch/arm/plat-samsung/pm-gpio.c index 69a4c7f02e25..d50ab9d2af53 100644 --- a/arch/arm/plat-samsung/pm-gpio.c +++ b/arch/arm/plat-samsung/pm-gpio.c @@ -329,7 +329,7 @@ void s3c_pm_save_gpios(void) struct s3c_gpio_chip *ourchip; unsigned int gpio_nr; - for (gpio_nr = 0; gpio_nr < S3C_GPIO_END; gpio_nr++) { + for (gpio_nr = 0; gpio_nr < S3C_GPIO_END;) { ourchip = s3c_gpiolib_getchip(gpio_nr); if (!ourchip) continue; @@ -367,7 +367,7 @@ void s3c_pm_restore_gpios(void) struct s3c_gpio_chip *ourchip; unsigned int gpio_nr; - for (gpio_nr = 0; gpio_nr < S3C_GPIO_END; gpio_nr++) { + for (gpio_nr = 0; gpio_nr < S3C_GPIO_END;) { ourchip = s3c_gpiolib_getchip(gpio_nr); if (!ourchip) continue; -- cgit v1.2.1 From 91dc74e479e1ea0bb8864694303e6fe5612b707c Mon Sep 17 00:00:00 2001 From: Pinkava J Date: Sun, 23 May 2010 06:42:26 +0200 Subject: ARM: SAMSUNG: fix suspend/resume on if some GPIO banks not present When saving GPIOs during suspend/resume we need skip missing GPIO banks, not trying get corresponding chip again and again in infinite loop. Signed-off-by: Jiri Pinkava [ben-linux@fluff.org: shorten subject] Signed-off-by: Ben Dooks --- arch/arm/plat-samsung/pm-gpio.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'arch/arm/plat-samsung/pm-gpio.c') diff --git a/arch/arm/plat-samsung/pm-gpio.c b/arch/arm/plat-samsung/pm-gpio.c index d50ab9d2af53..7df03f87fbfa 100644 --- a/arch/arm/plat-samsung/pm-gpio.c +++ b/arch/arm/plat-samsung/pm-gpio.c @@ -331,8 +331,10 @@ void s3c_pm_save_gpios(void) for (gpio_nr = 0; gpio_nr < S3C_GPIO_END;) { ourchip = s3c_gpiolib_getchip(gpio_nr); - if (!ourchip) + if (!ourchip) { + gpio_nr++; continue; + } s3c_pm_save_gpio(ourchip); @@ -369,8 +371,10 @@ void s3c_pm_restore_gpios(void) for (gpio_nr = 0; gpio_nr < S3C_GPIO_END;) { ourchip = s3c_gpiolib_getchip(gpio_nr); - if (!ourchip) + if (!ourchip) { + gpio_nr++; continue; + } s3c_pm_resume_gpio(ourchip); -- cgit v1.2.1