aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@s-opensource.com>2018-03-23 07:48:08 -0400
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2018-03-23 07:48:08 -0400
commitafdb4ca2be93d02cd1902395a7191097963dd8c1 (patch)
tree05c464df2e6ce9a7cc6c63ac1588636bc02f25bc /drivers/media
parentmedia: tm6000: avoid casting just to print pointer address (diff)
downloadlinux-dev-afdb4ca2be93d02cd1902395a7191097963dd8c1.tar.xz
linux-dev-afdb4ca2be93d02cd1902395a7191097963dd8c1.zip
media: tda9840: cleanup a warning
There's a false positive warning there: drivers/media/i2c/tda9840.c:79 tda9840_status() error: uninitialized symbol 'byte'. Change the code to match our coding style, in order to fix it. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/i2c/tda9840.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/media/i2c/tda9840.c b/drivers/media/i2c/tda9840.c
index f31e659588ac..0dd6ff3e6201 100644
--- a/drivers/media/i2c/tda9840.c
+++ b/drivers/media/i2c/tda9840.c
@@ -68,11 +68,15 @@ static void tda9840_write(struct v4l2_subdev *sd, u8 reg, u8 val)
static int tda9840_status(struct v4l2_subdev *sd)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
+ int rc;
u8 byte;
- if (1 != i2c_master_recv(client, &byte, 1)) {
+ rc = i2c_master_recv(client, &byte, 1);
+ if (rc != 1) {
v4l2_dbg(1, debug, sd,
"i2c_master_recv() failed\n");
+ if (rc < 0)
+ return rc;
return -EIO;
}