* [PATCH v1 1/2] pinctrl: baytrail: Use platform_get_irq_optional() explicitly
@ 2020-04-14 16:13 Andy Shevchenko
2020-04-14 16:13 ` [PATCH v1 2/2] pinctrl: lynxpoint: " Andy Shevchenko
2020-04-15 7:26 ` [PATCH v1 1/2] pinctrl: baytrail: " Mika Westerberg
0 siblings, 2 replies; 6+ messages in thread
From: Andy Shevchenko @ 2020-04-14 16:13 UTC (permalink / raw)
To: Linus Walleij, linux-gpio, Mika Westerberg; +Cc: Andy Shevchenko
There is no need to repeat functionality of platform_get_irq_optional()
in the driver. Replace it with explicit call to the helper.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/pinctrl/intel/pinctrl-baytrail.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/pinctrl/intel/pinctrl-baytrail.c b/drivers/pinctrl/intel/pinctrl-baytrail.c
index 9b821c9cbd16..0ff7c55173da 100644
--- a/drivers/pinctrl/intel/pinctrl-baytrail.c
+++ b/drivers/pinctrl/intel/pinctrl-baytrail.c
@@ -1506,8 +1506,7 @@ static int byt_gpio_probe(struct intel_pinctrl *vg)
{
struct platform_device *pdev = to_platform_device(vg->dev);
struct gpio_chip *gc;
- struct resource *irq_rc;
- int ret;
+ int irq, ret;
/* Set up gpio chip */
vg->chip = byt_gpio_chip;
@@ -1527,8 +1526,8 @@ static int byt_gpio_probe(struct intel_pinctrl *vg)
#endif
/* set up interrupts */
- irq_rc = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
- if (irq_rc && irq_rc->start) {
+ irq = platform_get_irq_optional(pdev, 0);
+ if (irq > 0) {
struct gpio_irq_chip *girq;
vg->irqchip.name = "BYT-GPIO",
@@ -1548,7 +1547,7 @@ static int byt_gpio_probe(struct intel_pinctrl *vg)
sizeof(*girq->parents), GFP_KERNEL);
if (!girq->parents)
return -ENOMEM;
- girq->parents[0] = (unsigned int)irq_rc->start;
+ girq->parents[0] = irq;
girq->default_type = IRQ_TYPE_NONE;
girq->handler = handle_bad_irq;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v1 2/2] pinctrl: lynxpoint: Use platform_get_irq_optional() explicitly
2020-04-14 16:13 [PATCH v1 1/2] pinctrl: baytrail: Use platform_get_irq_optional() explicitly Andy Shevchenko
@ 2020-04-14 16:13 ` Andy Shevchenko
2020-04-15 7:27 ` Mika Westerberg
2020-04-16 11:35 ` Linus Walleij
2020-04-15 7:26 ` [PATCH v1 1/2] pinctrl: baytrail: " Mika Westerberg
1 sibling, 2 replies; 6+ messages in thread
From: Andy Shevchenko @ 2020-04-14 16:13 UTC (permalink / raw)
To: Linus Walleij, linux-gpio, Mika Westerberg; +Cc: Andy Shevchenko
There is no need to repeat functionality of platform_get_irq_optional()
in the driver. Replace it with explicit call to the helper.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/pinctrl/intel/pinctrl-lynxpoint.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/pinctrl/intel/pinctrl-lynxpoint.c b/drivers/pinctrl/intel/pinctrl-lynxpoint.c
index e928742c7181..a45b8f2182fd 100644
--- a/drivers/pinctrl/intel/pinctrl-lynxpoint.c
+++ b/drivers/pinctrl/intel/pinctrl-lynxpoint.c
@@ -794,11 +794,11 @@ static int lp_gpio_probe(struct platform_device *pdev)
const struct intel_pinctrl_soc_data *soc;
struct intel_pinctrl *lg;
struct gpio_chip *gc;
- struct resource *io_rc, *irq_rc;
struct device *dev = &pdev->dev;
+ struct resource *io_rc;
void __iomem *regs;
unsigned int i;
- int ret;
+ int irq, ret;
soc = (const struct intel_pinctrl_soc_data *)device_get_match_data(dev);
if (!soc)
@@ -870,8 +870,8 @@ static int lp_gpio_probe(struct platform_device *pdev)
gc->parent = dev;
/* set up interrupts */
- irq_rc = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
- if (irq_rc && irq_rc->start) {
+ irq = platform_get_irq_optional(pdev, 0);
+ if (irq > 0) {
struct gpio_irq_chip *girq;
girq = &gc->irq;
@@ -884,7 +884,7 @@ static int lp_gpio_probe(struct platform_device *pdev)
GFP_KERNEL);
if (!girq->parents)
return -ENOMEM;
- girq->parents[0] = (unsigned int)irq_rc->start;
+ girq->parents[0] = irq;
girq->default_type = IRQ_TYPE_NONE;
girq->handler = handle_bad_irq;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v1 1/2] pinctrl: baytrail: Use platform_get_irq_optional() explicitly
2020-04-14 16:13 [PATCH v1 1/2] pinctrl: baytrail: Use platform_get_irq_optional() explicitly Andy Shevchenko
2020-04-14 16:13 ` [PATCH v1 2/2] pinctrl: lynxpoint: " Andy Shevchenko
@ 2020-04-15 7:26 ` Mika Westerberg
2020-04-15 15:29 ` Andy Shevchenko
1 sibling, 1 reply; 6+ messages in thread
From: Mika Westerberg @ 2020-04-15 7:26 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: Linus Walleij, linux-gpio
On Tue, Apr 14, 2020 at 07:13:37PM +0300, Andy Shevchenko wrote:
> There is no need to repeat functionality of platform_get_irq_optional()
> in the driver. Replace it with explicit call to the helper.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1 2/2] pinctrl: lynxpoint: Use platform_get_irq_optional() explicitly
2020-04-14 16:13 ` [PATCH v1 2/2] pinctrl: lynxpoint: " Andy Shevchenko
@ 2020-04-15 7:27 ` Mika Westerberg
2020-04-16 11:35 ` Linus Walleij
1 sibling, 0 replies; 6+ messages in thread
From: Mika Westerberg @ 2020-04-15 7:27 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: Linus Walleij, linux-gpio
On Tue, Apr 14, 2020 at 07:13:38PM +0300, Andy Shevchenko wrote:
> There is no need to repeat functionality of platform_get_irq_optional()
> in the driver. Replace it with explicit call to the helper.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1 1/2] pinctrl: baytrail: Use platform_get_irq_optional() explicitly
2020-04-15 7:26 ` [PATCH v1 1/2] pinctrl: baytrail: " Mika Westerberg
@ 2020-04-15 15:29 ` Andy Shevchenko
0 siblings, 0 replies; 6+ messages in thread
From: Andy Shevchenko @ 2020-04-15 15:29 UTC (permalink / raw)
To: Mika Westerberg; +Cc: Linus Walleij, linux-gpio
On Wed, Apr 15, 2020 at 10:26:51AM +0300, Mika Westerberg wrote:
> On Tue, Apr 14, 2020 at 07:13:37PM +0300, Andy Shevchenko wrote:
> > There is no need to repeat functionality of platform_get_irq_optional()
> > in the driver. Replace it with explicit call to the helper.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>
> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Both applied to my review and testing queue, thanks!
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1 2/2] pinctrl: lynxpoint: Use platform_get_irq_optional() explicitly
2020-04-14 16:13 ` [PATCH v1 2/2] pinctrl: lynxpoint: " Andy Shevchenko
2020-04-15 7:27 ` Mika Westerberg
@ 2020-04-16 11:35 ` Linus Walleij
1 sibling, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2020-04-16 11:35 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: open list:GPIO SUBSYSTEM, Mika Westerberg
On Tue, Apr 14, 2020 at 6:13 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
> There is no need to repeat functionality of platform_get_irq_optional()
> in the driver. Replace it with explicit call to the helper.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
For all Intel pinctrl patches I will occasionally review and othewise
just wait for your pull requests.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-04-16 11:35 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-14 16:13 [PATCH v1 1/2] pinctrl: baytrail: Use platform_get_irq_optional() explicitly Andy Shevchenko
2020-04-14 16:13 ` [PATCH v1 2/2] pinctrl: lynxpoint: " Andy Shevchenko
2020-04-15 7:27 ` Mika Westerberg
2020-04-16 11:35 ` Linus Walleij
2020-04-15 7:26 ` [PATCH v1 1/2] pinctrl: baytrail: " Mika Westerberg
2020-04-15 15:29 ` Andy Shevchenko
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.