linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] media: platform: stm32: defer probe for auxiliary clock
@ 2020-01-21 10:22 Yannick Fertre
  2020-01-23  9:52 ` Philippe CORNU
  0 siblings, 1 reply; 2+ messages in thread
From: Yannick Fertre @ 2020-01-21 10:22 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Maxime Coquelin, Alexandre Torgue,
	Yannick Fertre, Etienne Carriere, Hans Verkuil,
	Benjamin Gaignard, linux-media, linux-stm32, linux-arm-kernel,
	linux-kernel, Philippe Cornu

From: Etienne Carriere <etienne.carriere@st.com>

Change stm32-cec driver to defer probe when auxiliary clock
"hdmi-cec" is registered in the system not has not been probed yet.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
---
 drivers/media/platform/stm32/stm32-cec.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/stm32/stm32-cec.c b/drivers/media/platform/stm32/stm32-cec.c
index 8a86b2c..543c9ec 100644
--- a/drivers/media/platform/stm32/stm32-cec.c
+++ b/drivers/media/platform/stm32/stm32-cec.c
@@ -302,10 +302,14 @@ static int stm32_cec_probe(struct platform_device *pdev)
 	}
 
 	cec->clk_hdmi_cec = devm_clk_get(&pdev->dev, "hdmi-cec");
+	if (IS_ERR(cec->clk_hdmi_cec) &&
+	    PTR_ERR(cec->clk_hdmi_cec) == -EPROBE_DEFER)
+			return -EPROBE_DEFER;
+
 	if (!IS_ERR(cec->clk_hdmi_cec)) {
 		ret = clk_prepare(cec->clk_hdmi_cec);
 		if (ret) {
-			dev_err(&pdev->dev, "Unable to prepare hdmi-cec clock\n");
+			dev_err(&pdev->dev, "Can't prepare hdmi-cec clock\n");
 			return ret;
 		}
 	}
-- 
2.7.4


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

* Re: [PATCH] media: platform: stm32: defer probe for auxiliary clock
  2020-01-21 10:22 [PATCH] media: platform: stm32: defer probe for auxiliary clock Yannick Fertre
@ 2020-01-23  9:52 ` Philippe CORNU
  0 siblings, 0 replies; 2+ messages in thread
From: Philippe CORNU @ 2020-01-23  9:52 UTC (permalink / raw)
  To: Yannick FERTRE, Mauro Carvalho Chehab, Maxime Coquelin,
	Alexandre TORGUE, Etienne CARRIERE, Hans Verkuil,
	Benjamin Gaignard, linux-media, linux-stm32, linux-arm-kernel,
	linux-kernel

Dears Yannick & Etienne,
Thank you for your patch,

Reviewed-by: Philippe Cornu <philippe.cornu@st.com>

Philippe :-)

On 1/21/20 11:22 AM, Yannick Fertre wrote:
> From: Etienne Carriere <etienne.carriere@st.com>
> 
> Change stm32-cec driver to defer probe when auxiliary clock
> "hdmi-cec" is registered in the system not has not been probed yet.
> 
> Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
> ---
>   drivers/media/platform/stm32/stm32-cec.c | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/stm32/stm32-cec.c b/drivers/media/platform/stm32/stm32-cec.c
> index 8a86b2c..543c9ec 100644
> --- a/drivers/media/platform/stm32/stm32-cec.c
> +++ b/drivers/media/platform/stm32/stm32-cec.c
> @@ -302,10 +302,14 @@ static int stm32_cec_probe(struct platform_device *pdev)
>   	}
>   
>   	cec->clk_hdmi_cec = devm_clk_get(&pdev->dev, "hdmi-cec");
> +	if (IS_ERR(cec->clk_hdmi_cec) &&
> +	    PTR_ERR(cec->clk_hdmi_cec) == -EPROBE_DEFER)
> +			return -EPROBE_DEFER;
> +
>   	if (!IS_ERR(cec->clk_hdmi_cec)) {
>   		ret = clk_prepare(cec->clk_hdmi_cec);
>   		if (ret) {
> -			dev_err(&pdev->dev, "Unable to prepare hdmi-cec clock\n");
> +			dev_err(&pdev->dev, "Can't prepare hdmi-cec clock\n");
>   			return ret;
>   		}
>   	}
> 

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

end of thread, other threads:[~2020-01-23  9:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-21 10:22 [PATCH] media: platform: stm32: defer probe for auxiliary clock Yannick Fertre
2020-01-23  9:52 ` Philippe CORNU

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