Commit cac2b0eb authored by Michael Krufky's avatar Michael Krufky Committed by Mauro Carvalho Chehab

V4L/DVB (7379): tuner: prevent instance sharing if i2c adapter is NULL

We currently do not have a method to enable instance staring if i2c adapter
is NULL, in the cases of dvb demods that write to the tuner directly using
calc_regs.  Prevent possible wrong instance sharing for these cases until
a better solution can be found.
Signed-off-by: default avatarMichael Krufky <mkrufky@linuxtv.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 7daa4a88
...@@ -129,10 +129,10 @@ static inline int tuner_i2c_xfer_send_recv(struct tuner_i2c_props *props, ...@@ -129,10 +129,10 @@ static inline int tuner_i2c_xfer_send_recv(struct tuner_i2c_props *props,
({ \ ({ \
int __ret = 0; \ int __ret = 0; \
list_for_each_entry(state, &list, hybrid_tuner_instance_list) { \ list_for_each_entry(state, &list, hybrid_tuner_instance_list) { \
if ((state->i2c_props.addr == i2caddr) && \ if (((i2cadap) && (state->i2c_props.adap)) && \
((state->i2c_props.adap ? \ ((i2c_adapter_id(state->i2c_props.adap) == \
i2c_adapter_id(state->i2c_props.adap) : -1) == \ i2c_adapter_id(i2cadap)) && \
(i2cadap ? i2c_adapter_id(i2cadap) : -1))) { \ (i2caddr == state->i2c_props.addr))) { \
__tuner_info(state->i2c_props, \ __tuner_info(state->i2c_props, \
"attaching existing instance\n"); \ "attaching existing instance\n"); \
state->i2c_props.count++; \ state->i2c_props.count++; \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment