diff mbox

[RFT] gpio: exar: Set proper output level in exar_direction_output

Message ID 20170226143658.24036-1-axel.lin@ingics.com
State New
Headers show

Commit Message

Axel Lin Feb. 26, 2017, 2:36 p.m. UTC
Current code does not set output level in exar_direction_output, fix it.
Also move the direction_output/direction_input code block to avoid forward
declaration for exar_set_value().

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
Hi Sudip,
I don't have this h/w, so please review and test if this patch works.
thanks,
Axel
 drivers/gpio/gpio-exar.c | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

Comments

Linus Walleij March 14, 2017, 1:56 p.m. UTC | #1
On Sun, Feb 26, 2017 at 3:36 PM, Axel Lin <axel.lin@ingics.com> wrote:

> Current code does not set output level in exar_direction_output, fix it.
> Also move the direction_output/direction_input code block to avoid forward
> declaration for exar_set_value().
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
> Hi Sudip,
> I don't have this h/w, so please review and test if this patch works.
> thanks,
> Axel

Patch applied.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/gpio/gpio-exar.c b/drivers/gpio/gpio-exar.c
index 05c8946..0810767 100644
--- a/drivers/gpio/gpio-exar.c
+++ b/drivers/gpio/gpio-exar.c
@@ -59,17 +59,6 @@  static int exar_set_direction(struct gpio_chip *chip, int direction,
 	return 0;
 }
 
-static int exar_direction_output(struct gpio_chip *chip, unsigned int offset,
-				 int value)
-{
-	return exar_set_direction(chip, 0, offset);
-}
-
-static int exar_direction_input(struct gpio_chip *chip, unsigned int offset)
-{
-	return exar_set_direction(chip, 1, offset);
-}
-
 static int exar_get(struct gpio_chip *chip, unsigned int reg)
 {
 	struct exar_gpio_chip *exar_gpio = gpiochip_get_data(chip);
@@ -116,6 +105,18 @@  static void exar_set_value(struct gpio_chip *chip, unsigned int offset,
 	exar_update(chip, addr, value, offset % 8);
 }
 
+static int exar_direction_output(struct gpio_chip *chip, unsigned int offset,
+				 int value)
+{
+	exar_set_value(chip, offset, value);
+	return exar_set_direction(chip, 0, offset);
+}
+
+static int exar_direction_input(struct gpio_chip *chip, unsigned int offset)
+{
+	return exar_set_direction(chip, 1, offset);
+}
+
 static int gpio_exar_probe(struct platform_device *pdev)
 {
 	struct pci_dev *pcidev = platform_get_drvdata(pdev);