ALSA: convert PM ops of platform_driver to new pm ops

Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai
2012-07-02 11:22:40 +02:00
parent 8bf01d8abc
commit 284e7ca75f
7 changed files with 58 additions and 51 deletions

View File

@@ -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,
};