linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2c: turn recovery error on init to debug
@ 2021-03-15 11:50 Wolfram Sang
  2021-03-15 16:18 ` Klaus Kudielka
  2021-03-18 11:20 ` Wolfram Sang
  0 siblings, 2 replies; 3+ messages in thread
From: Wolfram Sang @ 2021-03-15 11:50 UTC (permalink / raw)
  To: linux-i2c; +Cc: Klaus Kudielka, Wolfram Sang

In some configurations, recovery is optional. So, don't throw an error
when it is not used because e.g. pinctrl settings for recovery are not
provided. Reword the message and make it debug output.

Reported-by: Klaus Kudielka <klaus.kudielka@gmail.com>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---

Tested on a Renesas Salvator-XS with R-Car H3 ES2.0. Klaus, let me know
if you are happy as well.

 drivers/i2c/i2c-core-base.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c
index 63ebf722a424..f21362355973 100644
--- a/drivers/i2c/i2c-core-base.c
+++ b/drivers/i2c/i2c-core-base.c
@@ -378,7 +378,7 @@ static int i2c_gpio_init_recovery(struct i2c_adapter *adap)
 static int i2c_init_recovery(struct i2c_adapter *adap)
 {
 	struct i2c_bus_recovery_info *bri = adap->bus_recovery_info;
-	char *err_str;
+	char *err_str, *err_level = KERN_ERR;
 
 	if (!bri)
 		return 0;
@@ -387,7 +387,8 @@ static int i2c_init_recovery(struct i2c_adapter *adap)
 		return -EPROBE_DEFER;
 
 	if (!bri->recover_bus) {
-		err_str = "no recover_bus() found";
+		err_str = "no suitable method provided";
+		err_level = KERN_DEBUG;
 		goto err;
 	}
 
@@ -414,7 +415,7 @@ static int i2c_init_recovery(struct i2c_adapter *adap)
 
 	return 0;
  err:
-	dev_err(&adap->dev, "Not using recovery: %s\n", err_str);
+	dev_printk(err_level, &adap->dev, "Not using recovery: %s\n", err_str);
 	adap->bus_recovery_info = NULL;
 
 	return -EINVAL;
-- 
2.30.0


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

* Re: [PATCH] i2c: turn recovery error on init to debug
  2021-03-15 11:50 [PATCH] i2c: turn recovery error on init to debug Wolfram Sang
@ 2021-03-15 16:18 ` Klaus Kudielka
  2021-03-18 11:20 ` Wolfram Sang
  1 sibling, 0 replies; 3+ messages in thread
From: Klaus Kudielka @ 2021-03-15 16:18 UTC (permalink / raw)
  To: Wolfram Sang, linux-i2c

On 15.03.21 12:50, Wolfram Sang wrote:
> In some configurations, recovery is optional. So, don't throw an error
> when it is not used because e.g. pinctrl settings for recovery are not
> provided. Reword the message and make it debug output.
>
> Reported-by: Klaus Kudielka <klaus.kudielka@gmail.com>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
>
> Tested on a Renesas Salvator-XS with R-Car H3 ES2.0. Klaus, let me know
> if you are happy as well.
Tested on a CZ.NIC Turris Omnia (on top of 5.11.6). The error message is
gone, I2C functionality still ok. I'm happy.


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

* Re: [PATCH] i2c: turn recovery error on init to debug
  2021-03-15 11:50 [PATCH] i2c: turn recovery error on init to debug Wolfram Sang
  2021-03-15 16:18 ` Klaus Kudielka
@ 2021-03-18 11:20 ` Wolfram Sang
  1 sibling, 0 replies; 3+ messages in thread
From: Wolfram Sang @ 2021-03-18 11:20 UTC (permalink / raw)
  To: linux-i2c; +Cc: Klaus Kudielka

[-- Attachment #1: Type: text/plain, Size: 451 bytes --]

On Mon, Mar 15, 2021 at 12:50:08PM +0100, Wolfram Sang wrote:
> In some configurations, recovery is optional. So, don't throw an error
> when it is not used because e.g. pinctrl settings for recovery are not
> provided. Reword the message and make it debug output.
> 
> Reported-by: Klaus Kudielka <klaus.kudielka@gmail.com>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Added stable and applied to for-current, thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2021-03-18 11:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-15 11:50 [PATCH] i2c: turn recovery error on init to debug Wolfram Sang
2021-03-15 16:18 ` Klaus Kudielka
2021-03-18 11:20 ` Wolfram Sang

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