2019-10-03 00:33:23

by Chris Packham

[permalink] [raw]
Subject: [PATCH v2 0/2] pinctrl: iproc: improve error handling

I noticed these when debugging another issue. The first patch is a fix
to address some error handling. The second is just cosmetic.

Changes in v2:
- split bug-fix from cosmetic change

Chris Packham (2):
pinctrl: iproc: allow for error from platform_get_irq()
pinctrl: iproc: use unique name for irq chip

drivers/pinctrl/bcm/pinctrl-iproc-gpio.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

--
2.23.0


2019-10-03 00:33:28

by Chris Packham

[permalink] [raw]
Subject: [PATCH v2 1/2] pinctrl: iproc: allow for error from platform_get_irq()

platform_get_irq() can return an error code. Allow for this when getting
the irq.

Fixes: 6f265e5d4da7 ("pinctrl: bcm-iproc: Pass irqchip when adding gpiochip")
Signed-off-by: Chris Packham <[email protected]>
---
drivers/pinctrl/bcm/pinctrl-iproc-gpio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c b/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c
index 6f7d3a2f2e97..8971fc54e974 100644
--- a/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c
+++ b/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c
@@ -853,7 +853,7 @@ static int iproc_gpio_probe(struct platform_device *pdev)

/* optional GPIO interrupt support */
irq = platform_get_irq(pdev, 0);
- if (irq) {
+ if (irq > 0) {
struct irq_chip *irqc;
struct gpio_irq_chip *girq;

--
2.23.0

2019-10-03 19:10:53

by Scott Branden

[permalink] [raw]
Subject: Re: [PATCH v2 1/2] pinctrl: iproc: allow for error from platform_get_irq()

Thanks for fix.

On 2019-10-02 5:03 p.m., Chris Packham wrote:
> platform_get_irq() can return an error code. Allow for this when getting
> the irq.
>
> Fixes: 6f265e5d4da7 ("pinctrl: bcm-iproc: Pass irqchip when adding gpiochip")
> Signed-off-by: Chris Packham <[email protected]>
Acked-by: Scott Branden <[email protected]>
> ---
> drivers/pinctrl/bcm/pinctrl-iproc-gpio.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c b/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c
> index 6f7d3a2f2e97..8971fc54e974 100644
> --- a/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c
> +++ b/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c
> @@ -853,7 +853,7 @@ static int iproc_gpio_probe(struct platform_device *pdev)
>
> /* optional GPIO interrupt support */
> irq = platform_get_irq(pdev, 0);
> - if (irq) {
> + if (irq > 0) {
> struct irq_chip *irqc;
> struct gpio_irq_chip *girq;
>

2019-10-05 16:38:37

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH v2 1/2] pinctrl: iproc: allow for error from platform_get_irq()

On Thu, Oct 3, 2019 at 2:03 AM Chris Packham
<[email protected]> wrote:

> platform_get_irq() can return an error code. Allow for this when getting
> the irq.
>
> Fixes: 6f265e5d4da7 ("pinctrl: bcm-iproc: Pass irqchip when adding gpiochip")
> Signed-off-by: Chris Packham <[email protected]>

Patch applied for fixes.

Yours,
Linus Walleij