2022-08-18 10:01:02

by zhaoxiao

[permalink] [raw]
Subject: [PATCH] net: freescale: xgmac: Do not dereference fwnode in struct device

In order to make the underneath API easier to change in the future,
prevent users from dereferencing fwnode from struct device.
Instead, use the specific dev_fwnode() API for that.

Signed-off-by: zhaoxiao <[email protected]>
---
drivers/net/ethernet/freescale/xgmac_mdio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/freescale/xgmac_mdio.c b/drivers/net/ethernet/freescale/xgmac_mdio.c
index ec90da1de030..d7d39a58cd80 100644
--- a/drivers/net/ethernet/freescale/xgmac_mdio.c
+++ b/drivers/net/ethernet/freescale/xgmac_mdio.c
@@ -355,7 +355,7 @@ static int xgmac_mdio_probe(struct platform_device *pdev)
if (ret)
return ret;

- fwnode = pdev->dev.fwnode;
+ fwnode = dev_fwnode(&pdev->dev);
if (is_of_node(fwnode))
ret = of_mdiobus_register(bus, to_of_node(fwnode));
else if (is_acpi_node(fwnode))
--
2.20.1


2022-08-22 14:19:40

by patchwork-bot+netdevbpf

[permalink] [raw]
Subject: Re: [PATCH] net: freescale: xgmac: Do not dereference fwnode in struct device

Hello:

This patch was applied to netdev/net-next.git (master)
by David S. Miller <[email protected]>:

On Thu, 18 Aug 2022 17:50:59 +0800 you wrote:
> In order to make the underneath API easier to change in the future,
> prevent users from dereferencing fwnode from struct device.
> Instead, use the specific dev_fwnode() API for that.
>
> Signed-off-by: zhaoxiao <[email protected]>
> ---
> drivers/net/ethernet/freescale/xgmac_mdio.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
- net: freescale: xgmac: Do not dereference fwnode in struct device
https://git.kernel.org/netdev/net-next/c/105b0468d7b2

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html