Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxi
[platform/kernel/u-boot.git] / drivers / net / tsec.c
index beca886..519ea14 100644 (file)
@@ -156,7 +156,7 @@ static int tsec_mcast_addr(struct udevice *dev, const u8 *mcast_mac, int join)
        return 0;
 }
 
-static int __maybe_unused tsec_set_promisc(struct udevice *dev, bool enable)
+static int tsec_set_promisc(struct udevice *dev, bool enable)
 {
        struct tsec_private *priv = dev_get_priv(dev);
        struct tsec __iomem *regs = priv->regs;
@@ -834,7 +834,6 @@ int tsec_probe(struct udevice *dev)
        struct ofnode_phandle_args phandle_args;
        u32 tbiaddr = CONFIG_SYS_TBIPA_VALUE;
        struct tsec_data *data;
-       const char *phy_mode;
        ofnode parent, child;
        fdt_addr_t reg;
        u32 max_speed;
@@ -894,12 +893,8 @@ int tsec_probe(struct udevice *dev)
 
        priv->tbiaddr = tbiaddr;
 
-       phy_mode = dev_read_prop(dev, "phy-connection-type", NULL);
-       if (!phy_mode)
-               phy_mode = dev_read_prop(dev, "phy-mode", NULL);
-       if (phy_mode)
-               pdata->phy_interface = phy_get_interface_by_name(phy_mode);
-       if (pdata->phy_interface == -1)
+       pdata->phy_interface = dev_read_phy_mode(dev);
+       if (pdata->phy_interface == PHY_INTERFACE_MODE_NA)
                pdata->phy_interface = tsec_get_interface(priv);
 
        priv->interface = pdata->phy_interface;