Commit 7686fcf7 authored by Al Viro's avatar Al Viro Committed by Linus Torvalds

[PATCH] more work_struct fixes: tas300x sound drivers

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Acked-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 8a8b836b
...@@ -50,6 +50,7 @@ struct tas3001c_data_t { ...@@ -50,6 +50,7 @@ struct tas3001c_data_t {
int output_id; int output_id;
int speaker_id; int speaker_id;
struct tas_drce_t drce_state; struct tas_drce_t drce_state;
struct work_struct change;
}; };
...@@ -667,14 +668,13 @@ tas3001c_update_device_parameters(struct tas3001c_data_t *self) ...@@ -667,14 +668,13 @@ tas3001c_update_device_parameters(struct tas3001c_data_t *self)
} }
static void static void
tas3001c_device_change_handler(void *self) tas3001c_device_change_handler(struct work_struct *work)
{ {
if (self) struct tas3001c_data_t *self;
self = container_of(work, struct tas3001c_data_t, change);
tas3001c_update_device_parameters(self); tas3001c_update_device_parameters(self);
} }
static struct work_struct device_change;
static int static int
tas3001c_output_device_change( struct tas3001c_data_t *self, tas3001c_output_device_change( struct tas3001c_data_t *self,
int device_id, int device_id,
...@@ -685,7 +685,7 @@ tas3001c_output_device_change( struct tas3001c_data_t *self, ...@@ -685,7 +685,7 @@ tas3001c_output_device_change( struct tas3001c_data_t *self,
self->output_id=output_id; self->output_id=output_id;
self->speaker_id=speaker_id; self->speaker_id=speaker_id;
schedule_work(&device_change); schedule_work(&self->change);
return 0; return 0;
} }
...@@ -823,7 +823,7 @@ tas3001c_init(struct i2c_client *client) ...@@ -823,7 +823,7 @@ tas3001c_init(struct i2c_client *client)
tas3001c_write_biquad_shadow(self, i, j, tas3001c_write_biquad_shadow(self, i, j,
&tas3001c_eq_unity); &tas3001c_eq_unity);
INIT_WORK(&device_change, tas3001c_device_change_handler, self); INIT_WORK(&self->change, tas3001c_device_change_handler);
return 0; return 0;
} }
......
...@@ -48,6 +48,7 @@ struct tas3004_data_t { ...@@ -48,6 +48,7 @@ struct tas3004_data_t {
int output_id; int output_id;
int speaker_id; int speaker_id;
struct tas_drce_t drce_state; struct tas_drce_t drce_state;
struct work_struct change;
}; };
#define MAKE_TIME(sec,usec) (((sec)<<12) + (50000+(usec/10)*(1<<12))/100000) #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,15 +915,13 @@ tas3004_update_device_parameters(struct tas3004_data_t *self)
} }
static void static void
tas3004_device_change_handler(void *self) tas3004_device_change_handler(struct work_struct *work)
{ {
if (!self) return; struct tas3004_data_t *self;
self = container_of(work, struct tas3004_data_t, change);
tas3004_update_device_parameters((struct tas3004_data_t *)self); tas3004_update_device_parameters(self);
} }
static struct work_struct device_change;
static int static int
tas3004_output_device_change( struct tas3004_data_t *self, tas3004_output_device_change( struct tas3004_data_t *self,
int device_id, int device_id,
...@@ -933,7 +932,7 @@ tas3004_output_device_change( struct tas3004_data_t *self, ...@@ -933,7 +932,7 @@ tas3004_output_device_change( struct tas3004_data_t *self,
self->output_id=output_id; self->output_id=output_id;
self->speaker_id=speaker_id; self->speaker_id=speaker_id;
schedule_work(&device_change); schedule_work(&self->change);
return 0; return 0;
} }
...@@ -1112,7 +1111,7 @@ tas3004_init(struct i2c_client *client) ...@@ -1112,7 +1111,7 @@ tas3004_init(struct i2c_client *client)
tas3004_write_register(self, TAS3004_REG_MCR2, &mcr2, WRITE_SHADOW); tas3004_write_register(self, TAS3004_REG_MCR2, &mcr2, WRITE_SHADOW);
tas3004_write_register(self, TAS3004_REG_DRC, drce_init, WRITE_SHADOW); tas3004_write_register(self, TAS3004_REG_DRC, drce_init, WRITE_SHADOW);
INIT_WORK(&device_change, tas3004_device_change_handler, self); INIT_WORK(&self->change, tas3004_device_change_handler);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment