diff mbox series

[v2,net-next,2/5] net: ipa: don't report EPROBE_DEFER error

Message ID 20210211211927.28061-3-elder@linaro.org
State New
Headers show
Series net: ipa: some more cleanup | expand

Commit Message

Alex Elder Feb. 11, 2021, 9:19 p.m. UTC
When initializing the IPA core clock and interconnects, it's
possible we'll get an EPROBE_DEFER error.  This isn't really an
error, it's just means we need to be re-probed later.

Check the return code when initializing these, and if it's
EPROBE_DEFER, skip printing the error message.

Signed-off-by: Alex Elder <elder@linaro.org>

---
 drivers/net/ipa/ipa_clock.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

-- 
2.20.1

Comments

Heiner Kallweit Feb. 11, 2021, 10:11 p.m. UTC | #1
On 11.02.2021 22:19, Alex Elder wrote:
> When initializing the IPA core clock and interconnects, it's

> possible we'll get an EPROBE_DEFER error.  This isn't really an

> error, it's just means we need to be re-probed later.

> 

> Check the return code when initializing these, and if it's

> EPROBE_DEFER, skip printing the error message.

> 

> Signed-off-by: Alex Elder <elder@linaro.org>

> ---

>  drivers/net/ipa/ipa_clock.c | 12 ++++++++----

>  1 file changed, 8 insertions(+), 4 deletions(-)

> 

> diff --git a/drivers/net/ipa/ipa_clock.c b/drivers/net/ipa/ipa_clock.c

> index 354675a643db5..238a713f6b604 100644

> --- a/drivers/net/ipa/ipa_clock.c

> +++ b/drivers/net/ipa/ipa_clock.c

> @@ -1,7 +1,7 @@

>  // SPDX-License-Identifier: GPL-2.0

>  

>  /* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.

> - * Copyright (C) 2018-2020 Linaro Ltd.

> + * Copyright (C) 2018-2021 Linaro Ltd.

>   */

>  

>  #include <linux/refcount.h>

> @@ -68,8 +68,9 @@ static int ipa_interconnect_init_one(struct device *dev,

>  	if (IS_ERR(path)) {

>  		int ret = PTR_ERR(path);

>  

> -		dev_err(dev, "error %d getting %s interconnect\n", ret,

> -			data->name);

> +		if (ret != -EPROBE_DEFER)

> +			dev_err(dev, "error %d getting %s interconnect\n", ret,

> +				data->name);

>  


You may want to use dev_err_probe() here.

>  		return ret;

>  	}

> @@ -281,7 +282,10 @@ ipa_clock_init(struct device *dev, const struct ipa_clock_data *data)

>  

>  	clk = clk_get(dev, "core");

>  	if (IS_ERR(clk)) {

> -		dev_err(dev, "error %ld getting core clock\n", PTR_ERR(clk));

> +		ret = PTR_ERR(clk);

> +		if (ret != -EPROBE_DEFER)

> +			dev_err(dev, "error %d getting core clock\n", ret);

> +

>  		return ERR_CAST(clk);

>  	}

>  

>
Alex Elder Feb. 11, 2021, 10:13 p.m. UTC | #2
On 2/11/21 4:11 PM, Heiner Kallweit wrote:
> On 11.02.2021 22:19, Alex Elder wrote:

>> When initializing the IPA core clock and interconnects, it's

>> possible we'll get an EPROBE_DEFER error.  This isn't really an

>> error, it's just means we need to be re-probed later.

>>

>> Check the return code when initializing these, and if it's

>> EPROBE_DEFER, skip printing the error message.

>>

>> Signed-off-by: Alex Elder <elder@linaro.org>

>> ---

>>   drivers/net/ipa/ipa_clock.c | 12 ++++++++----

>>   1 file changed, 8 insertions(+), 4 deletions(-)

>>

>> diff --git a/drivers/net/ipa/ipa_clock.c b/drivers/net/ipa/ipa_clock.c

>> index 354675a643db5..238a713f6b604 100644

>> --- a/drivers/net/ipa/ipa_clock.c

>> +++ b/drivers/net/ipa/ipa_clock.c

>> @@ -1,7 +1,7 @@

>>   // SPDX-License-Identifier: GPL-2.0

>>   

>>   /* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.

>> - * Copyright (C) 2018-2020 Linaro Ltd.

>> + * Copyright (C) 2018-2021 Linaro Ltd.

>>    */

>>   

>>   #include <linux/refcount.h>

>> @@ -68,8 +68,9 @@ static int ipa_interconnect_init_one(struct device *dev,

>>   	if (IS_ERR(path)) {

>>   		int ret = PTR_ERR(path);

>>   

>> -		dev_err(dev, "error %d getting %s interconnect\n", ret,

>> -			data->name);

>> +		if (ret != -EPROBE_DEFER)

>> +			dev_err(dev, "error %d getting %s interconnect\n", ret,

>> +				data->name);

>>   

> 

> You may want to use dev_err_probe() here.


Great suggestion, I haven't used that before.

I will post v3 with that suggested change,
tomorrow morning.

Thanks!

					-Alex

>>   		return ret;

>>   	}

>> @@ -281,7 +282,10 @@ ipa_clock_init(struct device *dev, const struct ipa_clock_data *data)

>>   

>>   	clk = clk_get(dev, "core");

>>   	if (IS_ERR(clk)) {

>> -		dev_err(dev, "error %ld getting core clock\n", PTR_ERR(clk));

>> +		ret = PTR_ERR(clk);

>> +		if (ret != -EPROBE_DEFER)

>> +			dev_err(dev, "error %d getting core clock\n", ret);

>> +

>>   		return ERR_CAST(clk);

>>   	}

>>   

>>

>
diff mbox series

Patch

diff --git a/drivers/net/ipa/ipa_clock.c b/drivers/net/ipa/ipa_clock.c
index 354675a643db5..238a713f6b604 100644
--- a/drivers/net/ipa/ipa_clock.c
+++ b/drivers/net/ipa/ipa_clock.c
@@ -1,7 +1,7 @@ 
 // SPDX-License-Identifier: GPL-2.0
 
 /* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
- * Copyright (C) 2018-2020 Linaro Ltd.
+ * Copyright (C) 2018-2021 Linaro Ltd.
  */
 
 #include <linux/refcount.h>
@@ -68,8 +68,9 @@  static int ipa_interconnect_init_one(struct device *dev,
 	if (IS_ERR(path)) {
 		int ret = PTR_ERR(path);
 
-		dev_err(dev, "error %d getting %s interconnect\n", ret,
-			data->name);
+		if (ret != -EPROBE_DEFER)
+			dev_err(dev, "error %d getting %s interconnect\n", ret,
+				data->name);
 
 		return ret;
 	}
@@ -281,7 +282,10 @@  ipa_clock_init(struct device *dev, const struct ipa_clock_data *data)
 
 	clk = clk_get(dev, "core");
 	if (IS_ERR(clk)) {
-		dev_err(dev, "error %ld getting core clock\n", PTR_ERR(clk));
+		ret = PTR_ERR(clk);
+		if (ret != -EPROBE_DEFER)
+			dev_err(dev, "error %d getting core clock\n", ret);
+
 		return ERR_CAST(clk);
 	}