diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2008-04-22 13:46:04 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-24 13:07:51 -0400 |
commit | cac2b0eb18e140e2f63146d0f97691e9238570b6 (patch) | |
tree | a787ce86b8b276bc936e0a16c74893fdb53c083c /drivers/media/video/tuner-i2c.h | |
parent | 7daa4a8897e79911f524ddac065adea05c7e9b16 (diff) |
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: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/tuner-i2c.h')
-rw-r--r-- | drivers/media/video/tuner-i2c.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/media/video/tuner-i2c.h b/drivers/media/video/tuner-i2c.h index 60ba794809fe..3ad6c8e0b04c 100644 --- a/drivers/media/video/tuner-i2c.h +++ b/drivers/media/video/tuner-i2c.h | |||
@@ -129,10 +129,10 @@ static inline int tuner_i2c_xfer_send_recv(struct tuner_i2c_props *props, | |||
129 | ({ \ | 129 | ({ \ |
130 | int __ret = 0; \ | 130 | int __ret = 0; \ |
131 | list_for_each_entry(state, &list, hybrid_tuner_instance_list) { \ | 131 | list_for_each_entry(state, &list, hybrid_tuner_instance_list) { \ |
132 | if ((state->i2c_props.addr == i2caddr) && \ | 132 | if (((i2cadap) && (state->i2c_props.adap)) && \ |
133 | ((state->i2c_props.adap ? \ | 133 | ((i2c_adapter_id(state->i2c_props.adap) == \ |
134 | i2c_adapter_id(state->i2c_props.adap) : -1) == \ | 134 | i2c_adapter_id(i2cadap)) && \ |
135 | (i2cadap ? i2c_adapter_id(i2cadap) : -1))) { \ | 135 | (i2caddr == state->i2c_props.addr))) { \ |
136 | __tuner_info(state->i2c_props, \ | 136 | __tuner_info(state->i2c_props, \ |
137 | "attaching existing instance\n"); \ | 137 | "attaching existing instance\n"); \ |
138 | state->i2c_props.count++; \ | 138 | state->i2c_props.count++; \ |