Skip to contentSkip to conversation

gpio: altera-a10sr: Set proper output level for direction_output

PATCH In review Axel Lin 2 participants 2 messages Jan 23, 2019

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH v3 1/2 gpio: altera-a10sr: Set proper output level for direction_output

The altr_a10sr_gpio_direction_output should set proper output level based on the value argument.

Fixes 26a48c4cc2f1 ("gpio: altera-a10sr: Add A10 System Resource Chip GPIO support.")

Tested by: Thor Thayer <[email protected]> Reviewed by: Thor Thayer <[email protected]>
---
v3: Add Fixes tag and cc stable
v2: Based on Bartosz's comment to split the patch.
1/2 is bug fix
2/2 is coding style fix and fix checkpatch warning

 drivers/gpio/gpio-altera-a10sr.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpio/gpio-altera-a10sr.c +3 -1
index 6b11f1314248..7f9e0304b510 100644
@@ -66,8 +66,10 @@ static int altr_a10sr_gpio_direction_input(struct gpio_chip *gc,
 static int altr_a10sr_gpio_direction_output(struct gpio_chip *gc,
 					    unsigned int nr, int value)
 {
-	if (nr <= (ALTR_A10SR_OUT_VALID_RANGE_HI - ALTR_A10SR_LED_VALID_SHIFT))
+	if (nr <= (ALTR_A10SR_OUT_VALID_RANGE_HI - ALTR_A10SR_LED_VALID_SHIFT)) {
+		altr_a10sr_gpio_set(gc, nr, value);
 		return 0;
+	}
 	return -EINVAL;
 }
 
Signature · 1 line
2.17.1
#1 lore raw

śr., 23 sty 2019 o 01:01 Axel Lin <[email protected]> napisał(a):

Quoted 34 lines

The altr_a10sr_gpio_direction_output should set proper output level based on the value argument.

Fixes 26a48c4cc2f1 ("gpio: altera-a10sr: Add A10 System Resource Chip GPIO support.")

Tested by: Thor Thayer <[email protected]> Reviewed by: Thor Thayer <[email protected]>
---
v3: Add Fixes tag and cc stable
v2: Based on Bartosz's comment to split the patch.
1/2 is bug fix
2/2 is coding style fix and fix checkpatch warning

 drivers/gpio/gpio-altera-a10sr.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpio/gpio-altera-a10sr.c +3 -2
index 6b11f1314248..7f9e0304b510 100644
@@ -66,8 +66,10 @@ static int altr_a10sr_gpio_direction_input(struct gpio_chip *gc,
 static int altr_a10sr_gpio_direction_output(struct gpio_chip *gc,
                                            unsigned int nr, int value)
 {
-       if (nr <= (ALTR_A10SR_OUT_VALID_RANGE_HI - ALTR_A10SR_LED_VALID_SHIFT))
+       if (nr <= (ALTR_A10SR_OUT_VALID_RANGE_HI - ALTR_A10SR_LED_VALID_SHIFT)) {
+               altr_a10sr_gpio_set(gc, nr, value);
                return 0;
+       }
        return -EINVAL;
 }
 
--
Quoted 2 lines

2.17.1

Both applied, thanks!

Bart