diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2006-12-08 04:16:49 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-17 22:07:21 -0500 |
commit | 7686fcf7304eebd2228ec47045cb28ee3c58b1f1 (patch) | |
tree | 2854e9ab1acec9d18c0fc92c99516e3971a7b2c2 /sound/oss/dmasound | |
parent | 8a8b836b91aa170a383f2f360b73d3d23160d9d7 (diff) |
[PATCH] more work_struct fixes: tas300x sound drivers
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'sound/oss/dmasound')
-rw-r--r-- | sound/oss/dmasound/tas3001c.c | 14 | ||||
-rw-r--r-- | sound/oss/dmasound/tas3004.c | 15 |
2 files changed, 14 insertions, 15 deletions
diff --git a/sound/oss/dmasound/tas3001c.c b/sound/oss/dmasound/tas3001c.c index f227c9f688cc..2f21a3c00374 100644 --- a/sound/oss/dmasound/tas3001c.c +++ b/sound/oss/dmasound/tas3001c.c | |||
@@ -50,6 +50,7 @@ struct tas3001c_data_t { | |||
50 | int output_id; | 50 | int output_id; |
51 | int speaker_id; | 51 | int speaker_id; |
52 | struct tas_drce_t drce_state; | 52 | struct tas_drce_t drce_state; |
53 | struct work_struct change; | ||
53 | }; | 54 | }; |
54 | 55 | ||
55 | 56 | ||
@@ -667,14 +668,13 @@ tas3001c_update_device_parameters(struct tas3001c_data_t *self) | |||
667 | } | 668 | } |
668 | 669 | ||
669 | static void | 670 | static void |
670 | tas3001c_device_change_handler(void *self) | 671 | tas3001c_device_change_handler(struct work_struct *work) |
671 | { | 672 | { |
672 | if (self) | 673 | struct tas3001c_data_t *self; |
673 | tas3001c_update_device_parameters(self); | 674 | self = container_of(work, struct tas3001c_data_t, change); |
675 | tas3001c_update_device_parameters(self); | ||
674 | } | 676 | } |
675 | 677 | ||
676 | static struct work_struct device_change; | ||
677 | |||
678 | static int | 678 | static int |
679 | tas3001c_output_device_change( struct tas3001c_data_t *self, | 679 | tas3001c_output_device_change( struct tas3001c_data_t *self, |
680 | int device_id, | 680 | int device_id, |
@@ -685,7 +685,7 @@ tas3001c_output_device_change( struct tas3001c_data_t *self, | |||
685 | self->output_id=output_id; | 685 | self->output_id=output_id; |
686 | self->speaker_id=speaker_id; | 686 | self->speaker_id=speaker_id; |
687 | 687 | ||
688 | schedule_work(&device_change); | 688 | schedule_work(&self->change); |
689 | return 0; | 689 | return 0; |
690 | } | 690 | } |
691 | 691 | ||
@@ -823,7 +823,7 @@ tas3001c_init(struct i2c_client *client) | |||
823 | tas3001c_write_biquad_shadow(self, i, j, | 823 | tas3001c_write_biquad_shadow(self, i, j, |
824 | &tas3001c_eq_unity); | 824 | &tas3001c_eq_unity); |
825 | 825 | ||
826 | INIT_WORK(&device_change, tas3001c_device_change_handler, self); | 826 | INIT_WORK(&self->change, tas3001c_device_change_handler); |
827 | return 0; | 827 | return 0; |
828 | } | 828 | } |
829 | 829 | ||
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 | ||