diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2009-07-22 00:33:06 +0200 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2009-07-29 23:47:14 +0100 |
commit | 0c997c0eaac8c68fa23719617484dae29bddaedd (patch) | |
tree | 4b12117ebb165056909cfd5033e545460671c7b4 /arch/arm/mach-s3c2410/include/mach/gpio-core.h | |
parent | f5886c7f96f2542382d3a983c5f13e03d7fc5259 (diff) |
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: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm/mach-s3c2410/include/mach/gpio-core.h')
-rw-r--r-- | arch/arm/mach-s3c2410/include/mach/gpio-core.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/mach-s3c2410/include/mach/gpio-core.h b/arch/arm/mach-s3c2410/include/mach/gpio-core.h index 8fe192081d3..f8b879a7973 100644 --- a/arch/arm/mach-s3c2410/include/mach/gpio-core.h +++ b/arch/arm/mach-s3c2410/include/mach/gpio-core.h @@ -28,7 +28,7 @@ static inline struct s3c_gpio_chip *s3c_gpiolib_getchip(unsigned int pin) return NULL; 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 */ |