diff options
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r-- | drivers/media/dvb/frontends/au8522_dig.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/media/dvb/frontends/au8522_dig.c b/drivers/media/dvb/frontends/au8522_dig.c index b04346687c68..7e24b914dbe5 100644 --- a/drivers/media/dvb/frontends/au8522_dig.c +++ b/drivers/media/dvb/frontends/au8522_dig.c | |||
@@ -34,6 +34,7 @@ static int debug; | |||
34 | /* Despite the name "hybrid_tuner", the framework works just as well for | 34 | /* Despite the name "hybrid_tuner", the framework works just as well for |
35 | hybrid demodulators as well... */ | 35 | hybrid demodulators as well... */ |
36 | static LIST_HEAD(hybrid_tuner_instance_list); | 36 | static LIST_HEAD(hybrid_tuner_instance_list); |
37 | static DEFINE_MUTEX(au8522_list_mutex); | ||
37 | 38 | ||
38 | #define dprintk(arg...) do { \ | 39 | #define dprintk(arg...) do { \ |
39 | if (debug) \ | 40 | if (debug) \ |
@@ -795,15 +796,23 @@ static struct dvb_frontend_ops au8522_ops; | |||
795 | int au8522_get_state(struct au8522_state **state, struct i2c_adapter *i2c, | 796 | int au8522_get_state(struct au8522_state **state, struct i2c_adapter *i2c, |
796 | u8 client_address) | 797 | u8 client_address) |
797 | { | 798 | { |
798 | return hybrid_tuner_request_state(struct au8522_state, (*state), | 799 | int ret; |
799 | hybrid_tuner_instance_list, | 800 | |
800 | i2c, client_address, "au8522"); | 801 | mutex_lock(&au8522_list_mutex); |
802 | ret = hybrid_tuner_request_state(struct au8522_state, (*state), | ||
803 | hybrid_tuner_instance_list, | ||
804 | i2c, client_address, "au8522"); | ||
805 | mutex_unlock(&au8522_list_mutex); | ||
806 | |||
807 | return ret; | ||
801 | } | 808 | } |
802 | 809 | ||
803 | void au8522_release_state(struct au8522_state *state) | 810 | void au8522_release_state(struct au8522_state *state) |
804 | { | 811 | { |
812 | mutex_lock(&au8522_list_mutex); | ||
805 | if (state != NULL) | 813 | if (state != NULL) |
806 | hybrid_tuner_release_state(state); | 814 | hybrid_tuner_release_state(state); |
815 | mutex_unlock(&au8522_list_mutex); | ||
807 | } | 816 | } |
808 | 817 | ||
809 | 818 | ||