diff mbox series

remoteproc: stm32: don't print an error on probe deferral

Message ID 20201209131214.2382-1-arnaud.pouliquen@foss.st.com (mailing list archive)
State New, archived
Headers show
Series remoteproc: stm32: don't print an error on probe deferral | expand

Commit Message

Arnaud POULIQUEN Dec. 9, 2020, 1:12 p.m. UTC
From: Etienne Carriere <etienne.carriere@st.com>

Change stm32 remoteproc driver to not generate an error message
when device probe operation is deferred for the reset controller.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
---
 drivers/remoteproc/stm32_rproc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Ahmad Fatoum Dec. 9, 2020, 2:06 p.m. UTC | #1
Hello Arnaud,

On Wed, 2020-12-09 at 14:12 +0100, Arnaud Pouliquen wrote:
> From: Etienne Carriere <etienne.carriere@st.com>
> 
> Change stm32 remoteproc driver to not generate an error message
> when device probe operation is deferred for the reset controller.
> 
> Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
> Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
> ---
>  drivers/remoteproc/stm32_rproc.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/remoteproc/stm32_rproc.c
> b/drivers/remoteproc/stm32_rproc.c
> index a180aeae9675..25c916782991 100644
> --- a/drivers/remoteproc/stm32_rproc.c
> +++ b/drivers/remoteproc/stm32_rproc.c
> @@ -614,7 +614,9 @@ static int stm32_rproc_parse_dt(struct
> platform_device *pdev,
>  
>  	ddata->rst = devm_reset_control_get_by_index(dev, 0);
>  	if (IS_ERR(ddata->rst)) {
> -		dev_err(dev, "failed to get mcu reset\n");
> +		if (PTR_ERR(ddata->rst) != -EPROBE_DEFER)
> +			dev_err(dev, "failed to get mcu reset\n");
> +

There is dev_err_probe() now that could be used here instead.
It has the added benefit that it records the reason for the
deferred probe.

>  		return PTR_ERR(ddata->rst);
>  	}
>
Arnaud POULIQUEN Dec. 9, 2020, 2:41 p.m. UTC | #2
On 12/9/20 3:06 PM, Ahmad Fatoum wrote:
> Hello Arnaud,
> 
> On Wed, 2020-12-09 at 14:12 +0100, Arnaud Pouliquen wrote:
>> From: Etienne Carriere <etienne.carriere@st.com>
>>
>> Change stm32 remoteproc driver to not generate an error message
>> when device probe operation is deferred for the reset controller.
>>
>> Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
>> Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
>> ---
>>  drivers/remoteproc/stm32_rproc.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/remoteproc/stm32_rproc.c
>> b/drivers/remoteproc/stm32_rproc.c
>> index a180aeae9675..25c916782991 100644
>> --- a/drivers/remoteproc/stm32_rproc.c
>> +++ b/drivers/remoteproc/stm32_rproc.c
>> @@ -614,7 +614,9 @@ static int stm32_rproc_parse_dt(struct
>> platform_device *pdev,
>>  
>>  	ddata->rst = devm_reset_control_get_by_index(dev, 0);
>>  	if (IS_ERR(ddata->rst)) {
>> -		dev_err(dev, "failed to get mcu reset\n");
>> +		if (PTR_ERR(ddata->rst) != -EPROBE_DEFER)
>> +			dev_err(dev, "failed to get mcu reset\n");
>> +
> 
> There is dev_err_probe() now that could be used here instead.
> It has the added benefit that it records the reason for the
> deferred probe.

Thanks for the advice, I will test it!

> 
>>  		return PTR_ERR(ddata->rst);
>>  	}
>>  
>
diff mbox series

Patch

diff --git a/drivers/remoteproc/stm32_rproc.c b/drivers/remoteproc/stm32_rproc.c
index a180aeae9675..25c916782991 100644
--- a/drivers/remoteproc/stm32_rproc.c
+++ b/drivers/remoteproc/stm32_rproc.c
@@ -614,7 +614,9 @@  static int stm32_rproc_parse_dt(struct platform_device *pdev,
 
 	ddata->rst = devm_reset_control_get_by_index(dev, 0);
 	if (IS_ERR(ddata->rst)) {
-		dev_err(dev, "failed to get mcu reset\n");
+		if (PTR_ERR(ddata->rst) != -EPROBE_DEFER)
+			dev_err(dev, "failed to get mcu reset\n");
+
 		return PTR_ERR(ddata->rst);
 	}