linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pinctrl: iproc: improve error handling
@ 2019-10-02 22:00 Chris Packham
  2019-10-02 23:29 ` Scott Branden
  0 siblings, 1 reply; 2+ messages in thread
From: Chris Packham @ 2019-10-02 22:00 UTC (permalink / raw)
  To: linus.walleij, rjui, sbranden, bcm-kernel-feedback-list,
	rayagonda.kokatanur, li.jin
  Cc: linux-gpio, linux-arm-kernel, linux-kernel, Chris Packham

platform_get_irq() can return an error code. Allow for this when getting
the irq.  While we're here use the dev_name(dev) for the irqc->name so
that we get unique names when we have multiple instances of this driver.

Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
---
Noticed this while debugging another problem.

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

diff --git a/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c b/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c
index 6f7d3a2f2e97..c24d49d436ce 100644
--- a/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c
+++ b/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c
@@ -853,12 +853,12 @@ 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;
 
 		irqc = &chip->irqchip;
-		irqc->name = "bcm-iproc-gpio";
+		irqc->name = dev_name(dev);
 		irqc->irq_ack = iproc_gpio_irq_ack;
 		irqc->irq_mask = iproc_gpio_irq_mask;
 		irqc->irq_unmask = iproc_gpio_irq_unmask;
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] pinctrl: iproc: improve error handling
  2019-10-02 22:00 [PATCH] pinctrl: iproc: improve error handling Chris Packham
@ 2019-10-02 23:29 ` Scott Branden
  0 siblings, 0 replies; 2+ messages in thread
From: Scott Branden @ 2019-10-02 23:29 UTC (permalink / raw)
  To: Chris Packham, linus.walleij, rjui, sbranden,
	bcm-kernel-feedback-list, rayagonda.kokatanur, li.jin
  Cc: linux-gpio, linux-arm-kernel, linux-kernel

Hi Chris,

On 2019-10-02 3:00 p.m., Chris Packham wrote:
> platform_get_irq() can return an error code. Allow for this when getting
> the irq.
Above matches change in 1st line of commit.  Please add a Fixes: tag
for such fix.
>    While we're here use the dev_name(dev) for the irqc->name so
> that we get unique names when we have multiple instances of this driver.
The dev_name change should be in a different commit to keep things
bisectable.
>
> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
> ---
> Noticed this while debugging another problem.
>
>   drivers/pinctrl/bcm/pinctrl-iproc-gpio.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c b/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c
> index 6f7d3a2f2e97..c24d49d436ce 100644
> --- a/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c
> +++ b/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c
> @@ -853,12 +853,12 @@ 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;
>   
>   		irqc = &chip->irqchip;
> -		irqc->name = "bcm-iproc-gpio";
> +		irqc->name = dev_name(dev);
>   		irqc->irq_ack = iproc_gpio_irq_ack;
>   		irqc->irq_mask = iproc_gpio_irq_mask;
>   		irqc->irq_unmask = iproc_gpio_irq_unmask;
Thanks,
Scott

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-10-02 23:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-02 22:00 [PATCH] pinctrl: iproc: improve error handling Chris Packham
2019-10-02 23:29 ` Scott Branden

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).