diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2008-04-22 13:42:05 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-24 13:07:43 -0400 |
commit | ab6c46e24a3c89c1e2d0d3959e119583e1bc92d9 (patch) | |
tree | c64ba84af1ec78289a9022874566605765a2010a /drivers/media/video/tuner-i2c.h | |
parent | bdb0aace95d42571ea054a56ed053f868336e13a (diff) |
V4L/DVB (7184): make hybrid_tuner_request_state tolerant of devices without i2c adapters
Some dvb demodulators access the tuner directly without using i2c.
In these cases, i2c_adap may be NULL. This patch fixes
hybrid_tuner_request_state to allow for NULL i2c_adapters.
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 | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/media/video/tuner-i2c.h b/drivers/media/video/tuner-i2c.h index c53c327a487c..60ba794809fe 100644 --- a/drivers/media/video/tuner-i2c.h +++ b/drivers/media/video/tuner-i2c.h | |||
@@ -83,7 +83,8 @@ static inline int tuner_i2c_xfer_send_recv(struct tuner_i2c_props *props, | |||
83 | 83 | ||
84 | #define tuner_printk(kernlvl, i2cprops, fmt, arg...) do { \ | 84 | #define tuner_printk(kernlvl, i2cprops, fmt, arg...) do { \ |
85 | printk(kernlvl "%s %d-%04x: " fmt, i2cprops.name, \ | 85 | printk(kernlvl "%s %d-%04x: " fmt, i2cprops.name, \ |
86 | i2c_adapter_id(i2cprops.adap), \ | 86 | i2cprops.adap ? \ |
87 | i2c_adapter_id(i2cprops.adap) : -1, \ | ||
87 | i2cprops.addr, ##arg); \ | 88 | i2cprops.addr, ##arg); \ |
88 | } while (0) | 89 | } while (0) |
89 | 90 | ||
@@ -128,9 +129,10 @@ static inline int tuner_i2c_xfer_send_recv(struct tuner_i2c_props *props, | |||
128 | ({ \ | 129 | ({ \ |
129 | int __ret = 0; \ | 130 | int __ret = 0; \ |
130 | list_for_each_entry(state, &list, hybrid_tuner_instance_list) { \ | 131 | list_for_each_entry(state, &list, hybrid_tuner_instance_list) { \ |
131 | if ((i2c_adapter_id(state->i2c_props.adap) == \ | 132 | if ((state->i2c_props.addr == i2caddr) && \ |
132 | i2c_adapter_id(i2cadap)) && \ | 133 | ((state->i2c_props.adap ? \ |
133 | (state->i2c_props.addr == i2caddr)) { \ | 134 | i2c_adapter_id(state->i2c_props.adap) : -1) == \ |
135 | (i2cadap ? i2c_adapter_id(i2cadap) : -1))) { \ | ||
134 | __tuner_info(state->i2c_props, \ | 136 | __tuner_info(state->i2c_props, \ |
135 | "attaching existing instance\n"); \ | 137 | "attaching existing instance\n"); \ |
136 | state->i2c_props.count++; \ | 138 | state->i2c_props.count++; \ |