Commit e796cc6a authored by Arvind Yadav's avatar Arvind Yadav Committed by Kishon Vijay Abraham I

phy: cpcap-usb: Fix platform_get_irq_byname's error checking.

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.

Fixes: 6d6ce40f ("phy: cpcap-usb: Add CPCAP PMIC USB support")
Signed-off-by: default avatarArvind Yadav <arvind.yadav.cs@gmail.com>
Reviewed-by: default avatarSebastian Reichel <sebastian.reichel@collabora.co.uk>
Acked-by: default avatarTony Lindgren <tony@atomide.com>
Signed-off-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
parent 04604673
...@@ -310,7 +310,7 @@ static int cpcap_usb_init_irq(struct platform_device *pdev, ...@@ -310,7 +310,7 @@ static int cpcap_usb_init_irq(struct platform_device *pdev,
int irq, error; int irq, error;
irq = platform_get_irq_byname(pdev, name); irq = platform_get_irq_byname(pdev, name);
if (!irq) if (irq < 0)
return -ENODEV; return -ENODEV;
error = devm_request_threaded_irq(ddata->dev, irq, NULL, error = devm_request_threaded_irq(ddata->dev, irq, NULL,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment