ALSA: convert PM ops of platform_driver to new pm ops
[linux-3.10.git] / sound / drivers / pcsp / pcsp.c
index 99704e6..6ca59fc 100644 (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,
 };