2013-03-05 12:22:20

by Axel Lin

[permalink] [raw]
Subject: [PATCH] gpio: viperboard: Remove duplicate code to set gpio->gpiob_val

Set it once is enough, and it's done in vprbrd_gpiob_set() which is called by
vprbrd_gpiob_direction_output().

Signed-off-by: Axel Lin <[email protected]>
---
drivers/gpio/gpio-viperboard.c | 4 ----
1 file changed, 4 deletions(-)

diff --git a/drivers/gpio/gpio-viperboard.c b/drivers/gpio/gpio-viperboard.c
index 59d7239..095ab14 100644
--- a/drivers/gpio/gpio-viperboard.c
+++ b/drivers/gpio/gpio-viperboard.c
@@ -380,10 +380,6 @@ static int vprbrd_gpiob_direction_output(struct gpio_chip *chip,
struct vprbrd *vb = gpio->vb;

gpio->gpiob_out |= (1 << offset);
- if (value)
- gpio->gpiob_val |= (1 << offset);
- else
- gpio->gpiob_val &= ~(1 << offset);

mutex_lock(&vb->lock);

--
1.7.9.5



2013-03-06 10:38:17

by Lars Poeschel

[permalink] [raw]
Subject: Re: [PATCH] gpio: viperboard: Remove duplicate code to set gpio->gpiob_val

On Tuesday 05 March 2013 at 13:21:56, Axel Lin wrote:
> Set it once is enough, and it's done in vprbrd_gpiob_set() which is called
> by vprbrd_gpiob_direction_output().
>
> Signed-off-by: Axel Lin <[email protected]>

Thank you!

Tested-and-Acked-by: Lars Poeschel <[email protected]>

> ---
> drivers/gpio/gpio-viperboard.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/drivers/gpio/gpio-viperboard.c
> b/drivers/gpio/gpio-viperboard.c index 59d7239..095ab14 100644
> --- a/drivers/gpio/gpio-viperboard.c
> +++ b/drivers/gpio/gpio-viperboard.c
> @@ -380,10 +380,6 @@ static int vprbrd_gpiob_direction_output(struct
> gpio_chip *chip, struct vprbrd *vb = gpio->vb;
>
> gpio->gpiob_out |= (1 << offset);
> - if (value)
> - gpio->gpiob_val |= (1 << offset);
> - else
> - gpio->gpiob_val &= ~(1 << offset);
>
> mutex_lock(&vb->lock);

2013-03-27 08:13:47

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH] gpio: viperboard: Remove duplicate code to set gpio->gpiob_val

On Tue, Mar 5, 2013 at 1:21 PM, Axel Lin <[email protected]> wrote:

> Set it once is enough, and it's done in vprbrd_gpiob_set() which is called by
> vprbrd_gpiob_direction_output().
>
> Signed-off-by: Axel Lin <[email protected]>

Applied with Lars' Tested/Acked-by.

Thanks!
Linus Walleij