gpio: pca953x: Fix GPIO resource leak on Intel Galileo Gen 2
PATCH 1/1 gpio: pca953x: Fix GPIO resource leak on Intel Galileo Gen 2
When adding a quirk for IRQ on Intel Galileo Gen 2 the commit ba8c90c61847 ("gpio: pca953x: Override IRQ for one of the expanders on Galileo Gen 2") missed GPIO resource release. We can safely do this in the same quirk, since IRQ will be locked by GPIO framework when requested and unlocked on freeing.
--- drivers/gpio/gpio-pca953x.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpio/gpio-pca953x.c +6 -1
@@ -177,7 +177,12 @@ static int pca953x_acpi_get_irq(struct device *dev)if (ret)return ret; - return gpio_to_irq(pin); + ret =gpio_to_irq (pin); + +/* When pin is used as an IRQ, no need to keep it requested */ +gpio_free (pin); + + return ret; }#endif
Signature · 1 line
2.27.0.rc2
Quoted 8 lines · Andy Shevchenko
When adding a quirk for IRQ on Intel Galileo Gen 2 the commit
ba8c90c61847("gpio: pca953x: Override IRQ for one of the expanders on Galileo Gen 2") missed GPIO resource release. We can safely do this in the same quirk, since IRQ will be locked by GPIO framework when requested and unlocked on freeing.Fixes ba8c90c61847 ("gpio: pca953x: Override IRQ for one of the expanders on Galileo Gen 2")Signed-off-by Andy Shevchenko <[email protected]>Cc Mika Westerberg <[email protected]>
Quoted 8 lines · Andy Shevchenko
When adding a quirk for IRQ on Intel Galileo Gen 2 the commit
ba8c90c61847("gpio: pca953x: Override IRQ for one of the expanders on Galileo Gen 2") missed GPIO resource release. We can safely do this in the same quirk, since IRQ will be locked by GPIO framework when requested and unlocked on freeing.Fixes ba8c90c61847 ("gpio: pca953x: Override IRQ for one of the expanders on Galileo Gen 2")Signed-off-by Andy Shevchenko <[email protected]>Cc Mika Westerberg <[email protected]>
This seems to go on top of what Bartosz applied so I expect him to pick it up!
Yours,
Linus Walleij
Quoted 9 lines · Linus Walleij
Quoted 5 lines · Andy Shevchenko
When adding a quirk for IRQ on Intel Galileo Gen 2 the commit
ba8c90c61847("gpio: pca953x: Override IRQ for one of the expanders on Galileo Gen 2") missed GPIO resource release. We can safely do this in the same quirk, since IRQ will be locked by GPIO framework when requested and unlocked on freeing.
Quoted 6 lines
Quoted 3 lines
Fixes ba8c90c61847 ("gpio: pca953x: Override IRQ for one of the expanders on Galileo Gen 2")Signed-off-by Andy Shevchenko <[email protected]>Cc Mika Westerberg <[email protected]>This seems to go on top of what Bartosz applied so I expect him to pick it up!
Yes, that's what is expected.
Quoted 1 line
Reviewed-by Linus Walleij <[email protected]>
Thanks!
Signature · 2 lines
With Best Regards, Andy Shevchenko
niedz., 21 cze 2020 o 10:23 Andy Shevchenko
<[email protected]> napisał(a):
Quoted 20 lines · Linus Walleij
Quoted 9 lines
Quoted 5 lines · Andy Shevchenko
When adding a quirk for IRQ on Intel Galileo Gen 2 the commit
ba8c90c61847("gpio: pca953x: Override IRQ for one of the expanders on Galileo Gen 2") missed GPIO resource release. We can safely do this in the same quirk, since IRQ will be locked by GPIO framework when requested and unlocked on freeing.Quoted 6 lines
Quoted 3 lines
Fixes ba8c90c61847 ("gpio: pca953x: Override IRQ for one of the expanders on Galileo Gen 2")Signed-off-by Andy Shevchenko <[email protected]>Cc Mika Westerberg <[email protected]>This seems to go on top of what Bartosz applied so I expect him to pick it up!
Yes, that's what is expected.
Quoted 7 lines
Quoted 1 line
Reviewed-by Linus Walleij <[email protected]>Thanks!
--
With Best Regards,
Andy Shevchenko
Applied for fixes. I'll send a PR to Linus later this week.
Bart