diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mfd/sm501.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mfd/sm501.c b/drivers/mfd/sm501.c index 79d7aea5510b..7aebad4c06ff 100644 --- a/drivers/mfd/sm501.c +++ b/drivers/mfd/sm501.c | |||
@@ -1108,7 +1108,9 @@ static void sm501_gpio_remove(struct sm501_devdata *sm) | |||
1108 | static inline int sm501_gpio_pin2nr(struct sm501_devdata *sm, unsigned int pin) | 1108 | static inline int sm501_gpio_pin2nr(struct sm501_devdata *sm, unsigned int pin) |
1109 | { | 1109 | { |
1110 | struct sm501_gpio *gpio = &sm->gpio; | 1110 | struct sm501_gpio *gpio = &sm->gpio; |
1111 | return pin + (pin < 32) ? gpio->low.gpio.base : gpio->high.gpio.base; | 1111 | int base = (pin < 32) ? gpio->low.gpio.base : gpio->high.gpio.base; |
1112 | |||
1113 | return (pin % 32) + base; | ||
1112 | } | 1114 | } |
1113 | 1115 | ||
1114 | static inline int sm501_gpio_isregistered(struct sm501_devdata *sm) | 1116 | static inline int sm501_gpio_isregistered(struct sm501_devdata *sm) |