Commit 86b7e033 authored by Zhu Wang's avatar Zhu Wang Committed by David S. Miller
Browse files

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: default avatarZhu Wang <wangzhu9@huawei.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Reviewed-by: default avatarHoratiu Vultur <horatiu.vultur@microchip.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7740bb88
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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,