Commit e25d0bf9 authored by Mark Brown's avatar Mark Brown

spi/s3c64xx: Convert to dev_pm_ops

In preparation for the addition of runtime PM ops.
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent c2573128
...@@ -1231,9 +1231,9 @@ static int s3c64xx_spi_remove(struct platform_device *pdev) ...@@ -1231,9 +1231,9 @@ static int s3c64xx_spi_remove(struct platform_device *pdev)
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
static int s3c64xx_spi_suspend(struct platform_device *pdev, pm_message_t state) static int s3c64xx_spi_suspend(struct device *dev)
{ {
struct spi_master *master = spi_master_get(platform_get_drvdata(pdev)); struct spi_master *master = spi_master_get(dev_get_drvdata(dev));
struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master); struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master);
unsigned long flags; unsigned long flags;
...@@ -1253,9 +1253,10 @@ static int s3c64xx_spi_suspend(struct platform_device *pdev, pm_message_t state) ...@@ -1253,9 +1253,10 @@ static int s3c64xx_spi_suspend(struct platform_device *pdev, pm_message_t state)
return 0; return 0;
} }
static int s3c64xx_spi_resume(struct platform_device *pdev) static int s3c64xx_spi_resume(struct device *dev)
{ {
struct spi_master *master = spi_master_get(platform_get_drvdata(pdev)); struct platform_device *pdev = to_platform_device(dev);
struct spi_master *master = spi_master_get(dev_get_drvdata(dev));
struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master); struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master);
struct s3c64xx_spi_info *sci = sdd->cntrlr_info; struct s3c64xx_spi_info *sci = sdd->cntrlr_info;
unsigned long flags; unsigned long flags;
...@@ -1274,19 +1275,19 @@ static int s3c64xx_spi_resume(struct platform_device *pdev) ...@@ -1274,19 +1275,19 @@ static int s3c64xx_spi_resume(struct platform_device *pdev)
return 0; return 0;
} }
#else
#define s3c64xx_spi_suspend NULL
#define s3c64xx_spi_resume NULL
#endif /* CONFIG_PM */ #endif /* CONFIG_PM */
static const struct dev_pm_ops s3c64xx_spi_pm = {
SET_SYSTEM_SLEEP_PM_OPS(s3c64xx_spi_suspend, s3c64xx_spi_resume)
};
static struct platform_driver s3c64xx_spi_driver = { static struct platform_driver s3c64xx_spi_driver = {
.driver = { .driver = {
.name = "s3c64xx-spi", .name = "s3c64xx-spi",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.pm = &s3c64xx_spi_pm,
}, },
.remove = s3c64xx_spi_remove, .remove = s3c64xx_spi_remove,
.suspend = s3c64xx_spi_suspend,
.resume = s3c64xx_spi_resume,
}; };
MODULE_ALIAS("platform:s3c64xx-spi"); MODULE_ALIAS("platform:s3c64xx-spi");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment