Skip to content

Commit

Permalink
phy: ti: gmii-sel: Allow parent to not be syscon node
Browse files Browse the repository at this point in the history
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>
Reviewed-by: Roger Quadros <rogerq@ti.com>
Reviewed-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Link: https://lore.kernel.org/r/20230713200957.134480-1-afd@ti.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
  • Loading branch information
Andrew Davis authored and Vinod Koul committed Jul 14, 2023
1 parent 76009ee commit 1fdfa7c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/phy/ti/phy-gmii-sel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1fdfa7c

Please sign in to comment.