* [PATCH] media: rc: i2c: Fix an error message
@ 2021-05-06 5:38 Christophe JAILLET
2021-05-12 16:36 ` Sean Young
0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2021-05-06 5:38 UTC (permalink / raw)
To: mchehab, sean
Cc: linux-media, linux-kernel, kernel-janitors, Christophe JAILLET
'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.
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] media: rc: i2c: Fix an error message
2021-05-06 5:38 [PATCH] media: rc: i2c: Fix an error message Christophe JAILLET
@ 2021-05-12 16:36 ` Sean Young
0 siblings, 0 replies; 2+ messages in thread
From: Sean Young @ 2021-05-12 16:36 UTC (permalink / raw)
To: Christophe JAILLET; +Cc: mchehab, linux-media, linux-kernel, kernel-janitors
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-05-12 17:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-06 5:38 [PATCH] media: rc: i2c: Fix an error message Christophe JAILLET
2021-05-12 16:36 ` Sean Young
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).