arch/risc-v/src/mpfs/mpfs_ethernet.c: Remove unnecessary phyinit

mpfs_phyinit() was called twice during ifup().

Signed-off-by: Jani Paalijarvi <jani.paalijarvi@unikie.com>
This commit is contained in:
Jani Paalijarvi 2024-08-22 14:45:05 +03:00 committed by Xiang Xiao
parent cc662453c1
commit 12290d0111

View file

@ -3368,6 +3368,17 @@ static int mpfs_phyinit(struct mpfs_ethmac_s *priv)
{
int ret = -EINVAL;
#ifdef CONFIG_MPFS_PHYINIT
/* Perform any necessary, board-specific PHY initialization */
ret = mpfs_phy_boardinitialize(priv->intf);
if (ret < 0)
{
nerr("ERROR: Failed to initialize the PHY: %d\n", ret);
return ret;
}
#endif
#ifdef ETH_HAS_MDIO_PHY
/* Configure PHY clocking */
@ -3518,31 +3529,11 @@ static int mpfs_ethconfig(struct mpfs_ethmac_s *priv)
ninfo("Entry\n");
#ifdef CONFIG_MPFS_PHYINIT
/* Perform any necessary, board-specific PHY initialization */
ret = mpfs_phy_boardinitialize(priv->intf);
if (ret < 0)
{
nerr("ERROR: Failed to initialize the PHY: %d\n", ret);
return ret;
}
#endif
/* Reset the Ethernet block */
ninfo("Reset the Ethernet block\n");
mpfs_ethreset(priv);
/* Initialize the PHY */
ninfo("Initialize the PHY\n");
ret = mpfs_phyinit(priv);
if (ret < 0)
{
return ret;
}
/* Initialize the MAC and DMA */
ninfo("Initialize the MAC and DMA\n");