Skip to content

Commit

Permalink
S3C24XX: GPIO: Fix pin range check in s3c_gpiolib_getchip
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lars-Peter Clausen authored and Ben Dooks committed Jul 29, 2009
1 parent f5886c7 commit 0c997c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/arm/mach-s3c2410/include/mach/gpio-core.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

0 comments on commit 0c997c0

Please sign in to comment.