Commit 674a3232 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab
Browse files

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: default avatarHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 10afbef1
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -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) {
	if (state->enable == enable)
		return 0;
	state->enable = enable;
		saa711x_write(sd, R_87_I_PORT_I_O_ENA_OUT_CLK_AND_GATED,
				state->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;
}