diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2008-02-10 19:02:59 -0500 |
---|---|---|
committer | Michael Krufky <mkrufky@linuxtv.org> | 2008-02-10 19:02:59 -0500 |
commit | 3551bb176929327211be22bd960a486ea8499d87 (patch) | |
tree | 7598d5f5ed110803d740e2f90774eb255cd8217b /linux/drivers/media | |
parent | f24dbc55111e61322e06334d7f0bc7f39ebbde0d (diff) | |
download | mediapointer-dvb-s2-3551bb176929327211be22bd960a486ea8499d87.tar.gz mediapointer-dvb-s2-3551bb176929327211be22bd960a486ea8499d87.tar.bz2 |
make hybrid_tuner_request_state tolerant of devices without i2c adapters
From: Michael Krufky <mkrufky@linuxtv.org>
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>
Diffstat (limited to 'linux/drivers/media')
-rw-r--r-- | linux/drivers/media/video/tuner-i2c.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/linux/drivers/media/video/tuner-i2c.h b/linux/drivers/media/video/tuner-i2c.h index c53c327a4..60ba79480 100644 --- a/linux/drivers/media/video/tuner-i2c.h +++ b/linux/drivers/media/video/tuner-i2c.h @@ -83,7 +83,8 @@ static inline int tuner_i2c_xfer_send_recv(struct tuner_i2c_props *props, #define tuner_printk(kernlvl, i2cprops, fmt, arg...) do { \ printk(kernlvl "%s %d-%04x: " fmt, i2cprops.name, \ - i2c_adapter_id(i2cprops.adap), \ + i2cprops.adap ? \ + i2c_adapter_id(i2cprops.adap) : -1, \ i2cprops.addr, ##arg); \ } while (0) @@ -128,9 +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 ((i2c_adapter_id(state->i2c_props.adap) == \ - i2c_adapter_id(i2cadap)) && \ - (state->i2c_props.addr == i2caddr)) { \ + if ((state->i2c_props.addr == i2caddr) && \ + ((state->i2c_props.adap ? \ + i2c_adapter_id(state->i2c_props.adap) : -1) == \ + (i2cadap ? i2c_adapter_id(i2cadap) : -1))) { \ __tuner_info(state->i2c_props, \ "attaching existing instance\n"); \ state->i2c_props.count++; \ |