linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [v2 PATCH 1/4] phy: phy-mtk-tphy: get optional clock by devm_clk_get_optional()
@ 2019-04-10  6:13 Chunfeng Yun
  2019-04-10  6:13 ` [v2 PATCH 2/4] phy: qcom-qusb2: " Chunfeng Yun
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Chunfeng Yun @ 2019-04-10  6:13 UTC (permalink / raw)
  To: Kishon Vijay Abraham I
  Cc: Kevin Hilman, Chunfeng Yun, Matthias Brugger, Andy Gross,
	David Brown, Masahiro Yamada, Martin Blumenstingl,
	Grygorii Strashko, Kunihiko Hayashi, Masami Hiramatsu,
	Motoya Tanigawa, linux-kernel, linux-arm-kernel, linux-amlogic,
	linux-mediatek, linux-arm-msm

Use devm_clk_get_optional() to get optional clock

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
v2: no changes
---
 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.21.0


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

* [v2 PATCH 2/4] phy: qcom-qusb2: get optional clock by devm_clk_get_optional()
  2019-04-10  6:13 [v2 PATCH 1/4] phy: phy-mtk-tphy: get optional clock by devm_clk_get_optional() Chunfeng Yun
@ 2019-04-10  6:13 ` Chunfeng Yun
  2019-04-10  6:13 ` [v2 PATCH 3/4] phy: socionext: " Chunfeng Yun
  2019-04-10  6:13 ` [v2 PATCH 4/4] phy: phy-meson-gxl-usb2: " Chunfeng Yun
  2 siblings, 0 replies; 7+ messages in thread
From: Chunfeng Yun @ 2019-04-10  6:13 UTC (permalink / raw)
  To: Kishon Vijay Abraham I
  Cc: Kevin Hilman, Chunfeng Yun, Matthias Brugger, Andy Gross,
	David Brown, Masahiro Yamada, Martin Blumenstingl,
	Grygorii Strashko, Kunihiko Hayashi, Masami Hiramatsu,
	Motoya Tanigawa, linux-kernel, linux-arm-kernel, linux-amlogic,
	linux-mediatek, linux-arm-msm, Vivek Gautam

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>
---
v2: no changes
---
 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.21.0


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

* [v2 PATCH 3/4] phy: socionext: get optional clock by devm_clk_get_optional()
  2019-04-10  6:13 [v2 PATCH 1/4] phy: phy-mtk-tphy: get optional clock by devm_clk_get_optional() Chunfeng Yun
  2019-04-10  6:13 ` [v2 PATCH 2/4] phy: qcom-qusb2: " Chunfeng Yun
@ 2019-04-10  6:13 ` Chunfeng Yun
  2019-04-10  6:13 ` [v2 PATCH 4/4] phy: phy-meson-gxl-usb2: " Chunfeng Yun
  2 siblings, 0 replies; 7+ messages in thread
From: Chunfeng Yun @ 2019-04-10  6:13 UTC (permalink / raw)
  To: Kishon Vijay Abraham I
  Cc: Kevin Hilman, Chunfeng Yun, Matthias Brugger, Andy Gross,
	David Brown, Masahiro Yamada, Martin Blumenstingl,
	Grygorii Strashko, Kunihiko Hayashi, Masami Hiramatsu,
	Motoya Tanigawa, linux-kernel, linux-arm-kernel, linux-amlogic,
	linux-mediatek, linux-arm-msm

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>
Reviewed-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
v2: add Reviewed-by Kunihiko Hayashi
---
 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.21.0


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

* [v2 PATCH 4/4] phy: phy-meson-gxl-usb2: get optional clock by devm_clk_get_optional()
  2019-04-10  6:13 [v2 PATCH 1/4] phy: phy-mtk-tphy: get optional clock by devm_clk_get_optional() Chunfeng Yun
  2019-04-10  6:13 ` [v2 PATCH 2/4] phy: qcom-qusb2: " Chunfeng Yun
  2019-04-10  6:13 ` [v2 PATCH 3/4] phy: socionext: " Chunfeng Yun
@ 2019-04-10  6:13 ` Chunfeng Yun
  2019-04-10  8:18   ` Jerome Brunet
  2019-04-10 17:59   ` Martin Blumenstingl
  2 siblings, 2 replies; 7+ messages in thread
From: Chunfeng Yun @ 2019-04-10  6:13 UTC (permalink / raw)
  To: Kishon Vijay Abraham I
  Cc: Kevin Hilman, Chunfeng Yun, Matthias Brugger, Andy Gross,
	David Brown, Masahiro Yamada, Martin Blumenstingl,
	Grygorii Strashko, Kunihiko Hayashi, Masami Hiramatsu,
	Motoya Tanigawa, linux-kernel, linux-arm-kernel, linux-amlogic,
	linux-mediatek, linux-arm-msm

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>
---
v2: add Acked-by Martin Blumenstingl
---
 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.21.0


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

* Re: [v2 PATCH 4/4] phy: phy-meson-gxl-usb2: get optional clock by devm_clk_get_optional()
  2019-04-10  6:13 ` [v2 PATCH 4/4] phy: phy-meson-gxl-usb2: " Chunfeng Yun
@ 2019-04-10  8:18   ` Jerome Brunet
  2019-04-10 17:59   ` Martin Blumenstingl
  1 sibling, 0 replies; 7+ messages in thread
From: Jerome Brunet @ 2019-04-10  8:18 UTC (permalink / raw)
  To: Chunfeng Yun, Kishon Vijay Abraham I
  Cc: Kevin Hilman, Matthias Brugger, Andy Gross, David Brown,
	Masahiro Yamada, Martin Blumenstingl, Grygorii Strashko,
	Kunihiko Hayashi, Masami Hiramatsu, Motoya Tanigawa,
	linux-kernel, linux-arm-kernel, linux-amlogic, linux-mediatek,
	linux-arm-msm

On Wed, 2019-04-10 at 14:13 +0800, Chunfeng Yun 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>

Reviewed-by: Jerome Brunet <jbrunet@baylibre.com>

> ---
> v2: add Acked-by Martin Blumenstingl
> ---
>  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))



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

* Re: [v2 PATCH 4/4] phy: phy-meson-gxl-usb2: get optional clock by devm_clk_get_optional()
  2019-04-10  6:13 ` [v2 PATCH 4/4] phy: phy-meson-gxl-usb2: " Chunfeng Yun
  2019-04-10  8:18   ` Jerome Brunet
@ 2019-04-10 17:59   ` Martin Blumenstingl
  2019-04-11  1:04     ` Chunfeng Yun
  1 sibling, 1 reply; 7+ messages in thread
From: Martin Blumenstingl @ 2019-04-10 17:59 UTC (permalink / raw)
  To: Chunfeng Yun
  Cc: Kishon Vijay Abraham I, Kevin Hilman, Matthias Brugger,
	Andy Gross, David Brown, Masahiro Yamada, Martin Blumenstingl,
	Grygorii Strashko, Kunihiko Hayashi, Masami Hiramatsu,
	Motoya Tanigawa, linux-kernel, linux-arm-kernel, linux-amlogic,
	linux-mediatek, linux-arm-msm

On Wed, Apr 10, 2019 at 8:13 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>
now also:
Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
(on my Khadas VIM by manually adjusting meson-gxl.dtsi and dropping
the clocks in usb2_phy0 and usb2_phy1)

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

* Re: [v2 PATCH 4/4] phy: phy-meson-gxl-usb2: get optional clock by devm_clk_get_optional()
  2019-04-10 17:59   ` Martin Blumenstingl
@ 2019-04-11  1:04     ` Chunfeng Yun
  0 siblings, 0 replies; 7+ messages in thread
From: Chunfeng Yun @ 2019-04-11  1:04 UTC (permalink / raw)
  To: Martin Blumenstingl
  Cc: Kishon Vijay Abraham I, Kevin Hilman, Matthias Brugger,
	Andy Gross, David Brown, Masahiro Yamada, Grygorii Strashko,
	Kunihiko Hayashi, Masami Hiramatsu, Motoya Tanigawa,
	linux-kernel, linux-arm-kernel, linux-amlogic, linux-mediatek,
	linux-arm-msm

On Wed, 2019-04-10 at 19:59 +0200, Martin Blumenstingl wrote:
> On Wed, Apr 10, 2019 at 8:13 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>
> now also:
> Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> (on my Khadas VIM by manually adjusting meson-gxl.dtsi and dropping
> the clocks in usb2_phy0 and usb2_phy1)

Thank you:)



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

end of thread, other threads:[~2019-04-11  1:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-10  6:13 [v2 PATCH 1/4] phy: phy-mtk-tphy: get optional clock by devm_clk_get_optional() Chunfeng Yun
2019-04-10  6:13 ` [v2 PATCH 2/4] phy: qcom-qusb2: " Chunfeng Yun
2019-04-10  6:13 ` [v2 PATCH 3/4] phy: socionext: " Chunfeng Yun
2019-04-10  6:13 ` [v2 PATCH 4/4] phy: phy-meson-gxl-usb2: " Chunfeng Yun
2019-04-10  8:18   ` Jerome Brunet
2019-04-10 17:59   ` Martin Blumenstingl
2019-04-11  1:04     ` Chunfeng Yun

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).