diff options
author | Andrew Davis <afd@ti.com> | 2023-07-13 15:09:57 -0500 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2023-07-14 18:24:31 +0530 |
commit | 1fdfa7cccd35519d97a1f301b8143ea4196b2d16 (patch) | |
tree | baa0486c3ce1fafd0762efc91b13518209ec2dfc /drivers/phy | |
parent | 76009ee76e05e30e29aade02e788aebe9ce9ffd2 (diff) |
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 <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>
Diffstat (limited to 'drivers/phy')
-rw-r--r-- | drivers/phy/ti/phy-gmii-sel.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/phy/ti/phy-gmii-sel.c b/drivers/phy/ti/phy-gmii-sel.c index 6286cf25a426..555b323f45da 100644 --- a/drivers/phy/ti/phy-gmii-sel.c +++ b/drivers/phy/ti/phy-gmii-sel.c @@ -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); |