As of struct gpio_chip "get" member documentation:
 * @get: returns value for signal "offset"; for output signals this
 *      returns either the value actually sensed, or zero
As in this chip, read and driven values are controlled by distinct
registers, unconditionally expose sensed values.

Signed-off-by: Vincent Pelletier <[email protected]>
---
 drivers/gpio/gpio-f7188x.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/gpio/gpio-f7188x.c b/drivers/gpio/gpio-f7188x.c
index 9a56afe..d59cccd 100644
--- a/drivers/gpio/gpio-f7188x.c
+++ b/drivers/gpio/gpio-f7188x.c
@@ -236,15 +236,10 @@ static int f7188x_gpio_get(struct gpio_chip *chip, 
unsigned offset)
        struct f7188x_gpio_bank *bank =
                container_of(chip, struct f7188x_gpio_bank, chip);
        struct f7188x_sio *sio = bank->data->sio;
-       u8 dir, data;
+       u8 data;
 
        mutex_lock(&sio->lock);
-       dir = f7188x_read8(sio, gpio_dir(bank->regbase));
-       dir = !!(dir & (1 << offset));
-       if (dir)
-               data = f7188x_read8(sio, gpio_data_out(bank->regbase));
-       else
-               data = f7188x_read8(sio, gpio_data_in(bank->regbase));
+       data = f7188x_read8(sio, gpio_data_in(bank->regbase));
        mutex_unlock(&sio->lock);
 
        return !!(data & 1 << offset);
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to