ARM: SAMSUNG: Fix additional increment when running through gpios

Previous thread: ARM: SAMSUNG: Move HWMON from plat-s3c24xx to plat-samsung by Linux Kernel Mailing List on Wednesday, May 19, 2010 - 1:02 pm. (1 message)

Next thread: ARM: S5PV210: Add GPIOlib support by Linux Kernel Mailing List on Wednesday, May 19, 2010 - 1:02 pm. (1 message)
From: Linux Kernel Mailing List
Date: Wednesday, May 19, 2010 - 1:02 pm

Gitweb:     http://git.kernel.org/linus/32b6cb3872883861f3a2669cce880f3a7ef8979a
Commit:     32b6cb3872883861f3a2669cce880f3a7ef8979a
Parent:     4ac2a39767c2a93c06b654a0bf1c635e03ff75ac
Author:     Ben Dooks <ben-linux@fluff.org>
AuthorDate: Tue May 18 19:07:05 2010 +0900
Committer:  Ben Dooks <ben-linux@fluff.org>
CommitDate: Tue May 18 19:07:05 2010 +0900

    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 <ben-linux@fluff.org>
---
 arch/arm/plat-samsung/pm-gpio.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/plat-samsung/pm-gpio.c b/arch/arm/plat-samsung/pm-gpio.c
index 69a4c7f..d50ab9d 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;
--

Previous thread: ARM: SAMSUNG: Move HWMON from plat-s3c24xx to plat-samsung by Linux Kernel Mailing List on Wednesday, May 19, 2010 - 1:02 pm. (1 message)

Next thread: ARM: S5PV210: Add GPIOlib support by Linux Kernel Mailing List on Wednesday, May 19, 2010 - 1:02 pm. (1 message)