Skip to contentSkip to conversation

gpio: s3c2440_gpio: Fix wrong writel arguments

PATCH New Axel Lin 3 participants 3 messages Jun 15, 2013 – Jun 25, 2013

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 gpio: s3c2440_gpio: Fix wrong writel arguments

Current code had writel arguments the wrong way around, fix it.

---
Hi,
I don't have this hardware to test, but current code looks obviously wrong. I'd appreciate if someone can review and test this patch.

Axel

 drivers/gpio/s3c2440_gpio.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpio/s3c2440_gpio.c +3 -3
index 43bbf11..09b04eb 100644
@@ -61,7 +61,7 @@ int gpio_set_value(unsigned gpio, int value)
 	else
 		l &= ~bit;
 
-	return writel(port, l);
+	return writel(l, port);
 }
 
 int gpio_get_value(unsigned gpio)
@@ -85,11 +85,11 @@ int gpio_free(unsigned gpio)
 
 int gpio_direction_input(unsigned gpio)
 {
-	return writel(GPIO_FULLPORT(gpio), GPIO_INPUT << GPIO_BIT(gpio));
+	return writel(GPIO_INPUT << GPIO_BIT(gpio), GPIO_FULLPORT(gpio));
 }
 
 int gpio_direction_output(unsigned gpio, int value)
 {
-	writel(GPIO_FULLPORT(gpio), GPIO_OUTPUT << GPIO_BIT(gpio));
+	writel(GPIO_OUTPUT << GPIO_BIT(gpio), GPIO_FULLPORT(gpio));
 	return gpio_set_value(gpio, value);
 }
Signature · 1 line
1.8.1.2
#1 lore raw

PATCH 1/1 gpio: s3c2440_gpio: Fix wrong writel arguments

Dear Axel Lin,

Quoted 12 lines

Current code had writel arguments the wrong way around, fix it.

---
Hi,
I don't have this hardware to test, but current code looks obviously wrong. I'd appreciate if someone can review and test this patch.

Axel

 drivers/gpio/s3c2440_gpio.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Best regards,
Marek Vasut

#2 lore raw

PATCH 1/1 gpio: s3c2440_gpio: Fix wrong writel arguments

In reply to Axel Lin
Quoted 30 lines · Axel Lin

Current code had writel arguments the wrong way around, fix it.

---
Hi,
I don't have this hardware to test, but current code looks obviously wrong. I'd appreciate if someone can review and test this patch.

Axel

 drivers/gpio/s3c2440_gpio.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpio/s3c2440_gpio.c +1 -1
index 43bbf11..09b04eb 100644
@@ -61,7 +61,7 @@ int gpio_set_value(unsigned gpio, int value)
 	else
 		l &= ~bit;
 
-	return writel(port, l);
+	return writel(l, port);
 }
 
 int gpio_get_value(unsigned gpio)
@@ -85,11 +85,11 @@ int gpio_free(unsigned gpio)
 
 int gpio_direction_input(unsigned gpio)
 {

drivers/gpio/s3c2440_gpio.c int gpio_free(unsigned gpio) · line 95

Quoted 10 lines
drivers/gpio/s3c2440_gpio.c +2 -2
-	return writel(GPIO_FULLPORT(gpio), GPIO_INPUT << GPIO_BIT(gpio));
+	return writel(GPIO_INPUT << GPIO_BIT(gpio), GPIO_FULLPORT(gpio));
 }
 
 int gpio_direction_output(unsigned gpio, int value)
 {
-	writel(GPIO_FULLPORT(gpio), GPIO_OUTPUT << GPIO_BIT(gpio));
+	writel(GPIO_OUTPUT << GPIO_BIT(gpio), GPIO_FULLPORT(gpio));
 	return gpio_set_value(gpio, value);
 }

applied to u-boot-samsung.

Thanks,
Minkyu Kang.