diff mbox series

[net-next,6/8] net: phy: mtk-ge-soc: use new phy_package_shared getters

Message ID bbf97a74-c601-4eff-a302-15f5d525f85e@gmail.com (mailing list archive)
State New
Headers show
Series net: phy: move PHY package code to its own source file | expand

Commit Message

Heiner Kallweit Feb. 19, 2025, 9:06 p.m. UTC
Use the new getters for members of struct phy_package_shared.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/phy/mediatek/mtk-ge-soc.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/phy/mediatek/mtk-ge-soc.c b/drivers/net/phy/mediatek/mtk-ge-soc.c
index bdf99b327..c3ed97937 100644
--- a/drivers/net/phy/mediatek/mtk-ge-soc.c
+++ b/drivers/net/phy/mediatek/mtk-ge-soc.c
@@ -1190,9 +1190,11 @@  static int mt798x_phy_led_hw_control_set(struct phy_device *phydev, u8 index,
 
 static bool mt7988_phy_led_get_polarity(struct phy_device *phydev, int led_num)
 {
-	struct mtk_socphy_shared *priv = phydev->shared->priv;
+	struct mtk_socphy_shared *priv;
 	u32 polarities;
 
+	priv = phy_package_shared_get_priv(phydev);
+
 	if (led_num == 0)
 		polarities = ~(priv->boottrap);
 	else
@@ -1229,11 +1231,13 @@  static int mt7988_phy_fix_leds_polarities(struct phy_device *phydev)
 static int mt7988_phy_probe_shared(struct phy_device *phydev)
 {
 	struct device_node *np = dev_of_node(&phydev->mdio.bus->dev);
-	struct mtk_socphy_shared *shared = phydev->shared->priv;
+	struct mtk_socphy_shared *shared;
 	struct regmap *regmap;
 	u32 reg;
 	int ret;
 
+	shared = phy_package_shared_get_priv(phydev);
+
 	/* The LED0 of the 4 PHYs in MT7988 are wired to SoC pins LED_A, LED_B,
 	 * LED_C and LED_D respectively. At the same time those pins are used to
 	 * bootstrap configuration of the reference clock source (LED_A),
@@ -1280,7 +1284,7 @@  static int mt7988_phy_probe(struct phy_device *phydev)
 			return err;
 	}
 
-	shared = phydev->shared->priv;
+	shared = phy_package_shared_get_priv(phydev);
 	priv = &shared->priv[phydev->mdio.addr];
 
 	phydev->priv = priv;