diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-07-02 11:22:40 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-07-03 07:58:19 +0200 |
commit | 284e7ca75f96a18f182cce38ba76ee724fb97e16 (patch) | |
tree | c5dedd35372f9978e5f68d2c31a57ce6afdc0c87 /sound/drivers | |
parent | 8bf01d8abc55eaf8e19a2d48911c8e49ee6f5bab (diff) | |
download | linux-284e7ca75f96a18f182cce38ba76ee724fb97e16.tar.bz2 |
ALSA: convert PM ops of platform_driver to new pm ops
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/drivers')
-rw-r--r-- | sound/drivers/aloop.c | 19 | ||||
-rw-r--r-- | sound/drivers/dummy.c | 18 | ||||
-rw-r--r-- | sound/drivers/pcsp/pcsp.c | 11 |
3 files changed, 27 insertions, 21 deletions
diff --git a/sound/drivers/aloop.c b/sound/drivers/aloop.c index 3484411bd5e6..1128b35b2b05 100644 --- a/sound/drivers/aloop.c +++ b/sound/drivers/aloop.c @@ -1177,10 +1177,9 @@ static int __devexit loopback_remove(struct platform_device *devptr) } #ifdef CONFIG_PM -static int loopback_suspend(struct platform_device *pdev, - pm_message_t state) +static int loopback_suspend(struct device *pdev) { - struct snd_card *card = platform_get_drvdata(pdev); + struct snd_card *card = dev_get_drvdata(pdev); struct loopback *loopback = card->private_data; snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); @@ -1190,13 +1189,18 @@ static int loopback_suspend(struct platform_device *pdev, return 0; } -static int loopback_resume(struct platform_device *pdev) +static int loopback_resume(struct device *pdev) { - struct snd_card *card = platform_get_drvdata(pdev); + struct snd_card *card = dev_get_drvdata(pdev); snd_power_change_state(card, SNDRV_CTL_POWER_D0); return 0; } + +static SIMPLE_DEV_PM_OPS(loopback_pm, loopback_suspend, loopback_resume); +#define LOOPBACK_PM_OPS &loopback_pm +#else +#define LOOPBACK_PM_OPS NULL #endif #define SND_LOOPBACK_DRIVER "snd_aloop" @@ -1204,13 +1208,10 @@ static int loopback_resume(struct platform_device *pdev) static struct platform_driver loopback_driver = { .probe = loopback_probe, .remove = __devexit_p(loopback_remove), -#ifdef CONFIG_PM - .suspend = loopback_suspend, - .resume = loopback_resume, -#endif .driver = { .name = SND_LOOPBACK_DRIVER, .owner = THIS_MODULE, + .pm = LOOPBACK_PM_OPS, }, }; diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c index bc79c441a8f2..f7d3bfc6bca8 100644 --- a/sound/drivers/dummy.c +++ b/sound/drivers/dummy.c @@ -1065,9 +1065,9 @@ static int __devexit snd_dummy_remove(struct platform_device *devptr) } #ifdef CONFIG_PM -static int snd_dummy_suspend(struct platform_device *pdev, pm_message_t state) +static int snd_dummy_suspend(struct device *pdev) { - struct snd_card *card = platform_get_drvdata(pdev); + struct snd_card *card = dev_get_drvdata(pdev); struct snd_dummy *dummy = card->private_data; snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); @@ -1075,13 +1075,18 @@ static int snd_dummy_suspend(struct platform_device *pdev, pm_message_t state) return 0; } -static int snd_dummy_resume(struct platform_device *pdev) +static int snd_dummy_resume(struct device *pdev) { - struct snd_card *card = platform_get_drvdata(pdev); + struct snd_card *card = dev_get_drvdata(pdev); snd_power_change_state(card, SNDRV_CTL_POWER_D0); return 0; } + +static SIMPLE_DEV_PM_OPS(snd_dummy_pm, snd_dummy_suspend, snd_dummy_resume); +#define SND_DUMMY_PM_OPS &snd_dummy_pm +#else +#define SND_DUMMY_PM_OPS NULL #endif #define SND_DUMMY_DRIVER "snd_dummy" @@ -1089,13 +1094,10 @@ static int snd_dummy_resume(struct platform_device *pdev) static struct platform_driver snd_dummy_driver = { .probe = snd_dummy_probe, .remove = __devexit_p(snd_dummy_remove), -#ifdef CONFIG_PM - .suspend = snd_dummy_suspend, - .resume = snd_dummy_resume, -#endif .driver = { .name = SND_DUMMY_DRIVER, .owner = THIS_MODULE, + .pm = SND_DUMMY_PM_OPS, }, }; diff --git a/sound/drivers/pcsp/pcsp.c b/sound/drivers/pcsp/pcsp.c index 99704e6a2e26..6ca59fc6dcb9 100644 --- a/sound/drivers/pcsp/pcsp.c +++ b/sound/drivers/pcsp/pcsp.c @@ -200,15 +200,18 @@ static void pcsp_stop_beep(struct snd_pcsp *chip) } #ifdef CONFIG_PM -static int pcsp_suspend(struct platform_device *dev, pm_message_t state) +static int pcsp_suspend(struct device *dev) { - struct snd_pcsp *chip = platform_get_drvdata(dev); + struct snd_pcsp *chip = dev_get_drvdata(dev); pcsp_stop_beep(chip); snd_pcm_suspend_all(chip->pcm); return 0; } + +static SIMPLE_DEV_PM_OPS(pcsp_pm, pcsp_suspend, NULL); +#define PCSP_PM_OPS &pcsp_pm #else -#define pcsp_suspend NULL +#define PCSP_PM_OPS NULL #endif /* CONFIG_PM */ static void pcsp_shutdown(struct platform_device *dev) @@ -221,10 +224,10 @@ static struct platform_driver pcsp_platform_driver = { .driver = { .name = "pcspkr", .owner = THIS_MODULE, + .pm = PCSP_PM_OPS, }, .probe = pcsp_probe, .remove = __devexit_p(pcsp_remove), - .suspend = pcsp_suspend, .shutdown = pcsp_shutdown, }; |