* [PATCH v2] phy: cpcap-usb: Fix platform_get_irq_byname's error checking.
@ 2017-11-17 11:25 Arvind Yadav
2017-11-17 12:35 ` Sebastian Reichel
0 siblings, 1 reply; 3+ messages in thread
From: Arvind Yadav @ 2017-11-17 11:25 UTC (permalink / raw)
To: kishon, tony, robh, dan.carpenter; +Cc: linux-kernel
The platform_get_irq_byname() function returns negative if an error occurs.
zero or positive number on success. platform_get_irq_byname() error
checking for zero is not correct.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
changes in v1 :
Patch description was not correct.
drivers/phy/motorola/phy-cpcap-usb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/phy/motorola/phy-cpcap-usb.c b/drivers/phy/motorola/phy-cpcap-usb.c
index accaaac..6601ad0 100644
--- a/drivers/phy/motorola/phy-cpcap-usb.c
+++ b/drivers/phy/motorola/phy-cpcap-usb.c
@@ -310,7 +310,7 @@ static int cpcap_usb_init_irq(struct platform_device *pdev,
int irq, error;
irq = platform_get_irq_byname(pdev, name);
- if (!irq)
+ if (irq < 0)
return -ENODEV;
error = devm_request_threaded_irq(ddata->dev, irq, NULL,
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] phy: cpcap-usb: Fix platform_get_irq_byname's error checking.
2017-11-17 11:25 [PATCH v2] phy: cpcap-usb: Fix platform_get_irq_byname's error checking Arvind Yadav
@ 2017-11-17 12:35 ` Sebastian Reichel
2017-11-17 17:13 ` Tony Lindgren
0 siblings, 1 reply; 3+ messages in thread
From: Sebastian Reichel @ 2017-11-17 12:35 UTC (permalink / raw)
To: Arvind Yadav; +Cc: kishon, tony, robh, dan.carpenter, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1178 bytes --]
Hi,
On Fri, Nov 17, 2017 at 04:55:35PM +0530, Arvind Yadav wrote:
> The platform_get_irq_byname() function returns negative if an error occurs.
> zero or positive number on success. platform_get_irq_byname() error
> checking for zero is not correct.
>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---
Fixes: 6d6ce40f63af ("phy: cpcap-usb: Add CPCAP PMIC USB support")
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
-- Sebastian
> changes in v1 :
> Patch description was not correct.
>
> drivers/phy/motorola/phy-cpcap-usb.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/phy/motorola/phy-cpcap-usb.c b/drivers/phy/motorola/phy-cpcap-usb.c
> index accaaac..6601ad0 100644
> --- a/drivers/phy/motorola/phy-cpcap-usb.c
> +++ b/drivers/phy/motorola/phy-cpcap-usb.c
> @@ -310,7 +310,7 @@ static int cpcap_usb_init_irq(struct platform_device *pdev,
> int irq, error;
>
> irq = platform_get_irq_byname(pdev, name);
> - if (!irq)
> + if (irq < 0)
> return -ENODEV;
>
> error = devm_request_threaded_irq(ddata->dev, irq, NULL,
> --
> 2.7.4
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] phy: cpcap-usb: Fix platform_get_irq_byname's error checking.
2017-11-17 12:35 ` Sebastian Reichel
@ 2017-11-17 17:13 ` Tony Lindgren
0 siblings, 0 replies; 3+ messages in thread
From: Tony Lindgren @ 2017-11-17 17:13 UTC (permalink / raw)
To: Sebastian Reichel; +Cc: Arvind Yadav, kishon, robh, dan.carpenter, linux-kernel
* Sebastian Reichel <sre@kernel.org> [171117 12:37]:
> Hi,
>
> On Fri, Nov 17, 2017 at 04:55:35PM +0530, Arvind Yadav wrote:
> > The platform_get_irq_byname() function returns negative if an error occurs.
> > zero or positive number on success. platform_get_irq_byname() error
> > checking for zero is not correct.
> >
> > Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> > ---
>
> Fixes: 6d6ce40f63af ("phy: cpcap-usb: Add CPCAP PMIC USB support")
> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Acked-by: Tony Lindgren <tony@atomide.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-11-17 17:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-17 11:25 [PATCH v2] phy: cpcap-usb: Fix platform_get_irq_byname's error checking Arvind Yadav
2017-11-17 12:35 ` Sebastian Reichel
2017-11-17 17:13 ` Tony Lindgren
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox