pinctrl: abx500: Fix checking if pin use AlternateFunction register
PATCH 1/1 pinctrl: abx500: Fix checking if pin use AlternateFunction register
It's pointless to check "af.alt_bit1 == UNUSED" twice.
This looks like a copy-paste bug, I think what we want is to check if *both* af.alt_bit1 and af.alt_bit2 are UNUSED.
---
Hi,
I don't have the datasheet and hw.
I'd appreciate if someone can review and test this patch.
Thanks,
Axel
drivers/pinctrl/pinctrl-abx500.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/pinctrl-abx500.c +1 -1
@@ -422,7 +422,7 @@ static u8 abx500_get_mode(struct pinctrl_dev *pctldev, struct gpio_chip *chip, }/* check if pin use AlternateFunction register */ -if ((af.alt_bit1 ==UNUSED ) && (af.alt_bit1 ==UNUSED )) +if ((af.alt_bit1 ==UNUSED ) && (af.alt_bit2 ==UNUSED ))return mode;/* * if pin GPIOSEL bit is set and pin supports alternate function,
Signature · 1 line
1.7.9.5
Quoted 5 lines · Axel Lin
It's pointless to check "af.alt_bit1 == UNUSED" twice.
This looks like a copy-paste bug, I think what we want is to check if *both* af.alt_bit1 and af.alt_bit2 are UNUSED.Signed-off-by Axel Lin <[email protected]>
Tentatively applied to fixes, waiting for Patrice to confirm...
Thanks!
Linus Walleij
Patrice CHOTARD
Acked-byQuoted 6 lines · Linus Walleij
Quoted 4 lines · Axel Lin
It's pointless to check "af.alt_bit1 == UNUSED" twice.
This looks like a copy-paste bug, I think what we want is to check if *both* af.alt_bit1 and af.alt_bit2 are UNUSED.
Quoted 6 lines
Quoted 1 line
Signed-off-by Axel Lin <[email protected]>Tentatively applied to fixes, waiting for Patrice to confirm...
Thanks!
Linus Walleij
Patrice