aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2011-11-16 03:14:03 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-11-24 15:22:22 -0500
commitbd93b3ad275501f50935a420cb26f598093d91a0 (patch)
treee92df5e4b4adf9e1330f76e062ae554ed8aac44d
parentaffc9a0d59ac49bd304e2137bd5e4ffdd6fdfa52 (diff)
[media] media/radio/tef6862: fix checking return value of i2c_master_send
i2c_master_send returns negative errno, or else the number of bytes written. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/radio/tef6862.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/media/radio/tef6862.c b/drivers/media/radio/tef6862.c
index 0991e1973678..3408685b690c 100644
--- a/drivers/media/radio/tef6862.c
+++ b/drivers/media/radio/tef6862.c
@@ -118,9 +118,11 @@ static int tef6862_s_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *f)
118 i2cmsg[2] = pll & 0xff; 118 i2cmsg[2] = pll & 0xff;
119 119
120 err = i2c_master_send(client, i2cmsg, sizeof(i2cmsg)); 120 err = i2c_master_send(client, i2cmsg, sizeof(i2cmsg));
121 if (!err) 121 if (err != sizeof(i2cmsg))
122 state->freq = f->frequency; 122 return err < 0 ? err : -EIO;
123 return err; 123
124 state->freq = f->frequency;
125 return 0;
124} 126}
125 127
126static int tef6862_g_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *f) 128static int tef6862_g_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *f)