Skip to content

Commit

Permalink
i2c: turn recovery error on init to debug
Browse files Browse the repository at this point in the history
commit e409a6a upstream.

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>
Tested-by: Klaus Kudielka <klaus.kudielka@gmail.com>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Cc: stable@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Wolfram Sang authored and gregkh committed Apr 14, 2021
1 parent bf230ab commit 9056443
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/i2c/i2c-core-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}

Expand All @@ -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;
Expand Down

0 comments on commit 9056443

Please sign in to comment.