* [PATCH -next] net: lan966x: Do not check 0 for platform_get_irq_byname()
@ 2023-08-03 8:29 Zhu Wang
2023-08-03 14:32 ` Simon Horman
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Zhu Wang @ 2023-08-03 8:29 UTC (permalink / raw)
To: horatiu.vultur, UNGLinuxDriver, davem, edumazet, kuba, pabeni,
netdev
Cc: wangzhu9
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>
---
drivers/net/ethernet/microchip/lan966x/lan966x_main.c | 4 ++--
1 file 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 fbb0bb4594cd..824961ec1370 100644
--- a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c
+++ b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c
@@ -1108,8 +1108,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,
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH -next] net: lan966x: Do not check 0 for platform_get_irq_byname()
2023-08-03 8:29 [PATCH -next] net: lan966x: Do not check 0 for platform_get_irq_byname() Zhu Wang
@ 2023-08-03 14:32 ` Simon Horman
2023-08-03 19:41 ` Horatiu Vultur
2023-08-04 10:20 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2023-08-03 14:32 UTC (permalink / raw)
To: Zhu Wang
Cc: horatiu.vultur, UNGLinuxDriver, davem, edumazet, kuba, pabeni,
netdev
On Thu, Aug 03, 2023 at 04:29:00PM +0800, Zhu Wang wrote:
> 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>
For non-bugfix Networking patches, it is appropriate to
designate the target tree as 'net-next' rather than '-next'.
(For bug fixes 'net' is appropriate).
Link: https://docs.kernel.org/process/maintainer-netdev.html
Otherwise, this looks fine to me.
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH -next] net: lan966x: Do not check 0 for platform_get_irq_byname()
2023-08-03 8:29 [PATCH -next] net: lan966x: Do not check 0 for platform_get_irq_byname() Zhu Wang
2023-08-03 14:32 ` Simon Horman
@ 2023-08-03 19:41 ` Horatiu Vultur
2023-08-04 10:20 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Horatiu Vultur @ 2023-08-03 19:41 UTC (permalink / raw)
To: Zhu Wang; +Cc: UNGLinuxDriver, davem, edumazet, kuba, pabeni, netdev
The 08/03/2023 16:29, Zhu Wang wrote:
> [Some people who received this message don't often get email from wangzhu9@huawei.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> 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: Horatiu Vultur <horatiu.vultur@microchip.com>
> ---
> drivers/net/ethernet/microchip/lan966x/lan966x_main.c | 4 ++--
> 1 file 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 fbb0bb4594cd..824961ec1370 100644
> --- a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c
> +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c
> @@ -1108,8 +1108,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,
> --
> 2.17.1
>
--
/Horatiu
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH -next] net: lan966x: Do not check 0 for platform_get_irq_byname()
2023-08-03 8:29 [PATCH -next] net: lan966x: Do not check 0 for platform_get_irq_byname() Zhu Wang
2023-08-03 14:32 ` Simon Horman
2023-08-03 19:41 ` Horatiu Vultur
@ 2023-08-04 10:20 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-08-04 10:20 UTC (permalink / raw)
To: Zhu Wang
Cc: horatiu.vultur, UNGLinuxDriver, davem, edumazet, kuba, pabeni,
netdev
Hello:
This patch was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:
On Thu, 3 Aug 2023 16:29:00 +0800 you wrote:
> 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>
> ---
> drivers/net/ethernet/microchip/lan966x/lan966x_main.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Here is the summary with links:
- [-next] net: lan966x: Do not check 0 for platform_get_irq_byname()
https://git.kernel.org/netdev/net-next/c/86b7e033d684
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-08-04 10:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-03 8:29 [PATCH -next] net: lan966x: Do not check 0 for platform_get_irq_byname() Zhu Wang
2023-08-03 14:32 ` Simon Horman
2023-08-03 19:41 ` Horatiu Vultur
2023-08-04 10:20 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).