Skip to contentSkip to conversation

pinctrl: abx500: Fix checking if pin use AlternateFunction register

PATCH In review Axel Lin 3 participants 3 messages Mar 5, 2013 – Mar 13, 2013 Pin control

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

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
index e8abc3c..0cf3fa4 100644
@@ -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
#1 lore raw
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.

Tentatively applied to fixes, waiting for Patrice to confirm...

Thanks!
Linus Walleij

#2 lore raw
Quoted 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

Tentatively applied to fixes, waiting for Patrice to confirm...

Thanks!
Linus Walleij

Patrice