diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2009-02-18 12:22:16 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-03-30 12:42:54 -0300 |
commit | 674a323218ab0b0be100b51c251a72787b5c9e3a (patch) | |
tree | 6e69635ebea119dca9de7236550d5977220ce3f6 /drivers | |
parent | 10afbef15e7bba5e1008f583852077743d28c395 (diff) |
V4L/DVB (10700): saa7115: don't access reg 0x87 if it is not present.
Devices like the saa7111 do not have this register, so check for this
before using it.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/saa7115.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/media/video/saa7115.c b/drivers/media/video/saa7115.c index a845582ca5d..b1c5f63bb77 100644 --- a/drivers/media/video/saa7115.c +++ b/drivers/media/video/saa7115.c @@ -1310,11 +1310,12 @@ static int saa711x_s_stream(struct v4l2_subdev *sd, int enable) v4l2_dbg(1, debug, sd, "%s output\n", enable ? "enable" : "disable"); - if (state->enable != enable) { - state->enable = enable; - saa711x_write(sd, R_87_I_PORT_I_O_ENA_OUT_CLK_AND_GATED, - state->enable); - } + if (state->enable == enable) + return 0; + state->enable = enable; + if (!saa711x_has_reg(state->ident, R_87_I_PORT_I_O_ENA_OUT_CLK_AND_GATED)) + return 0; + saa711x_write(sd, R_87_I_PORT_I_O_ENA_OUT_CLK_AND_GATED, state->enable); return 0; } |