Skip to contentSkip to conversation

ppc4xx: Fix problem in gpio_config()

PATCH New Stefan Roese 1 participant 1 message Jun 23, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ppc4xx: Fix problem in gpio_config()

As pointed out by Guennadi Liakhovetski (thanks), pin2 is already shifted left by one. So the additional shift is bogus.

---
 cpu/ppc4xx/gpio.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
cpu/ppc4xx/gpio.c +2 -2
index 37d3fa8..df99f53 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2007
+ * (C) Copyright 2007-2008
  * Stefan Roese, DENX Software Engineering, sr at denx.de.
  *
  * See file CREDITS for list of people who contributed to this
@@ -52,7 +52,7 @@ void gpio_config(int pin, int in_out, int gpio_alt, int out_val)
 	}
 
 	mask = 0x80000000 >> pin;
-	mask2 = 0xc0000000 >> (pin2 << 1);
+	mask2 = 0xc0000000 >> pin2;
 
 	/* first set TCR to 0 */
 	out_be32((void *)GPIO0_TCR + offs, in_be32((void *)GPIO0_TCR + offs) & ~mask);
Signature · 1 line
1.5.6