All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Young <sean@mess.org>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: mchehab@kernel.org, linux-media@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] media: rc: i2c: Fix an error message
Date: Wed, 12 May 2021 17:36:51 +0100	[thread overview]
Message-ID: <20210512163651.GA5987@gofer.mess.org> (raw)
In-Reply-To: <179fb4cda2b79904fc9cf1d7d8e61153e30fae6b.1620279452.git.christophe.jaillet@wanadoo.fr>

On Thu, May 06, 2021 at 07:38:56AM +0200, Christophe JAILLET wrote:
> 'ret' is known to be 1 here. In fact 'i' is expected instead.
> Store the return value of 'i2c_master_recv()' in 'ret' so that the error
> message print the correct error code.

Nice catch, applied!

Thanks
Sean

> 
> Fixes: acaa34bf06e9 ('media: rc: implement zilog transmitter")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>  drivers/media/i2c/ir-kbd-i2c.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/i2c/ir-kbd-i2c.c b/drivers/media/i2c/ir-kbd-i2c.c
> index e8119ad0bc71..92376592455e 100644
> --- a/drivers/media/i2c/ir-kbd-i2c.c
> +++ b/drivers/media/i2c/ir-kbd-i2c.c
> @@ -678,8 +678,8 @@ static int zilog_tx(struct rc_dev *rcdev, unsigned int *txbuf,
>  		goto out_unlock;
>  	}
>  
> -	i = i2c_master_recv(ir->tx_c, buf, 1);
> -	if (i != 1) {
> +	ret = i2c_master_recv(ir->tx_c, buf, 1);
> +	if (ret != 1) {
>  		dev_err(&ir->rc->dev, "i2c_master_recv failed with %d\n", ret);
>  		ret = -EIO;
>  		goto out_unlock;
> -- 
> 2.30.2

      reply	other threads:[~2021-05-12 17:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-06  5:38 [PATCH] media: rc: i2c: Fix an error message Christophe JAILLET
2021-05-12 16:36 ` Sean Young [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210512163651.GA5987@gofer.mess.org \
    --to=sean@mess.org \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.