public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] phy: ti: gmii-sel: Allow parent to not be syscon node
@ 2023-07-13 20:09 Andrew Davis
  2023-07-14  6:11 ` Siddharth Vadapalli
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Andrew Davis @ 2023-07-13 20:09 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>
---

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

 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 6286cf25a4264..555b323f45da1 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);
-- 
2.39.2


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

* Re: [PATCH v2] phy: ti: gmii-sel: Allow parent to not be syscon node
  2023-07-13 20:09 [PATCH v2] phy: ti: gmii-sel: Allow parent to not be syscon node Andrew Davis
@ 2023-07-14  6:11 ` Siddharth Vadapalli
  2023-07-14 11:38 ` Roger Quadros
  2023-07-17  6:23 ` Vinod Koul
  2 siblings, 0 replies; 4+ messages in thread
From: Siddharth Vadapalli @ 2023-07-14  6:11 UTC (permalink / raw)
  To: Andrew Davis, Vinod Koul
  Cc: Kishon Vijay Abraham I, Roger Quadros, linux-phy, linux-kernel,
	s-vadapalli



On 14/07/23 01:39, Andrew Davis wrote:
> 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: Siddharth Vadapalli <s-vadapalli@ti.com>

> ---
> 
> Changes from v1:
>  - Rebased on v6.5-rc1
> 
>  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 6286cf25a4264..555b323f45da1 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);

-- 
Regards,
Siddharth.

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

* Re: [PATCH v2] phy: ti: gmii-sel: Allow parent to not be syscon node
  2023-07-13 20:09 [PATCH v2] phy: ti: gmii-sel: Allow parent to not be syscon node Andrew Davis
  2023-07-14  6:11 ` Siddharth Vadapalli
@ 2023-07-14 11:38 ` Roger Quadros
  2023-07-17  6:23 ` Vinod Koul
  2 siblings, 0 replies; 4+ messages in thread
From: Roger Quadros @ 2023-07-14 11:38 UTC (permalink / raw)
  To: Andrew Davis, Vinod Koul, Kishon Vijay Abraham I,
	Siddharth Vadapalli
  Cc: linux-phy, linux-kernel



On 13/07/2023 23:09, Andrew Davis wrote:
> 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>

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

* Re: [PATCH v2] phy: ti: gmii-sel: Allow parent to not be syscon node
  2023-07-13 20:09 [PATCH v2] phy: ti: gmii-sel: Allow parent to not be syscon node Andrew Davis
  2023-07-14  6:11 ` Siddharth Vadapalli
  2023-07-14 11:38 ` Roger Quadros
@ 2023-07-17  6:23 ` Vinod Koul
  2 siblings, 0 replies; 4+ messages in thread
From: Vinod Koul @ 2023-07-17  6:23 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Siddharth Vadapalli, Roger Quadros,
	Andrew Davis
  Cc: linux-phy, linux-kernel


On Thu, 13 Jul 2023 15:09:57 -0500, Andrew Davis wrote:
> 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,
-- 
~Vinod



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

end of thread, other threads:[~2023-07-17  6:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-13 20:09 [PATCH v2] phy: ti: gmii-sel: Allow parent to not be syscon node Andrew Davis
2023-07-14  6:11 ` Siddharth Vadapalli
2023-07-14 11:38 ` Roger Quadros
2023-07-17  6:23 ` Vinod Koul

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