diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2009-02-18 16:22:16 +0100 |
---|---|---|
committer | Hans Verkuil <hverkuil@xs4all.nl> | 2009-02-18 16:22:16 +0100 |
commit | 0e80661eedb37a2d8810e6de027c2530db814c27 (patch) | |
tree | db0f04f0a71a828169daa23a90d3c0630845ed2d /linux/drivers/media | |
parent | b6705f84947f09dd3858f839267c9662fdbd667b (diff) | |
download | mediapointer-dvb-s2-0e80661eedb37a2d8810e6de027c2530db814c27.tar.gz mediapointer-dvb-s2-0e80661eedb37a2d8810e6de027c2530db814c27.tar.bz2 |
saa7115: don't access reg 0x87 if it is not present.
From: Hans Verkuil <hverkuil@xs4all.nl>
Devices like the saa7111 do not have this register, so check for this
before using it.
Priority: normal
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'linux/drivers/media')
-rw-r--r-- | linux/drivers/media/video/saa7115.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/linux/drivers/media/video/saa7115.c b/linux/drivers/media/video/saa7115.c index 9fbb93775..2e868fade 100644 --- a/linux/drivers/media/video/saa7115.c +++ b/linux/drivers/media/video/saa7115.c @@ -1309,11 +1309,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; } |