net: freescale: xgmac: Do not dereference fwnode in struct device
authorzhaoxiao <zhaoxiao@uniontech.com>
Thu, 18 Aug 2022 09:50:59 +0000 (17:50 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 22 Aug 2022 13:53:13 +0000 (14:53 +0100)
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 <zhaoxiao@uniontech.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/xgmac_mdio.c

index ec90da1..d7d39a5 100644 (file)
@@ -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))