summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/cirrus
diff options
context:
space:
mode:
authorRuan Jinjie <ruanjinjie@huawei.com>2023-08-01 16:31:21 +0300
committerJakub Kicinski <kuba@kernel.org>2023-08-02 22:10:39 +0300
commit497c3a5fb3ed4a59c4d3c460c70393dd609815dc (patch)
treecf8f30266a98f09a53dc1aa185b2221ac2ac350a /drivers/net/ethernet/cirrus
parentae3683a34265381cd4bc006295a091009c7215d1 (diff)
downloadlinux-497c3a5fb3ed4a59c4d3c460c70393dd609815dc.tar.xz
cirrus: cs89x0: fix the return value handle and remove redundant dev_warn() for platform_get_irq()
There is no possible for platform_get_irq() to return 0 and the return value of platform_get_irq() is more sensible to show the error reason. And there is no need to call the dev_warn() function directly to print a custom message when handling an error from platform_get_irq() function as it is going to display an appropriate error message in case of a failure. Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com> Reviewed-by: Simon Horman <horms@kernel.org> Reviewed-by: Alex Elder <elder@linaro.org> Link: https://lore.kernel.org/r/20230801133121.416319-1-ruanjinjie@huawei.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/cirrus')
-rw-r--r--drivers/net/ethernet/cirrus/cs89x0.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/ethernet/cirrus/cs89x0.c b/drivers/net/ethernet/cirrus/cs89x0.c
index 7c51fd9fc9be..d323c5c23521 100644
--- a/drivers/net/ethernet/cirrus/cs89x0.c
+++ b/drivers/net/ethernet/cirrus/cs89x0.c
@@ -1854,9 +1854,8 @@ static int __init cs89x0_platform_probe(struct platform_device *pdev)
return -ENOMEM;
dev->irq = platform_get_irq(pdev, 0);
- if (dev->irq <= 0) {
- dev_warn(&dev->dev, "interrupt resource missing\n");
- err = -ENXIO;
+ if (dev->irq < 0) {
+ err = dev->irq;
goto free;
}