提交 bd93b3ad 编写于 作者: A Axel Lin 提交者: Mauro Carvalho Chehab

[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: NAxel Lin <axel.lin@gmail.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 affc9a0d
......@@ -118,9 +118,11 @@ static int tef6862_s_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *f)
i2cmsg[2] = pll & 0xff;
err = i2c_master_send(client, i2cmsg, sizeof(i2cmsg));
if (!err)
state->freq = f->frequency;
return err;
if (err != sizeof(i2cmsg))
return err < 0 ? err : -EIO;
state->freq = f->frequency;
return 0;
}
static int tef6862_g_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *f)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册