linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] phy: phy-mtk-tphy: get optional clock by devm_clk_get_optional()
@ 2019-03-30  9:11 Chunfeng Yun
  2019-03-30  9:11 ` [PATCH 2/4] phy: qcom-qusb2: " Chunfeng Yun
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Chunfeng Yun @ 2019-03-30  9:11 UTC (permalink / raw)
  To: Kishon Vijay Abraham I
  Cc: linux-arm-msm, linux-kernel, Matthias Brugger, linux-mediatek,
	Chunfeng Yun, linux-amlogic, linux-arm-kernel

Use devm_clk_get_optional() to get optional clock

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
 drivers/phy/mediatek/phy-mtk-tphy.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/phy/mediatek/phy-mtk-tphy.c b/drivers/phy/mediatek/phy-mtk-tphy.c
index 5b6a470ca145..cb2ed3b25068 100644
--- a/drivers/phy/mediatek/phy-mtk-tphy.c
+++ b/drivers/phy/mediatek/phy-mtk-tphy.c
@@ -1103,13 +1103,9 @@ static int mtk_tphy_probe(struct platform_device *pdev)
 	}
 
 	/* it's deprecated, make it optional for backward compatibility */
-	tphy->u3phya_ref = devm_clk_get(dev, "u3phya_ref");
-	if (IS_ERR(tphy->u3phya_ref)) {
-		if (PTR_ERR(tphy->u3phya_ref) == -EPROBE_DEFER)
-			return -EPROBE_DEFER;
-
-		tphy->u3phya_ref = NULL;
-	}
+	tphy->u3phya_ref = devm_clk_get_optional(dev, "u3phya_ref");
+	if (IS_ERR(tphy->u3phya_ref))
+		return PTR_ERR(tphy->u3phya_ref);
 
 	tphy->src_ref_clk = U3P_REF_CLK;
 	tphy->src_coef = U3P_SLEW_RATE_COEF;
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 2/4] phy: qcom-qusb2: get optional clock by devm_clk_get_optional()
  2019-03-30  9:11 [PATCH 1/4] phy: phy-mtk-tphy: get optional clock by devm_clk_get_optional() Chunfeng Yun
@ 2019-03-30  9:11 ` Chunfeng Yun
  2019-03-30  9:11 ` [PATCH 3/4] phy: socionext: " Chunfeng Yun
  2019-03-30  9:11 ` [PATCH 4/4] phy: phy-meson-gxl-usb2: " Chunfeng Yun
  2 siblings, 0 replies; 6+ messages in thread
From: Chunfeng Yun @ 2019-03-30  9:11 UTC (permalink / raw)
  To: Kishon Vijay Abraham I
  Cc: David Brown, linux-arm-msm, linux-kernel, Matthias Brugger,
	linux-mediatek, Vivek Gautam, Chunfeng Yun, linux-amlogic,
	Andy Gross, linux-arm-kernel

Use devm_clk_get_optional() to get optional clock

Cc: Andy Gross <andy.gross@linaro.org>
Cc: David Brown <david.brown@linaro.org>
Cc: Vivek Gautam <vivek.gautam@codeaurora.org>
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
 drivers/phy/qualcomm/phy-qcom-qusb2.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/phy/qualcomm/phy-qcom-qusb2.c b/drivers/phy/qualcomm/phy-qcom-qusb2.c
index 8fd7ce139772..1cbf1d6f28ce 100644
--- a/drivers/phy/qualcomm/phy-qcom-qusb2.c
+++ b/drivers/phy/qualcomm/phy-qcom-qusb2.c
@@ -822,14 +822,9 @@ static int qusb2_phy_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	qphy->iface_clk = devm_clk_get(dev, "iface");
-	if (IS_ERR(qphy->iface_clk)) {
-		ret = PTR_ERR(qphy->iface_clk);
-		if (ret == -EPROBE_DEFER)
-			return ret;
-		qphy->iface_clk = NULL;
-		dev_dbg(dev, "failed to get iface clk, %d\n", ret);
-	}
+	qphy->iface_clk = devm_clk_get_optional(dev, "iface");
+	if (IS_ERR(qphy->iface_clk))
+		return PTR_ERR(qphy->iface_clk);
 
 	qphy->phy_reset = devm_reset_control_get_by_index(&pdev->dev, 0);
 	if (IS_ERR(qphy->phy_reset)) {
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 3/4] phy: socionext: get optional clock by devm_clk_get_optional()
  2019-03-30  9:11 [PATCH 1/4] phy: phy-mtk-tphy: get optional clock by devm_clk_get_optional() Chunfeng Yun
  2019-03-30  9:11 ` [PATCH 2/4] phy: qcom-qusb2: " Chunfeng Yun
@ 2019-03-30  9:11 ` Chunfeng Yun
  2019-04-01  9:15   ` Kunihiko Hayashi
  2019-03-30  9:11 ` [PATCH 4/4] phy: phy-meson-gxl-usb2: " Chunfeng Yun
  2 siblings, 1 reply; 6+ messages in thread
From: Chunfeng Yun @ 2019-03-30  9:11 UTC (permalink / raw)
  To: Kishon Vijay Abraham I
  Cc: Kunihiko Hayashi, linux-arm-msm, linux-kernel, Matthias Brugger,
	linux-mediatek, Chunfeng Yun, linux-amlogic, linux-arm-kernel

Use devm_clk_get_optional() to get optional clock

Cc: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
 drivers/phy/socionext/phy-uniphier-usb3hs.c | 10 +++-------
 drivers/phy/socionext/phy-uniphier-usb3ss.c | 10 +++-------
 2 files changed, 6 insertions(+), 14 deletions(-)

diff --git a/drivers/phy/socionext/phy-uniphier-usb3hs.c b/drivers/phy/socionext/phy-uniphier-usb3hs.c
index b1b048be6166..50f379fc4e06 100644
--- a/drivers/phy/socionext/phy-uniphier-usb3hs.c
+++ b/drivers/phy/socionext/phy-uniphier-usb3hs.c
@@ -335,13 +335,9 @@ static int uniphier_u3hsphy_probe(struct platform_device *pdev)
 	if (IS_ERR(priv->clk_parent))
 		return PTR_ERR(priv->clk_parent);
 
-	priv->clk_ext = devm_clk_get(dev, "phy-ext");
-	if (IS_ERR(priv->clk_ext)) {
-		if (PTR_ERR(priv->clk_ext) == -ENOENT)
-			priv->clk_ext = NULL;
-		else
-			return PTR_ERR(priv->clk_ext);
-	}
+	priv->clk_ext = devm_clk_get_optional(dev, "phy-ext");
+	if (IS_ERR(priv->clk_ext))
+		return PTR_ERR(priv->clk_ext);
 
 	priv->rst = devm_reset_control_get_shared(dev, "phy");
 	if (IS_ERR(priv->rst))
diff --git a/drivers/phy/socionext/phy-uniphier-usb3ss.c b/drivers/phy/socionext/phy-uniphier-usb3ss.c
index 4be95679c7d8..ec231e40ef2a 100644
--- a/drivers/phy/socionext/phy-uniphier-usb3ss.c
+++ b/drivers/phy/socionext/phy-uniphier-usb3ss.c
@@ -238,13 +238,9 @@ static int uniphier_u3ssphy_probe(struct platform_device *pdev)
 		if (IS_ERR(priv->clk))
 			return PTR_ERR(priv->clk);
 
-		priv->clk_ext = devm_clk_get(dev, "phy-ext");
-		if (IS_ERR(priv->clk_ext)) {
-			if (PTR_ERR(priv->clk_ext) == -ENOENT)
-				priv->clk_ext = NULL;
-			else
-				return PTR_ERR(priv->clk_ext);
-		}
+		priv->clk_ext = devm_clk_get_optional(dev, "phy-ext");
+		if (IS_ERR(priv->clk_ext))
+			return PTR_ERR(priv->clk_ext);
 
 		priv->rst = devm_reset_control_get_shared(dev, "phy");
 		if (IS_ERR(priv->rst))
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 4/4] phy: phy-meson-gxl-usb2: get optional clock by devm_clk_get_optional()
  2019-03-30  9:11 [PATCH 1/4] phy: phy-mtk-tphy: get optional clock by devm_clk_get_optional() Chunfeng Yun
  2019-03-30  9:11 ` [PATCH 2/4] phy: qcom-qusb2: " Chunfeng Yun
  2019-03-30  9:11 ` [PATCH 3/4] phy: socionext: " Chunfeng Yun
@ 2019-03-30  9:11 ` Chunfeng Yun
  2019-03-31 20:39   ` Martin Blumenstingl
  2 siblings, 1 reply; 6+ messages in thread
From: Chunfeng Yun @ 2019-03-30  9:11 UTC (permalink / raw)
  To: Kishon Vijay Abraham I
  Cc: Martin Blumenstingl, linux-arm-msm, linux-kernel,
	Matthias Brugger, linux-mediatek, Chunfeng Yun, linux-amlogic,
	linux-arm-kernel

Use devm_clk_get_optional() to get optional clock

Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
 drivers/phy/amlogic/phy-meson-gxl-usb2.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/phy/amlogic/phy-meson-gxl-usb2.c b/drivers/phy/amlogic/phy-meson-gxl-usb2.c
index 148ef0bdb9c1..4cbee412f2b0 100644
--- a/drivers/phy/amlogic/phy-meson-gxl-usb2.c
+++ b/drivers/phy/amlogic/phy-meson-gxl-usb2.c
@@ -261,14 +261,9 @@ static int phy_meson_gxl_usb2_probe(struct platform_device *pdev)
 	if (IS_ERR(priv->regmap))
 		return PTR_ERR(priv->regmap);
 
-	priv->clk = devm_clk_get(dev, "phy");
-	if (IS_ERR(priv->clk)) {
-		ret = PTR_ERR(priv->clk);
-		if (ret == -ENOENT)
-			priv->clk = NULL;
-		else
-			return ret;
-	}
+	priv->clk = devm_clk_get_optional(dev, "phy");
+	if (IS_ERR(priv->clk))
+		return PTR_ERR(priv->clk);
 
 	priv->reset = devm_reset_control_get_optional_shared(dev, "phy");
 	if (IS_ERR(priv->reset))
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 4/4] phy: phy-meson-gxl-usb2: get optional clock by devm_clk_get_optional()
  2019-03-30  9:11 ` [PATCH 4/4] phy: phy-meson-gxl-usb2: " Chunfeng Yun
@ 2019-03-31 20:39   ` Martin Blumenstingl
  0 siblings, 0 replies; 6+ messages in thread
From: Martin Blumenstingl @ 2019-03-31 20:39 UTC (permalink / raw)
  To: Chunfeng Yun
  Cc: linux-arm-msm, linux-kernel, Kishon Vijay Abraham I,
	linux-mediatek, Matthias Brugger, linux-amlogic,
	linux-arm-kernel

On Sat, Mar 30, 2019 at 10:12 AM Chunfeng Yun <chunfeng.yun@mediatek.com> wrote:
>
> Use devm_clk_get_optional() to get optional clock
>
> Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Acked-by: Martin Blumenstingl<martin.blumenstingl@googlemail.com>

thank you for this cleanup!

if you also want a Tested-by then please give me a few days (until I
have time to boot with this patch applied on my Khadas VIM or VIM2)


Regards

Martin

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 3/4] phy: socionext: get optional clock by devm_clk_get_optional()
  2019-03-30  9:11 ` [PATCH 3/4] phy: socionext: " Chunfeng Yun
@ 2019-04-01  9:15   ` Kunihiko Hayashi
  0 siblings, 0 replies; 6+ messages in thread
From: Kunihiko Hayashi @ 2019-04-01  9:15 UTC (permalink / raw)
  To: Chunfeng Yun
  Cc: linux-arm-msm, linux-kernel, Kishon Vijay Abraham I,
	linux-mediatek, Matthias Brugger, linux-amlogic,
	linux-arm-kernel

Hi,

This looks good to me.

Reviewed-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>

Thanks,

On Sat, 30 Mar 2019 17:11:37 +0800
Chunfeng Yun <chunfeng.yun@mediatek.com> wrote:

> Use devm_clk_get_optional() to get optional clock
> 
> Cc: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
> ---
>  drivers/phy/socionext/phy-uniphier-usb3hs.c | 10 +++-------
>  drivers/phy/socionext/phy-uniphier-usb3ss.c | 10 +++-------
>  2 files changed, 6 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/phy/socionext/phy-uniphier-usb3hs.c b/drivers/phy/socionext/phy-uniphier-usb3hs.c
> index b1b048be6166..50f379fc4e06 100644
> --- a/drivers/phy/socionext/phy-uniphier-usb3hs.c
> +++ b/drivers/phy/socionext/phy-uniphier-usb3hs.c
> @@ -335,13 +335,9 @@ static int uniphier_u3hsphy_probe(struct platform_device *pdev)
>  	if (IS_ERR(priv->clk_parent))
>  		return PTR_ERR(priv->clk_parent);
>  
> -	priv->clk_ext = devm_clk_get(dev, "phy-ext");
> -	if (IS_ERR(priv->clk_ext)) {
> -		if (PTR_ERR(priv->clk_ext) == -ENOENT)
> -			priv->clk_ext = NULL;
> -		else
> -			return PTR_ERR(priv->clk_ext);
> -	}
> +	priv->clk_ext = devm_clk_get_optional(dev, "phy-ext");
> +	if (IS_ERR(priv->clk_ext))
> +		return PTR_ERR(priv->clk_ext);
>  
>  	priv->rst = devm_reset_control_get_shared(dev, "phy");
>  	if (IS_ERR(priv->rst))
> diff --git a/drivers/phy/socionext/phy-uniphier-usb3ss.c b/drivers/phy/socionext/phy-uniphier-usb3ss.c
> index 4be95679c7d8..ec231e40ef2a 100644
> --- a/drivers/phy/socionext/phy-uniphier-usb3ss.c
> +++ b/drivers/phy/socionext/phy-uniphier-usb3ss.c
> @@ -238,13 +238,9 @@ static int uniphier_u3ssphy_probe(struct platform_device *pdev)
>  		if (IS_ERR(priv->clk))
>  			return PTR_ERR(priv->clk);
>  
> -		priv->clk_ext = devm_clk_get(dev, "phy-ext");
> -		if (IS_ERR(priv->clk_ext)) {
> -			if (PTR_ERR(priv->clk_ext) == -ENOENT)
> -				priv->clk_ext = NULL;
> -			else
> -				return PTR_ERR(priv->clk_ext);
> -		}
> +		priv->clk_ext = devm_clk_get_optional(dev, "phy-ext");
> +		if (IS_ERR(priv->clk_ext))
> +			return PTR_ERR(priv->clk_ext);
>  
>  		priv->rst = devm_reset_control_get_shared(dev, "phy");
>  		if (IS_ERR(priv->rst))
> -- 
> 2.20.1

---
Best Regards,
Kunihiko Hayashi



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2019-04-01  9:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-30  9:11 [PATCH 1/4] phy: phy-mtk-tphy: get optional clock by devm_clk_get_optional() Chunfeng Yun
2019-03-30  9:11 ` [PATCH 2/4] phy: qcom-qusb2: " Chunfeng Yun
2019-03-30  9:11 ` [PATCH 3/4] phy: socionext: " Chunfeng Yun
2019-04-01  9:15   ` Kunihiko Hayashi
2019-03-30  9:11 ` [PATCH 4/4] phy: phy-meson-gxl-usb2: " Chunfeng Yun
2019-03-31 20:39   ` Martin Blumenstingl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).