* [PATCH] gpio: gpio-kempld: Fix get_direction return value
@ 2015-05-11 10:46 Michael Brunner
2015-05-11 13:09 ` Guenter Roeck
2015-05-12 11:50 ` Linus Walleij
0 siblings, 2 replies; 3+ messages in thread
From: Michael Brunner @ 2015-05-11 10:46 UTC (permalink / raw)
To: linux-kernel
Cc: Linus Walleij, Alexandre Courbot, linux-gpio, Jochen Henneberg,
Michael Brunner, Darren Hart, Kevin Strasser, Guenter Roeck
This patch fixes an inverted return value of the gpio get_direction
function.
The wrong value causes the direction sysfs entry and GPIO debugfs file
to indicate incorrect GPIO direction settings. In some cases it also
prevents setting GPIO output values.
The problem is also present in all other stable kernel versions since
linux-3.12.
Reported-by: Jochen Henneberg <jh@henneberg-systemdesign.com>
Signed-off-by: Michael Brunner <michael.brunner@kontron.com>
---
drivers/gpio/gpio-kempld.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-kempld.c b/drivers/gpio/gpio-kempld.c
index 6b8115f..83f281d 100644
--- a/drivers/gpio/gpio-kempld.c
+++ b/drivers/gpio/gpio-kempld.c
@@ -117,7 +117,7 @@ static int kempld_gpio_get_direction(struct gpio_chip *chip, unsigned offset)
= container_of(chip, struct kempld_gpio_data, chip);
struct kempld_device_data *pld = gpio->pld;
- return kempld_gpio_get_bit(pld, KEMPLD_GPIO_DIR_NUM(offset), offset);
+ return !kempld_gpio_get_bit(pld, KEMPLD_GPIO_DIR_NUM(offset), offset);
}
static int kempld_gpio_pincount(struct kempld_device_data *pld)
--
1.8.5.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] gpio: gpio-kempld: Fix get_direction return value
2015-05-11 10:46 [PATCH] gpio: gpio-kempld: Fix get_direction return value Michael Brunner
@ 2015-05-11 13:09 ` Guenter Roeck
2015-05-12 11:50 ` Linus Walleij
1 sibling, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2015-05-11 13:09 UTC (permalink / raw)
To: Michael Brunner
Cc: linux-kernel, Linus Walleij, Alexandre Courbot, linux-gpio,
Jochen Henneberg, Michael Brunner, Darren Hart, Kevin Strasser
On Mon, May 11, 2015 at 12:46:49PM +0200, Michael Brunner wrote:
> This patch fixes an inverted return value of the gpio get_direction
> function.
>
> The wrong value causes the direction sysfs entry and GPIO debugfs file
> to indicate incorrect GPIO direction settings. In some cases it also
> prevents setting GPIO output values.
>
> The problem is also present in all other stable kernel versions since
> linux-3.12.
>
> Reported-by: Jochen Henneberg <jh@henneberg-systemdesign.com>
> Signed-off-by: Michael Brunner <michael.brunner@kontron.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] gpio: gpio-kempld: Fix get_direction return value
2015-05-11 10:46 [PATCH] gpio: gpio-kempld: Fix get_direction return value Michael Brunner
2015-05-11 13:09 ` Guenter Roeck
@ 2015-05-12 11:50 ` Linus Walleij
1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2015-05-12 11:50 UTC (permalink / raw)
To: Michael Brunner
Cc: linux-kernel@vger.kernel.org, Alexandre Courbot,
linux-gpio@vger.kernel.org, Jochen Henneberg, Michael Brunner,
Darren Hart, Kevin Strasser, Guenter Roeck
On Mon, May 11, 2015 at 12:46 PM, Michael Brunner <mibru@gmx.de> wrote:
> This patch fixes an inverted return value of the gpio get_direction
> function.
>
> The wrong value causes the direction sysfs entry and GPIO debugfs file
> to indicate incorrect GPIO direction settings. In some cases it also
> prevents setting GPIO output values.
>
> The problem is also present in all other stable kernel versions since
> linux-3.12.
>
> Reported-by: Jochen Henneberg <jh@henneberg-systemdesign.com>
> Signed-off-by: Michael Brunner <michael.brunner@kontron.com>
Patch applied and tagged for stable v3.12+
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-05-12 11:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-11 10:46 [PATCH] gpio: gpio-kempld: Fix get_direction return value Michael Brunner
2015-05-11 13:09 ` Guenter Roeck
2015-05-12 11:50 ` Linus Walleij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).