Skip to contentSkip to conversation

phy: ti: gmii-sel: Allow parent to not be syscon node

PATCH Applied Andrew Davis 4 participants 4 messages Jul 13, 2023 – Jul 17, 2023 Generic PHY framework

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 phy: ti: gmii-sel: Allow parent to not be syscon node

If the parent node is not a syscon type, then fallback and check if we can get a regmap from our own node. This no longer forces us to make the parent of this node a syscon node when that might not be appropriate.

---

Changes from v1:
- Rebased on v6.5-rc1

 drivers/phy/ti/phy-gmii-sel.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/phy/ti/phy-gmii-sel.c +6 -3
index 6286cf25a4264..555b323f45da1 100644
@@ -465,9 +465,12 @@ static int phy_gmii_sel_probe(struct platform_device *pdev)
 
 	priv->regmap = syscon_node_to_regmap(node->parent);
 	if (IS_ERR(priv->regmap)) {
-		ret = PTR_ERR(priv->regmap);
-		dev_err(dev, "Failed to get syscon %d\n", ret);
-		return ret;
+		priv->regmap = device_node_to_regmap(node);
+		if (IS_ERR(priv->regmap)) {
+			ret = PTR_ERR(priv->regmap);
+			dev_err(dev, "Failed to get syscon %d\n", ret);
+			return ret;
+		}
 	}
 
 	ret = phy_gmii_sel_init_ports(priv);
Signature · 7 lines
2.39.2


-- 
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
Reviewed-by on v2 1/1
#1 lore raw
Quoted 6 lines · Andrew Davis

If the parent node is not a syscon type, then fallback and check if we can get a regmap from our own node. This no longer forces us to make the parent of this node a syscon node when that might not be appropriate.

Quoted 28 lines

---

Changes from v1:
- Rebased on v6.5-rc1

 drivers/phy/ti/phy-gmii-sel.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/phy/ti/phy-gmii-sel.c +6 -3
index 6286cf25a4264..555b323f45da1 100644
@@ -465,9 +465,12 @@ static int phy_gmii_sel_probe(struct platform_device *pdev)
 
 	priv->regmap = syscon_node_to_regmap(node->parent);
 	if (IS_ERR(priv->regmap)) {
-		ret = PTR_ERR(priv->regmap);
-		dev_err(dev, "Failed to get syscon %d\n", ret);
-		return ret;
+		priv->regmap = device_node_to_regmap(node);
+		if (IS_ERR(priv->regmap)) {
+			ret = PTR_ERR(priv->regmap);
+			dev_err(dev, "Failed to get syscon %d\n", ret);
+			return ret;
+		}
 	}
 
 	ret = phy_gmii_sel_init_ports(priv);
Signature · 7 lines
Regards,
Siddharth.

-- 
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
Reviewed-by on v2 1/1
#2 lore raw
In reply to Andrew Davis
Quoted 6 lines · Andrew Davis

If the parent node is not a syscon type, then fallback and check if we can get a regmap from our own node. This no longer forces us to make the parent of this node a syscon node when that might not be appropriate.

Signature · 3 lines
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
maintainer Applied
#3 lore raw
In reply to Andrew Davis
Quoted 6 lines · Andrew Davis

If the parent node is not a syscon type, then fallback and check if we can get a regmap from our own node. This no longer forces us to make the parent of this node a syscon node when that might not be appropriate.

Applied, thanks!

[1/1] phy: ti: gmii-sel: Allow parent to not be syscon node

      commit: 1fdfa7cccd35519d97a1f301b8143ea4196b2d16

Best regards,

Signature · 8 lines
~Vinod



-- 
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy