gpio/rockchip: fix get_direction value handling

A patch from »gpio/pinctrl-rockchip: Fixes for the recently separated gpio/pinctrl driver« in state Mainline for linux-kernel

From: Heiko Stuebner <heiko@...> Date: Mon, 13 Sep 2021 20:24:56 +0200

Commit-Message

The function uses the newly introduced rockchip_gpio_readl_bit() which directly returns the actual value of the requeste bit. So using the existing bit-wise check for the bit inside the value will always return 0. Fix this by dropping the bit manipulation on the result. Fixes: 3bcbd1a85b68 ("gpio/rockchip: support next version gpio controller") Signed-off-by: Heiko Stuebner <heiko@...>

Patch-Comment

drivers/gpio/gpio-rockchip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

Statistics

  • 1 lines added
  • 1 lines removed

Changes

------------------------- drivers/gpio/gpio-rockchip.c -------------------------
index 16d9bf7188e3..3335bd57761d 100644
@@ -141,7 +141,7 @@ static int rockchip_gpio_get_direction(struct gpio_chip *chip,
u32 data;
data = rockchip_gpio_readl_bit(bank, offset, bank->gpio_regs->port_ddr);
- if (data & BIT(offset))
+ if (data)
return GPIO_LINE_DIRECTION_OUT;
return GPIO_LINE_DIRECTION_IN;
 
 

Recent Patches

About Us

Sed lacus. Donec lectus. Nullam pretium nibh ut turpis. Nam bibendum. In nulla tortor, elementum vel, tempor at, varius non, purus. Mauris vitae nisl nec metus placerat consectetuer.

Read More...