Skip to content

Commit b22a470

Browse files
mmindbrgl
authored andcommitted
gpio/rockchip: fix get_direction value handling
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: 3bcbd1a ("gpio/rockchip: support next version gpio controller") Signed-off-by: Heiko Stuebner <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent 0f562b7 commit b22a470

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpio/gpio-rockchip.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ static int rockchip_gpio_get_direction(struct gpio_chip *chip,
141141
u32 data;
142142

143143
data = rockchip_gpio_readl_bit(bank, offset, bank->gpio_regs->port_ddr);
144-
if (data & BIT(offset))
144+
if (data)
145145
return GPIO_LINE_DIRECTION_OUT;
146146

147147
return GPIO_LINE_DIRECTION_IN;

0 commit comments

Comments
 (0)