generic: ar8216: add device struct into struct ar8xxx_priv
authorChuanhong Guo <gch981213@gmail.com>
Thu, 10 Jan 2019 05:23:42 +0000 (13:23 +0800)
committerPetr Štetiar <ynezz@true.cz>
Sun, 24 Mar 2019 00:44:25 +0000 (01:44 +0100)
dev has been taken up by switch_dev so it's named pdev instead.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
target/linux/generic/files/drivers/net/phy/ar8216.c
target/linux/generic/files/drivers/net/phy/ar8216.h
target/linux/generic/files/drivers/net/phy/ar8327.c

index fa33c2032b59e60f459a202cec702f3ff3dc194c..10bdf523531b1655188487dc29f4b905e171d60b 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/skbuff.h>
 #include <linux/netdevice.h>
 #include <linux/netlink.h>
+#include <linux/of_device.h>
 #include <linux/bitops.h>
 #include <net/genetlink.h>
 #include <linux/switch.h>
@@ -2205,6 +2206,7 @@ ar8xxx_phy_probe(struct phy_device *phydev)
        }
 
        priv->mii_bus = phydev->mdio.bus;
+       priv->pdev = &phydev->mdio.dev;
 
        ret = ar8xxx_probe_switch(priv);
        if (ret)
index 33f505cbe2e6d9fb8be0aca603f0ef73c4e88da4..140c217c7ce7ce776cb4dfa4540cad5f3a29ee30 100644 (file)
@@ -424,6 +424,7 @@ struct ar8xxx_priv {
        struct switch_dev dev;
        struct mii_bus *mii_bus;
        struct phy_device *phy;
+       struct device *pdev;
 
        int (*get_port_link)(unsigned port);
 
index 6c33229143eed185f7b0e197fb2eef6f6e7e7d90..36a4520678f9c8fd1447dfa1a8d4e223801840a3 100644 (file)
@@ -662,8 +662,8 @@ ar8327_hw_init(struct ar8xxx_priv *priv)
        if (!priv->chip_data)
                return -ENOMEM;
 
-       if (priv->phy->mdio.dev.of_node)
-               ret = ar8327_hw_config_of(priv, priv->phy->mdio.dev.of_node);
+       if (priv->pdev->of_node)
+               ret = ar8327_hw_config_of(priv, priv->pdev->of_node);
        else
                ret = ar8327_hw_config_pdata(priv,
                                             priv->phy->mdio.dev.platform_data);