Skip to content

Commit

Permalink
net: lan966x: Do not check 0 for platform_get_irq_byname()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Zhu Wang authored and David S. Miller committed Aug 4, 2023
1 parent 7740bb8 commit 86b7e03
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/microchip/lan966x/lan966x_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 86b7e03

Please sign in to comment.