Skip to content

Commit b6cc78d

Browse files
committed
ALSA: Drop superfluous argument from snd_power_wait()
The power_state argument of snd_power_wait() is superfluous, receiving only SNDRV_POWER_STATE_D0. Let's drop it in all callers for simplicity. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Acked-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20210523090920.15345-6-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 968bb2b commit b6cc78d

File tree

5 files changed

+6
-10
lines changed

5 files changed

+6
-10
lines changed

include/sound/core.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -189,12 +189,12 @@ static inline void snd_power_sync_ref(struct snd_card *card)
189189
}
190190

191191
/* init.c */
192-
int snd_power_wait(struct snd_card *card, unsigned int power_state);
192+
int snd_power_wait(struct snd_card *card);
193193
int snd_power_ref_and_wait(struct snd_card *card);
194194

195195
#else /* ! CONFIG_PM */
196196

197-
static inline int snd_power_wait(struct snd_card *card, unsigned int state) { return 0; }
197+
static inline int snd_power_wait(struct snd_card *card) { return 0; }
198198
static inline void snd_power_ref(struct snd_card *card) {}
199199
static inline void snd_power_unref(struct snd_card *card) {}
200200
static inline int snd_power_ref_and_wait(struct snd_card *card) { return 0; }

sound/core/init.c

+1-5
Original file line numberDiff line numberDiff line change
@@ -1050,19 +1050,15 @@ EXPORT_SYMBOL_GPL(snd_power_ref_and_wait);
10501050
/**
10511051
* snd_power_wait - wait until the card gets powered up (old form)
10521052
* @card: soundcard structure
1053-
* @power_state: expected power state
10541053
*
10551054
* Wait until the card gets powered up to SNDRV_CTL_POWER_D0 state.
1056-
* @power_state must be SNDRV_CTL_POWER_D0.
10571055
*
10581056
* Return: Zero if successful, or a negative error code.
10591057
*/
1060-
int snd_power_wait(struct snd_card *card, unsigned int power_state)
1058+
int snd_power_wait(struct snd_card *card)
10611059
{
10621060
int ret;
10631061

1064-
if (WARN_ON(power_state != SNDRV_CTL_POWER_D0))
1065-
return 0;
10661062
ret = snd_power_ref_and_wait(card);
10671063
snd_power_unref(card);
10681064
return ret;

sound/core/pcm_native.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -3193,7 +3193,7 @@ static int snd_pcm_common_ioctl(struct file *file,
31933193
if (PCM_RUNTIME_CHECK(substream))
31943194
return -ENXIO;
31953195

3196-
res = snd_power_wait(substream->pcm->card, SNDRV_CTL_POWER_D0);
3196+
res = snd_power_wait(substream->pcm->card);
31973197
if (res < 0)
31983198
return res;
31993199

sound/soc/soc-core.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ int snd_soc_suspend(struct device *dev)
580580
* Due to the resume being scheduled into a workqueue we could
581581
* suspend before that's finished - wait for it to complete.
582582
*/
583-
snd_power_wait(card->snd_card, SNDRV_CTL_POWER_D0);
583+
snd_power_wait(card->snd_card);
584584

585585
/* we're going to block userspace touching us until resume completes */
586586
snd_power_change_state(card->snd_card, SNDRV_CTL_POWER_D3hot);

sound/usb/usx2y/us122l.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ static int usb_stream_hwdep_ioctl(struct snd_hwdep *hw, struct file *file,
379379
if (cfg.period_frames < min_period_frames)
380380
return -EINVAL;
381381

382-
snd_power_wait(hw->card, SNDRV_CTL_POWER_D0);
382+
snd_power_wait(hw->card);
383383

384384
mutex_lock(&us122l->mutex);
385385
s = us122l->sk.s;

0 commit comments

Comments
 (0)