diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-03-23 23:44:19 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-03-23 23:44:19 -0500 |
commit | 1ebbe2b20091d306453a5cf480a87e6cd28ae76f (patch) | |
tree | f5cd7a0fa69b8b1938cb5a0faed2e7b0628072a5 /sound/core/control_compat.c | |
parent | ac58c9059da8886b5e8cde012a80266b18ca146e (diff) | |
parent | 674a396c6d2ba0341ebdd7c1c9950f32f018e2dd (diff) |
Merge branch 'linus'
Diffstat (limited to 'sound/core/control_compat.c')
-rw-r--r-- | sound/core/control_compat.c | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/sound/core/control_compat.c b/sound/core/control_compat.c index a529b62972b4..84fef5084e17 100644 --- a/sound/core/control_compat.c +++ b/sound/core/control_compat.c | |||
@@ -107,7 +107,13 @@ static int snd_ctl_elem_info_compat(struct snd_ctl_file *ctl, | |||
107 | */ | 107 | */ |
108 | if (get_user(data->value.enumerated.item, &data32->value.enumerated.item)) | 108 | if (get_user(data->value.enumerated.item, &data32->value.enumerated.item)) |
109 | goto error; | 109 | goto error; |
110 | err = snd_ctl_elem_info(ctl, data); | 110 | |
111 | snd_power_lock(ctl->card); | ||
112 | err = snd_power_wait(ctl->card, SNDRV_CTL_POWER_D0, NULL); | ||
113 | if (err >= 0) | ||
114 | err = snd_ctl_elem_info(ctl, data); | ||
115 | snd_power_unlock(ctl->card); | ||
116 | |||
111 | if (err < 0) | 117 | if (err < 0) |
112 | goto error; | 118 | goto error; |
113 | /* restore info to 32bit */ | 119 | /* restore info to 32bit */ |
@@ -286,9 +292,14 @@ static int snd_ctl_elem_read_user_compat(struct snd_card *card, | |||
286 | 292 | ||
287 | if ((err = copy_ctl_value_from_user(card, data, data32, &type, &count)) < 0) | 293 | if ((err = copy_ctl_value_from_user(card, data, data32, &type, &count)) < 0) |
288 | goto error; | 294 | goto error; |
289 | if ((err = snd_ctl_elem_read(card, data)) < 0) | 295 | |
290 | goto error; | 296 | snd_power_lock(card); |
291 | err = copy_ctl_value_to_user(data32, data, type, count); | 297 | err = snd_power_wait(card, SNDRV_CTL_POWER_D0, NULL); |
298 | if (err >= 0) | ||
299 | err = snd_ctl_elem_read(card, data); | ||
300 | snd_power_unlock(card); | ||
301 | if (err >= 0) | ||
302 | err = copy_ctl_value_to_user(data32, data, type, count); | ||
292 | error: | 303 | error: |
293 | kfree(data); | 304 | kfree(data); |
294 | return err; | 305 | return err; |
@@ -298,17 +309,23 @@ static int snd_ctl_elem_write_user_compat(struct snd_ctl_file *file, | |||
298 | struct snd_ctl_elem_value32 __user *data32) | 309 | struct snd_ctl_elem_value32 __user *data32) |
299 | { | 310 | { |
300 | struct snd_ctl_elem_value *data; | 311 | struct snd_ctl_elem_value *data; |
312 | struct snd_card *card = file->card; | ||
301 | int err, type, count; | 313 | int err, type, count; |
302 | 314 | ||
303 | data = kzalloc(sizeof(*data), GFP_KERNEL); | 315 | data = kzalloc(sizeof(*data), GFP_KERNEL); |
304 | if (data == NULL) | 316 | if (data == NULL) |
305 | return -ENOMEM; | 317 | return -ENOMEM; |
306 | 318 | ||
307 | if ((err = copy_ctl_value_from_user(file->card, data, data32, &type, &count)) < 0) | 319 | if ((err = copy_ctl_value_from_user(card, data, data32, &type, &count)) < 0) |
308 | goto error; | ||
309 | if ((err = snd_ctl_elem_write(file->card, file, data)) < 0) | ||
310 | goto error; | 320 | goto error; |
311 | err = copy_ctl_value_to_user(data32, data, type, count); | 321 | |
322 | snd_power_lock(card); | ||
323 | err = snd_power_wait(card, SNDRV_CTL_POWER_D0, NULL); | ||
324 | if (err >= 0) | ||
325 | err = snd_ctl_elem_write(card, file, data); | ||
326 | snd_power_unlock(card); | ||
327 | if (err >= 0) | ||
328 | err = copy_ctl_value_to_user(data32, data, type, count); | ||
312 | error: | 329 | error: |
313 | kfree(data); | 330 | kfree(data); |
314 | return err; | 331 | return err; |