summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/tuner-i2c.h
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2008-03-15 19:41:43 -0400
committerMichael Krufky <mkrufky@linuxtv.org>2008-03-15 19:41:43 -0400
commit48ec32d387d424a6b051d1f1d59bdaa28dadf228 (patch)
treee512d5243c6ac828a4115b7bb700fec365d2b689 /linux/drivers/media/video/tuner-i2c.h
parentcafc731a90a72a074c05cf2d7e4a67f3fa596b76 (diff)
downloadmediapointer-dvb-s2-48ec32d387d424a6b051d1f1d59bdaa28dadf228.tar.gz
mediapointer-dvb-s2-48ec32d387d424a6b051d1f1d59bdaa28dadf228.tar.bz2
tuner: prevent instance sharing if i2c adapter is NULL
From: Michael Krufky <mkrufky@linuxtv.org> 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>
Diffstat (limited to 'linux/drivers/media/video/tuner-i2c.h')
-rw-r--r--linux/drivers/media/video/tuner-i2c.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/linux/drivers/media/video/tuner-i2c.h b/linux/drivers/media/video/tuner-i2c.h
index 60ba79480..3ad6c8e0b 100644
--- a/linux/drivers/media/video/tuner-i2c.h
+++ b/linux/drivers/media/video/tuner-i2c.h
@@ -129,10 +129,10 @@ static inline int tuner_i2c_xfer_send_recv(struct tuner_i2c_props *props,
({ \
int __ret = 0; \
list_for_each_entry(state, &list, hybrid_tuner_instance_list) { \
- if ((state->i2c_props.addr == i2caddr) && \
- ((state->i2c_props.adap ? \
- i2c_adapter_id(state->i2c_props.adap) : -1) == \
- (i2cadap ? i2c_adapter_id(i2cadap) : -1))) { \
+ if (((i2cadap) && (state->i2c_props.adap)) && \
+ ((i2c_adapter_id(state->i2c_props.adap) == \
+ i2c_adapter_id(i2cadap)) && \
+ (i2caddr == state->i2c_props.addr))) { \
__tuner_info(state->i2c_props, \
"attaching existing instance\n"); \
state->i2c_props.count++; \