diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-12-03 19:36:18 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-01-21 08:10:01 -0500 |
commit | e25d0bf917e8f3b6b5bafdc2fe666ca81eb9099d (patch) | |
tree | e652a29b01877a974ddd228192f15baa321f6ff2 /drivers/spi/spi-s3c64xx.c | |
parent | c2573128ad1ff36a7e231799c102be2413a2f756 (diff) |
spi/s3c64xx: Convert to dev_pm_ops
In preparation for the addition of runtime PM ops.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/spi/spi-s3c64xx.c')
-rw-r--r-- | drivers/spi/spi-s3c64xx.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index d56066bcbb94..56dbdf15cba1 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c | |||
@@ -1231,9 +1231,9 @@ static int s3c64xx_spi_remove(struct platform_device *pdev) | |||
1231 | } | 1231 | } |
1232 | 1232 | ||
1233 | #ifdef CONFIG_PM | 1233 | #ifdef CONFIG_PM |
1234 | static int s3c64xx_spi_suspend(struct platform_device *pdev, pm_message_t state) | 1234 | static int s3c64xx_spi_suspend(struct device *dev) |
1235 | { | 1235 | { |
1236 | struct spi_master *master = spi_master_get(platform_get_drvdata(pdev)); | 1236 | struct spi_master *master = spi_master_get(dev_get_drvdata(dev)); |
1237 | struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master); | 1237 | struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master); |
1238 | unsigned long flags; | 1238 | unsigned long flags; |
1239 | 1239 | ||
@@ -1253,9 +1253,10 @@ static int s3c64xx_spi_suspend(struct platform_device *pdev, pm_message_t state) | |||
1253 | return 0; | 1253 | return 0; |
1254 | } | 1254 | } |
1255 | 1255 | ||
1256 | static int s3c64xx_spi_resume(struct platform_device *pdev) | 1256 | static int s3c64xx_spi_resume(struct device *dev) |
1257 | { | 1257 | { |
1258 | struct spi_master *master = spi_master_get(platform_get_drvdata(pdev)); | 1258 | struct platform_device *pdev = to_platform_device(dev); |
1259 | struct spi_master *master = spi_master_get(dev_get_drvdata(dev)); | ||
1259 | struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master); | 1260 | struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master); |
1260 | struct s3c64xx_spi_info *sci = sdd->cntrlr_info; | 1261 | struct s3c64xx_spi_info *sci = sdd->cntrlr_info; |
1261 | unsigned long flags; | 1262 | unsigned long flags; |
@@ -1274,19 +1275,19 @@ static int s3c64xx_spi_resume(struct platform_device *pdev) | |||
1274 | 1275 | ||
1275 | return 0; | 1276 | return 0; |
1276 | } | 1277 | } |
1277 | #else | ||
1278 | #define s3c64xx_spi_suspend NULL | ||
1279 | #define s3c64xx_spi_resume NULL | ||
1280 | #endif /* CONFIG_PM */ | 1278 | #endif /* CONFIG_PM */ |
1281 | 1279 | ||
1280 | static const struct dev_pm_ops s3c64xx_spi_pm = { | ||
1281 | SET_SYSTEM_SLEEP_PM_OPS(s3c64xx_spi_suspend, s3c64xx_spi_resume) | ||
1282 | }; | ||
1283 | |||
1282 | static struct platform_driver s3c64xx_spi_driver = { | 1284 | static struct platform_driver s3c64xx_spi_driver = { |
1283 | .driver = { | 1285 | .driver = { |
1284 | .name = "s3c64xx-spi", | 1286 | .name = "s3c64xx-spi", |
1285 | .owner = THIS_MODULE, | 1287 | .owner = THIS_MODULE, |
1288 | .pm = &s3c64xx_spi_pm, | ||
1286 | }, | 1289 | }, |
1287 | .remove = s3c64xx_spi_remove, | 1290 | .remove = s3c64xx_spi_remove, |
1288 | .suspend = s3c64xx_spi_suspend, | ||
1289 | .resume = s3c64xx_spi_resume, | ||
1290 | }; | 1291 | }; |
1291 | MODULE_ALIAS("platform:s3c64xx-spi"); | 1292 | MODULE_ALIAS("platform:s3c64xx-spi"); |
1292 | 1293 | ||