gpio-lynxpoint: force gpio_get() to return "1" and "0" only
PATCH 1/1 gpio-lynxpoint: force gpio_get() to return "1" and "0" only
Don't return the IN_LVL_BIT directly, a high gpio line returned value "1073741824" intestead of "1" because IN_LVL_BIT is BIT(30)
Tested-by Jerome Blin <[email protected]>
Signed-off-by Mathias Nyman <[email protected]>
--- drivers/gpio/gpio-lynxpoint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/gpio-lynxpoint.c +1 -1
@@ -188,7 +188,7 @@ static int lp_irq_type(struct irq_data *d, unsigned type)static int lp_gpio_get (struct gpio_chip *chip,unsigned offset) {unsigned long reg =lp_gpio_reg (chip, offset,LP_CONFIG1 ); -return inl (reg) &IN_LVL_BIT ; +return !!(inl (reg) &IN_LVL_BIT ); }static void lp_gpio_set (struct gpio_chip *chip,unsigned offset,int value)
Signature · 1 line
1.8.3.2
Quoted 5 lines · Mathias Nyman
Don't return the
IN_LVL_BITdirectly, a high gpio line returned value "1073741824" intestead of "1" becauseIN_LVL_BITis BIT(30)Tested-by Jerome Blin <[email protected]>Signed-off-by Mathias Nyman <[email protected]>
Patch applied.
Yours,
Linus Walleij