diff options
author | Tom Rini <trini@konsulko.com> | 2021-09-29 07:58:20 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-09-29 07:58:20 -0400 |
commit | 6eecaf5d0f6b9a500dd5798f1f2bc8296bcfe158 (patch) | |
tree | 1307de30a7d4cc6e5db9a3d78f583d288a5dbbdb /drivers/net/tsec.c | |
parent | ba17871884c10f64082ddba2f0632ec44a3ae490 (diff) | |
parent | 4df9f5e39fb224a4857c3411b4cbe419e4d339e8 (diff) |
Merge branch 'network_master' of https://source.denx.de/u-boot/custodians/u-boot-net into next
- Fix some non-NULL terminated strings in the networking subsystem
- net: tsec: Mark tsec_get_interface as __maybe_unused
Diffstat (limited to 'drivers/net/tsec.c')
-rw-r--r-- | drivers/net/tsec.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c index ee820aae15..0ce9765671 100644 --- a/drivers/net/tsec.c +++ b/drivers/net/tsec.c @@ -638,7 +638,7 @@ static int tsec_init(struct udevice *dev) return priv->phydev->link ? 0 : -1; } -static phy_interface_t tsec_get_interface(struct tsec_private *priv) +static phy_interface_t __maybe_unused tsec_get_interface(struct tsec_private *priv) { struct tsec __iomem *regs = priv->regs; u32 ecntrl; @@ -701,8 +701,6 @@ static int init_phy(struct tsec_private *priv) /* Assign a Physical address to the TBI */ out_be32(®s->tbipa, priv->tbiaddr); - priv->interface = tsec_get_interface(priv); - if (priv->interface == PHY_INTERFACE_MODE_SGMII) tsec_configure_serdes(priv); @@ -886,12 +884,13 @@ 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) { - printf("Invalid PHY interface '%s'\n", phy_mode); - return -EINVAL; - } + if (pdata->phy_interface == -1) + pdata->phy_interface = tsec_get_interface(priv); + priv->interface = pdata->phy_interface; /* Check for speed limit, default is 1000Mbps */ |