lkml.org 
[lkml]   [2018]   [Sep]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH net-next 3/7] net: phy: mscc: split config_init in two functions for VSC8584
Date
Part of the config init is common between the VSC8584 and the VSC8574,
so to prepare the upcoming support for VSC8574, separate config_init
PHY-specific code to config_pre_init function which is set in the probe
function of the PHY and used in config_init.

Signed-off-by: Quentin Schulz <quentin.schulz@bootlin.com>
---
drivers/net/phy/mscc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/mscc.c b/drivers/net/phy/mscc.c
index b450489..69cc3cf 100644
--- a/drivers/net/phy/mscc.c
+++ b/drivers/net/phy/mscc.c
@@ -355,6 +355,7 @@ struct vsc8531_private {
u64 *stats;
int nstats;
bool pkg_init;
+ int (*config_pre_init)(struct mii_bus *bus, int phy);
};

#ifdef CONFIG_OF_MDIO
@@ -1298,7 +1299,7 @@ static int vsc8584_config_init(struct phy_device *phydev)
*/
if (!vsc8584_is_pkg_init(phydev, base_addr,
val & PHY_ADDR_REVERSED ? 1 : 0)) {
- ret = vsc8584_config_pre_init(phydev->mdio.bus, base_addr);
+ ret = vsc8531->config_pre_init(phydev->mdio.bus, base_addr);
if (ret)
goto err;
}
@@ -1486,6 +1487,7 @@ static int vsc8584_probe(struct phy_device *phydev)

phydev->priv = vsc8531;

+ vsc8531->config_pre_init = vsc8584_config_pre_init;
vsc8531->nleds = 4;
vsc8531->supp_led_modes = VSC8584_SUPP_LED_MODES;
vsc8531->hw_stats = vsc8584_hw_stats;
--
git-series 0.9.1
\
 
 \ /
  Last update: 2018-09-14 11:47    [W:0.275 / U:1.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site