diff options
author | Takashi Iwai <tiwai@suse.de> | 2017-08-30 17:13:25 +0300 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2017-08-30 21:44:29 +0300 |
commit | 7d8e8292013ab72ae1f1500cbc91f198ccb1826d (patch) | |
tree | 5586c0e3b0483c98d1fe210a87246fd70131ba35 /include/sound/core.h | |
parent | 3454a476f2f5d6d3cac3b3f907190ffc58c4fd6f (diff) | |
download | linux-7d8e8292013ab72ae1f1500cbc91f198ccb1826d.tar.xz |
ALSA: Get rid of card power_lock
Currently we're taking power_lock at each card component for assuring
the power-up sequence, but it doesn't help anything in the
implementation at the moment: it just serializes unnecessarily the
callers, but it doesn't protect about the power state change itself.
It used to have some usefulness in the early days where we managed the
PM manually. But now the suspend/resume core procedure is beyond our
hands, and power_lock lost its meaning.
This patch drops the power_lock from allover the places.
There shouldn't be any issues by this change, as it's no helper
regarding the power state change. Rather we'll get better performance
by removing the serialization; which is the only slight concern of any
behavior change, but it can't be a showstopper, after all.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'include/sound/core.h')
-rw-r--r-- | include/sound/core.h | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/include/sound/core.h b/include/sound/core.h index 357f36b5ee80..4104a9d1001f 100644 --- a/include/sound/core.h +++ b/include/sound/core.h @@ -136,7 +136,6 @@ struct snd_card { #ifdef CONFIG_PM unsigned int power_state; /* power state */ - struct mutex power_lock; /* power lock */ wait_queue_head_t power_sleep; #endif @@ -149,16 +148,6 @@ struct snd_card { #define dev_to_snd_card(p) container_of(p, struct snd_card, card_dev) #ifdef CONFIG_PM -static inline void snd_power_lock(struct snd_card *card) -{ - mutex_lock(&card->power_lock); -} - -static inline void snd_power_unlock(struct snd_card *card) -{ - mutex_unlock(&card->power_lock); -} - static inline unsigned int snd_power_get_state(struct snd_card *card) { return card->power_state; @@ -175,8 +164,6 @@ int snd_power_wait(struct snd_card *card, unsigned int power_state); #else /* ! CONFIG_PM */ -#define snd_power_lock(card) do { (void)(card); } while (0) -#define snd_power_unlock(card) do { (void)(card); } while (0) static inline int snd_power_wait(struct snd_card *card, unsigned int state) { return 0; } #define snd_power_get_state(card) ({ (void)(card); SNDRV_CTL_POWER_D0; }) #define snd_power_change_state(card, state) do { (void)(card); } while (0) |