* [PATCH net-next v1 1/1] net: phy: Refactor fwnode_get_phy_node()
@ 2025-04-30 14:38 Andy Shevchenko
2025-05-06 0:01 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2025-04-30 14:38 UTC (permalink / raw)
To: Heiner Kallweit, netdev, linux-kernel
Cc: Andrew Lunn, Russell King, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Andy Shevchenko
Refactor to check if the fwnode we got is correct and return if so,
otherwise do additional checks. Using same pattern in all conditionals
makes it slightly easier to read and understand.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/net/phy/phy_device.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index f85c172c446c..2eb735e68dd8 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -3265,12 +3265,12 @@ struct fwnode_handle *fwnode_get_phy_node(const struct fwnode_handle *fwnode)
/* Only phy-handle is used for ACPI */
phy_node = fwnode_find_reference(fwnode, "phy-handle", 0);
- if (is_acpi_node(fwnode) || !IS_ERR(phy_node))
+ if (!IS_ERR(phy_node) || is_acpi_node(fwnode))
return phy_node;
phy_node = fwnode_find_reference(fwnode, "phy", 0);
- if (IS_ERR(phy_node))
- phy_node = fwnode_find_reference(fwnode, "phy-device", 0);
- return phy_node;
+ if (!IS_ERR(phy_node))
+ return phy_node;
+ return fwnode_find_reference(fwnode, "phy-device", 0);
}
EXPORT_SYMBOL_GPL(fwnode_get_phy_node);
--
2.47.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next v1 1/1] net: phy: Refactor fwnode_get_phy_node()
2025-04-30 14:38 [PATCH net-next v1 1/1] net: phy: Refactor fwnode_get_phy_node() Andy Shevchenko
@ 2025-05-06 0:01 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-05-06 0:01 UTC (permalink / raw)
To: Andy Shevchenko
Cc: hkallweit1, netdev, linux-kernel, andrew, linux, davem, edumazet,
kuba, pabeni
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Wed, 30 Apr 2025 17:38:02 +0300 you wrote:
> Refactor to check if the fwnode we got is correct and return if so,
> otherwise do additional checks. Using same pattern in all conditionals
> makes it slightly easier to read and understand.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> drivers/net/phy/phy_device.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
Here is the summary with links:
- [net-next,v1,1/1] net: phy: Refactor fwnode_get_phy_node()
https://git.kernel.org/netdev/net-next/c/1f586017f517
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] 2+ messages in thread
end of thread, other threads:[~2025-05-06 0:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-30 14:38 [PATCH net-next v1 1/1] net: phy: Refactor fwnode_get_phy_node() Andy Shevchenko
2025-05-06 0:01 ` 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