diff options
author | Zhu Wang <wangzhu9@huawei.com> | 2023-08-03 16:29:00 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-08-04 11:10:33 +0100 |
commit | 86b7e033d684a9d4ca20ad8e6f8b9300cf99668f (patch) | |
tree | c870fde83aa110c14c0a201be12a93ff7178a46a /drivers/net/ethernet/microchip/lan966x | |
parent | 7740bb882fdea16b2f3a4d3804827b910f44206c (diff) |
net: lan966x: Do not check 0 for platform_get_irq_byname()
Since platform_get_irq_byname() never returned zero, so it need not to
check whether it returned zero, it returned -EINVAL or -ENXIO when
failed, so we replace the return error code with the result it returned.
Signed-off-by: Zhu Wang <wangzhu9@huawei.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/microchip/lan966x')
-rw-r--r-- | drivers/net/ethernet/microchip/lan966x/lan966x_main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c index 4a1acc7234f6..0d6e79af2410 100644 --- a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c @@ -1119,8 +1119,8 @@ static int lan966x_probe(struct platform_device *pdev) /* set irq */ lan966x->xtr_irq = platform_get_irq_byname(pdev, "xtr"); - if (lan966x->xtr_irq <= 0) - return -EINVAL; + if (lan966x->xtr_irq < 0) + return lan966x->xtr_irq; err = devm_request_threaded_irq(&pdev->dev, lan966x->xtr_irq, NULL, lan966x_xtr_irq_handler, IRQF_ONESHOT, |