Commit 0c997c0e authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Ben Dooks

S3C24XX: GPIO: Fix pin range check in s3c_gpiolib_getchip

In the s3c_gpiolib_getchip implementation for s3c24xx the check whether a pin is
in the gpio banks range is reversed. Thus the function returns NULL for valid
pins and the gpio chip if its not valid.

As a result gpio states are not saved/restored properly during suspend/resume.
Signed-off-by: default avatarBen Dooks <ben-linux@fluff.org>
parent f5886c7f
...@@ -28,7 +28,7 @@ static inline struct s3c_gpio_chip *s3c_gpiolib_getchip(unsigned int pin) ...@@ -28,7 +28,7 @@ static inline struct s3c_gpio_chip *s3c_gpiolib_getchip(unsigned int pin)
return NULL; return NULL;
chip = &s3c24xx_gpios[pin/32]; chip = &s3c24xx_gpios[pin/32];
return (S3C2410_GPIO_OFFSET(pin) > chip->chip.ngpio) ? chip : NULL; return (S3C2410_GPIO_OFFSET(pin) < chip->chip.ngpio) ? chip : NULL;
} }
#endif /* __ASM_ARCH_GPIO_CORE_H */ #endif /* __ASM_ARCH_GPIO_CORE_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment