diff mbox series

[3/3] i2c: qcom-geni: Silence NACK and GENI_TIMEOUT

Message ID 20220717035027.2135106-4-bjorn.andersson@linaro.org (mailing list archive)
State Not Applicable
Headers show
Series i2c: qcom-geni: Make it possible to run i2cdetect | expand

Commit Message

Bjorn Andersson July 17, 2022, 3:50 a.m. UTC
Turn NACK and GENI_TIMEOUT into debug prints to silence the kernel log
when running things such as i2cdetect to scan the bus.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---
 drivers/i2c/busses/i2c-qcom-geni.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Vinod Koul July 18, 2022, 5:37 a.m. UTC | #1
On 16-07-22, 20:50, Bjorn Andersson wrote:
> Turn NACK and GENI_TIMEOUT into debug prints to silence the kernel log
> when running things such as i2cdetect to scan the bus.

Reviewed-by: Vinod Koul <vkoul@kernel.org>

> 
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---
>  drivers/i2c/busses/i2c-qcom-geni.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c
> index e212e7ae7ad2..6ac179a373ff 100644
> --- a/drivers/i2c/busses/i2c-qcom-geni.c
> +++ b/drivers/i2c/busses/i2c-qcom-geni.c
> @@ -208,6 +208,10 @@ static void geni_i2c_err(struct geni_i2c_dev *gi2c, int err)
>  	case GENI_ABORT_DONE:
>  		gi2c->abort_done = true;
>  		break;
> +	case NACK:
> +	case GENI_TIMEOUT:
> +		dev_dbg(gi2c->se.dev, "%s\n", gi2c_log[err].msg);
> +		break;
>  	default:
>  		dev_err(gi2c->se.dev, "%s\n", gi2c_log[err].msg);
>  		geni_i2c_err_misc(gi2c);
> -- 
> 2.35.1
Wolfram Sang July 24, 2022, 5:23 a.m. UTC | #2
On Sat, Jul 16, 2022 at 08:50:27PM -0700, Bjorn Andersson wrote:
> Turn NACK and GENI_TIMEOUT into debug prints to silence the kernel log
> when running things such as i2cdetect to scan the bus.
> 
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>

As mentioned, I squashed it with the previous patch.

> +	case NACK:
> +	case GENI_TIMEOUT:
> +		dev_dbg(gi2c->se.dev, "%s\n", gi2c_log[err].msg);
> +		break;

Additional note: the dbg messages in this function are superfluous. We
already have all this information with the tracepoints in i2c_transfer.
diff mbox series

Patch

diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c
index e212e7ae7ad2..6ac179a373ff 100644
--- a/drivers/i2c/busses/i2c-qcom-geni.c
+++ b/drivers/i2c/busses/i2c-qcom-geni.c
@@ -208,6 +208,10 @@  static void geni_i2c_err(struct geni_i2c_dev *gi2c, int err)
 	case GENI_ABORT_DONE:
 		gi2c->abort_done = true;
 		break;
+	case NACK:
+	case GENI_TIMEOUT:
+		dev_dbg(gi2c->se.dev, "%s\n", gi2c_log[err].msg);
+		break;
 	default:
 		dev_err(gi2c->se.dev, "%s\n", gi2c_log[err].msg);
 		geni_i2c_err_misc(gi2c);