Skip to content

Commit

Permalink
V4L/DVB (10700): saa7115: don't access reg 0x87 if it is not present.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Mar 30, 2009
1 parent 10afbef commit 674a323
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions drivers/media/video/saa7115.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 674a323

Please sign in to comment.