Skip to content

Commit 1fdfa7c

Browse files
glneovinodkoul
authored andcommitted
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. Signed-off-by: Andrew Davis <[email protected]> Reviewed-by: Roger Quadros <[email protected]> Reviewed-by: Siddharth Vadapalli <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 76009ee commit 1fdfa7c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

drivers/phy/ti/phy-gmii-sel.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -465,9 +465,12 @@ static int phy_gmii_sel_probe(struct platform_device *pdev)
465465

466466
priv->regmap = syscon_node_to_regmap(node->parent);
467467
if (IS_ERR(priv->regmap)) {
468-
ret = PTR_ERR(priv->regmap);
469-
dev_err(dev, "Failed to get syscon %d\n", ret);
470-
return ret;
468+
priv->regmap = device_node_to_regmap(node);
469+
if (IS_ERR(priv->regmap)) {
470+
ret = PTR_ERR(priv->regmap);
471+
dev_err(dev, "Failed to get syscon %d\n", ret);
472+
return ret;
473+
}
471474
}
472475

473476
ret = phy_gmii_sel_init_ports(priv);

0 commit comments

Comments
 (0)