ALSA: platform: Check CONFIG_PM_SLEEP instead of CONFIG_PM
[linux-3.10.git] / sound / atmel / ac97c.c
index f5ded64..3c8d3ba 100644 (file)
@@ -1134,10 +1134,10 @@ err_snd_card_new:
        return retval;
 }
 
-#ifdef CONFIG_PM
-static int atmel_ac97c_suspend(struct platform_device *pdev, pm_message_t msg)
+#ifdef CONFIG_PM_SLEEP
+static int atmel_ac97c_suspend(struct device *pdev)
 {
-       struct snd_card *card = platform_get_drvdata(pdev);
+       struct snd_card *card = dev_get_drvdata(pdev);
        struct atmel_ac97c *chip = card->private_data;
 
        if (cpu_is_at32ap7000()) {
@@ -1151,9 +1151,9 @@ static int atmel_ac97c_suspend(struct platform_device *pdev, pm_message_t msg)
        return 0;
 }
 
-static int atmel_ac97c_resume(struct platform_device *pdev)
+static int atmel_ac97c_resume(struct device *pdev)
 {
-       struct snd_card *card = platform_get_drvdata(pdev);
+       struct snd_card *card = dev_get_drvdata(pdev);
        struct atmel_ac97c *chip = card->private_data;
 
        clk_enable(chip->pclk);
@@ -1165,9 +1165,11 @@ static int atmel_ac97c_resume(struct platform_device *pdev)
        }
        return 0;
 }
+
+static SIMPLE_DEV_PM_OPS(atmel_ac97c_pm, atmel_ac97c_suspend, atmel_ac97c_resume);
+#define ATMEL_AC97C_PM_OPS     &atmel_ac97c_pm
 #else
-#define atmel_ac97c_suspend NULL
-#define atmel_ac97c_resume NULL
+#define ATMEL_AC97C_PM_OPS     NULL
 #endif
 
 static int __devexit atmel_ac97c_remove(struct platform_device *pdev)
@@ -1210,9 +1212,9 @@ static struct platform_driver atmel_ac97c_driver = {
        .remove         = __devexit_p(atmel_ac97c_remove),
        .driver         = {
                .name   = "atmel_ac97c",
+               .owner  = THIS_MODULE,
+               .pm     = ATMEL_AC97C_PM_OPS,
        },
-       .suspend        = atmel_ac97c_suspend,
-       .resume         = atmel_ac97c_resume,
 };
 
 static int __init atmel_ac97c_init(void)