Commit cbac4b0c authored by Takashi Iwai's avatar Takashi Iwai Committed by Jaroslav Kysela

[ALSA] Cleanup unused argument for snd_power_wait()

Removed the unused file argument of snd_power_wait().
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 6285ae1d
...@@ -170,7 +170,7 @@ static inline void snd_power_change_state(struct snd_card *card, unsigned int st ...@@ -170,7 +170,7 @@ static inline void snd_power_change_state(struct snd_card *card, unsigned int st
} }
/* init.c */ /* init.c */
int snd_power_wait(struct snd_card *card, unsigned int power_state, struct file *file); int snd_power_wait(struct snd_card *card, unsigned int power_state);
#else /* ! CONFIG_PM */ #else /* ! CONFIG_PM */
......
...@@ -664,7 +664,7 @@ static int snd_ctl_elem_info_user(struct snd_ctl_file *ctl, ...@@ -664,7 +664,7 @@ static int snd_ctl_elem_info_user(struct snd_ctl_file *ctl,
if (copy_from_user(&info, _info, sizeof(info))) if (copy_from_user(&info, _info, sizeof(info)))
return -EFAULT; return -EFAULT;
snd_power_lock(ctl->card); snd_power_lock(ctl->card);
result = snd_power_wait(ctl->card, SNDRV_CTL_POWER_D0, NULL); result = snd_power_wait(ctl->card, SNDRV_CTL_POWER_D0);
if (result >= 0) if (result >= 0)
result = snd_ctl_elem_info(ctl, &info); result = snd_ctl_elem_info(ctl, &info);
snd_power_unlock(ctl->card); snd_power_unlock(ctl->card);
...@@ -718,7 +718,7 @@ static int snd_ctl_elem_read_user(struct snd_card *card, ...@@ -718,7 +718,7 @@ static int snd_ctl_elem_read_user(struct snd_card *card,
return -EFAULT; return -EFAULT;
} }
snd_power_lock(card); snd_power_lock(card);
result = snd_power_wait(card, SNDRV_CTL_POWER_D0, NULL); result = snd_power_wait(card, SNDRV_CTL_POWER_D0);
if (result >= 0) if (result >= 0)
result = snd_ctl_elem_read(card, control); result = snd_ctl_elem_read(card, control);
snd_power_unlock(card); snd_power_unlock(card);
...@@ -783,7 +783,7 @@ static int snd_ctl_elem_write_user(struct snd_ctl_file *file, ...@@ -783,7 +783,7 @@ static int snd_ctl_elem_write_user(struct snd_ctl_file *file,
} }
card = file->card; card = file->card;
snd_power_lock(card); snd_power_lock(card);
result = snd_power_wait(card, SNDRV_CTL_POWER_D0, NULL); result = snd_power_wait(card, SNDRV_CTL_POWER_D0);
if (result >= 0) if (result >= 0)
result = snd_ctl_elem_write(card, file, control); result = snd_ctl_elem_write(card, file, control);
snd_power_unlock(card); snd_power_unlock(card);
......
...@@ -109,7 +109,7 @@ static int snd_ctl_elem_info_compat(struct snd_ctl_file *ctl, ...@@ -109,7 +109,7 @@ static int snd_ctl_elem_info_compat(struct snd_ctl_file *ctl,
goto error; goto error;
snd_power_lock(ctl->card); snd_power_lock(ctl->card);
err = snd_power_wait(ctl->card, SNDRV_CTL_POWER_D0, NULL); err = snd_power_wait(ctl->card, SNDRV_CTL_POWER_D0);
if (err >= 0) if (err >= 0)
err = snd_ctl_elem_info(ctl, data); err = snd_ctl_elem_info(ctl, data);
snd_power_unlock(ctl->card); snd_power_unlock(ctl->card);
...@@ -294,7 +294,7 @@ static int snd_ctl_elem_read_user_compat(struct snd_card *card, ...@@ -294,7 +294,7 @@ static int snd_ctl_elem_read_user_compat(struct snd_card *card,
goto error; goto error;
snd_power_lock(card); snd_power_lock(card);
err = snd_power_wait(card, SNDRV_CTL_POWER_D0, NULL); err = snd_power_wait(card, SNDRV_CTL_POWER_D0);
if (err >= 0) if (err >= 0)
err = snd_ctl_elem_read(card, data); err = snd_ctl_elem_read(card, data);
snd_power_unlock(card); snd_power_unlock(card);
...@@ -320,7 +320,7 @@ static int snd_ctl_elem_write_user_compat(struct snd_ctl_file *file, ...@@ -320,7 +320,7 @@ static int snd_ctl_elem_write_user_compat(struct snd_ctl_file *file,
goto error; goto error;
snd_power_lock(card); snd_power_lock(card);
err = snd_power_wait(card, SNDRV_CTL_POWER_D0, NULL); err = snd_power_wait(card, SNDRV_CTL_POWER_D0);
if (err >= 0) if (err >= 0)
err = snd_ctl_elem_write(card, file, data); err = snd_ctl_elem_write(card, file, data);
snd_power_unlock(card); snd_power_unlock(card);
......
...@@ -722,13 +722,12 @@ int snd_card_file_remove(struct snd_card *card, struct file *file) ...@@ -722,13 +722,12 @@ int snd_card_file_remove(struct snd_card *card, struct file *file)
* snd_power_wait - wait until the power-state is changed. * snd_power_wait - wait until the power-state is changed.
* @card: soundcard structure * @card: soundcard structure
* @power_state: expected power state * @power_state: expected power state
* @file: file structure for the O_NONBLOCK check (optional)
* *
* Waits until the power-state is changed. * Waits until the power-state is changed.
* *
* Note: the power lock must be active before call. * Note: the power lock must be active before call.
*/ */
int snd_power_wait(struct snd_card *card, unsigned int power_state, struct file *file) int snd_power_wait(struct snd_card *card, unsigned int power_state)
{ {
wait_queue_t wait; wait_queue_t wait;
int result = 0; int result = 0;
...@@ -745,12 +744,6 @@ int snd_power_wait(struct snd_card *card, unsigned int power_state, struct file ...@@ -745,12 +744,6 @@ int snd_power_wait(struct snd_card *card, unsigned int power_state, struct file
} }
if (snd_power_get_state(card) == power_state) if (snd_power_get_state(card) == power_state)
break; break;
#if 0 /* block all devices */
if (file && (file->f_flags & O_NONBLOCK)) {
result = -EAGAIN;
break;
}
#endif
set_current_state(TASK_UNINTERRUPTIBLE); set_current_state(TASK_UNINTERRUPTIBLE);
snd_power_unlock(card); snd_power_unlock(card);
schedule_timeout(30 * HZ); schedule_timeout(30 * HZ);
......
...@@ -1170,7 +1170,7 @@ static int snd_pcm_resume(struct snd_pcm_substream *substream) ...@@ -1170,7 +1170,7 @@ static int snd_pcm_resume(struct snd_pcm_substream *substream)
int res; int res;
snd_power_lock(card); snd_power_lock(card);
if ((res = snd_power_wait(card, SNDRV_CTL_POWER_D0, substream->ffile)) >= 0) if ((res = snd_power_wait(card, SNDRV_CTL_POWER_D0)) >= 0)
res = snd_pcm_action_lock_irq(&snd_pcm_action_resume, substream, 0); res = snd_pcm_action_lock_irq(&snd_pcm_action_resume, substream, 0);
snd_power_unlock(card); snd_power_unlock(card);
return res; return res;
...@@ -1198,7 +1198,7 @@ static int snd_pcm_xrun(struct snd_pcm_substream *substream) ...@@ -1198,7 +1198,7 @@ static int snd_pcm_xrun(struct snd_pcm_substream *substream)
snd_power_lock(card); snd_power_lock(card);
if (runtime->status->state == SNDRV_PCM_STATE_SUSPENDED) { if (runtime->status->state == SNDRV_PCM_STATE_SUSPENDED) {
result = snd_power_wait(card, SNDRV_CTL_POWER_D0, substream->ffile); result = snd_power_wait(card, SNDRV_CTL_POWER_D0);
if (result < 0) if (result < 0)
goto _unlock; goto _unlock;
} }
...@@ -1319,7 +1319,7 @@ int snd_pcm_prepare(struct snd_pcm_substream *substream) ...@@ -1319,7 +1319,7 @@ int snd_pcm_prepare(struct snd_pcm_substream *substream)
struct snd_card *card = substream->pcm->card; struct snd_card *card = substream->pcm->card;
snd_power_lock(card); snd_power_lock(card);
if ((res = snd_power_wait(card, SNDRV_CTL_POWER_D0, substream->ffile)) >= 0) if ((res = snd_power_wait(card, SNDRV_CTL_POWER_D0)) >= 0)
res = snd_pcm_action_nonatomic(&snd_pcm_action_prepare, substream, 0); res = snd_pcm_action_nonatomic(&snd_pcm_action_prepare, substream, 0);
snd_power_unlock(card); snd_power_unlock(card);
return res; return res;
...@@ -1410,7 +1410,7 @@ static int snd_pcm_drain(struct snd_pcm_substream *substream) ...@@ -1410,7 +1410,7 @@ static int snd_pcm_drain(struct snd_pcm_substream *substream)
snd_power_lock(card); snd_power_lock(card);
if (runtime->status->state == SNDRV_PCM_STATE_SUSPENDED) { if (runtime->status->state == SNDRV_PCM_STATE_SUSPENDED) {
result = snd_power_wait(card, SNDRV_CTL_POWER_D0, substream->ffile); result = snd_power_wait(card, SNDRV_CTL_POWER_D0);
if (result < 0) { if (result < 0) {
snd_power_unlock(card); snd_power_unlock(card);
return result; return result;
...@@ -1533,7 +1533,7 @@ static int snd_pcm_drop(struct snd_pcm_substream *substream) ...@@ -1533,7 +1533,7 @@ static int snd_pcm_drop(struct snd_pcm_substream *substream)
snd_power_lock(card); snd_power_lock(card);
if (runtime->status->state == SNDRV_PCM_STATE_SUSPENDED) { if (runtime->status->state == SNDRV_PCM_STATE_SUSPENDED) {
result = snd_power_wait(card, SNDRV_CTL_POWER_D0, substream->ffile); result = snd_power_wait(card, SNDRV_CTL_POWER_D0);
if (result < 0) if (result < 0)
goto _unlock; goto _unlock;
} }
......
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