mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] phy: ti: gmii-sel: Allow parent to not be syscon node
@ 2023-05-15 19:59 Andrew Davis
  2023-05-16  4:05 ` Siddharth Vadapalli
  2023-05-16 18:33 ` Roger Quadros
  0 siblings, 2 replies; 5+ messages in thread
From: Andrew Davis @ 2023-05-15 19:59 UTC (permalink / raw)
  To: Vinod Koul, Kishon Vijay Abraham I, Siddharth Vadapalli, Roger Quadros
  Cc: linux-phy, linux-kernel, 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.

Signed-off-by: Andrew Davis <afd@ti.com>
---
 drivers/phy/ti/phy-gmii-sel.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/phy/ti/phy-gmii-sel.c b/drivers/phy/ti/phy-gmii-sel.c
index 8c667819c39a..1e67ed9a5cf6 100644
--- a/drivers/phy/ti/phy-gmii-sel.c
+++ b/drivers/phy/ti/phy-gmii-sel.c
@@ -435,9 +435,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);
-- 
2.39.2


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-07-10 14:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-15 19:59 [PATCH] phy: ti: gmii-sel: Allow parent to not be syscon node Andrew Davis
2023-05-16  4:05 ` Siddharth Vadapalli
2023-07-10 14:38   ` Andrew Davis
2023-05-16 18:33 ` Roger Quadros
2023-07-10 14:45   ` Andrew Davis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®