diff options
Diffstat (limited to 'drivers/net/sni_ave.c')
-rw-r--r-- | drivers/net/sni_ave.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/net/sni_ave.c b/drivers/net/sni_ave.c index ab51552..0a368c6 100644 --- a/drivers/net/sni_ave.c +++ b/drivers/net/sni_ave.c @@ -738,7 +738,6 @@ static int ave_of_to_plat(struct udevice *dev) struct eth_pdata *pdata = dev_get_plat(dev); struct ave_private *priv = dev_get_priv(dev); struct ofnode_phandle_args args; - const char *phy_mode; const u32 *valp; int ret, nc, nr; const char *name; @@ -748,15 +747,10 @@ static int ave_of_to_plat(struct udevice *dev) return -EINVAL; pdata->iobase = dev_read_addr(dev); - pdata->phy_interface = -1; - phy_mode = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "phy-mode", - NULL); - if (phy_mode) - pdata->phy_interface = phy_get_interface_by_name(phy_mode); - if (pdata->phy_interface == -1) { - dev_err(dev, "Invalid PHY interface '%s'\n", phy_mode); + + pdata->phy_interface = dev_read_phy_mode(dev); + if (pdata->phy_interface == PHY_INTERFACE_MODE_NONE) return -EINVAL; - } pdata->max_speed = 0; valp = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "max-speed", |