diff options
Diffstat (limited to 'sound/oss/dmasound/tas3004.c')
-rw-r--r-- | sound/oss/dmasound/tas3004.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/sound/oss/dmasound/tas3004.c b/sound/oss/dmasound/tas3004.c index 82eaaca2db9a..af34fb39bc29 100644 --- a/sound/oss/dmasound/tas3004.c +++ b/sound/oss/dmasound/tas3004.c | |||
@@ -48,6 +48,7 @@ struct tas3004_data_t { | |||
48 | int output_id; | 48 | int output_id; |
49 | int speaker_id; | 49 | int speaker_id; |
50 | struct tas_drce_t drce_state; | 50 | struct tas_drce_t drce_state; |
51 | struct work_struct change; | ||
51 | }; | 52 | }; |
52 | 53 | ||
53 | #define MAKE_TIME(sec,usec) (((sec)<<12) + (50000+(usec/10)*(1<<12))/100000) | 54 | #define MAKE_TIME(sec,usec) (((sec)<<12) + (50000+(usec/10)*(1<<12))/100000) |
@@ -914,15 +915,13 @@ tas3004_update_device_parameters(struct tas3004_data_t *self) | |||
914 | } | 915 | } |
915 | 916 | ||
916 | static void | 917 | static void |
917 | tas3004_device_change_handler(void *self) | 918 | tas3004_device_change_handler(struct work_struct *work) |
918 | { | 919 | { |
919 | if (!self) return; | 920 | struct tas3004_data_t *self; |
920 | 921 | self = container_of(work, struct tas3004_data_t, change); | |
921 | tas3004_update_device_parameters((struct tas3004_data_t *)self); | 922 | tas3004_update_device_parameters(self); |
922 | } | 923 | } |
923 | 924 | ||
924 | static struct work_struct device_change; | ||
925 | |||
926 | static int | 925 | static int |
927 | tas3004_output_device_change( struct tas3004_data_t *self, | 926 | tas3004_output_device_change( struct tas3004_data_t *self, |
928 | int device_id, | 927 | int device_id, |
@@ -933,7 +932,7 @@ tas3004_output_device_change( struct tas3004_data_t *self, | |||
933 | self->output_id=output_id; | 932 | self->output_id=output_id; |
934 | self->speaker_id=speaker_id; | 933 | self->speaker_id=speaker_id; |
935 | 934 | ||
936 | schedule_work(&device_change); | 935 | schedule_work(&self->change); |
937 | 936 | ||
938 | return 0; | 937 | return 0; |
939 | } | 938 | } |
@@ -1112,7 +1111,7 @@ tas3004_init(struct i2c_client *client) | |||
1112 | tas3004_write_register(self, TAS3004_REG_MCR2, &mcr2, WRITE_SHADOW); | 1111 | tas3004_write_register(self, TAS3004_REG_MCR2, &mcr2, WRITE_SHADOW); |
1113 | tas3004_write_register(self, TAS3004_REG_DRC, drce_init, WRITE_SHADOW); | 1112 | tas3004_write_register(self, TAS3004_REG_DRC, drce_init, WRITE_SHADOW); |
1114 | 1113 | ||
1115 | INIT_WORK(&device_change, tas3004_device_change_handler, self); | 1114 | INIT_WORK(&self->change, tas3004_device_change_handler); |
1116 | return 0; | 1115 | return 0; |
1117 | } | 1116 | } |
1118 | 1117 | ||