aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi_s3c24xx.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/drivers/spi/spi_s3c24xx.c b/drivers/spi/spi_s3c24xx.c
index 705841fb4ca0..03695b67ebd5 100644
--- a/drivers/spi/spi_s3c24xx.c
+++ b/drivers/spi/spi_s3c24xx.c
@@ -418,9 +418,9 @@ static int __exit s3c24xx_spi_remove(struct platform_device *dev)
418 418
419#ifdef CONFIG_PM 419#ifdef CONFIG_PM
420 420
421static int s3c24xx_spi_suspend(struct platform_device *pdev, pm_message_t msg) 421static int s3c24xx_spi_suspend(struct device *dev)
422{ 422{
423 struct s3c24xx_spi *hw = platform_get_drvdata(pdev); 423 struct s3c24xx_spi *hw = platform_get_drvdata(to_platform_device(dev));
424 424
425 if (hw->pdata && hw->pdata->gpio_setup) 425 if (hw->pdata && hw->pdata->gpio_setup)
426 hw->pdata->gpio_setup(hw->pdata, 0); 426 hw->pdata->gpio_setup(hw->pdata, 0);
@@ -429,27 +429,31 @@ static int s3c24xx_spi_suspend(struct platform_device *pdev, pm_message_t msg)
429 return 0; 429 return 0;
430} 430}
431 431
432static int s3c24xx_spi_resume(struct platform_device *pdev) 432static int s3c24xx_spi_resume(struct device *dev)
433{ 433{
434 struct s3c24xx_spi *hw = platform_get_drvdata(pdev); 434 struct s3c24xx_spi *hw = platform_get_drvdata(to_platform_device(dev));
435 435
436 s3c24xx_spi_initialsetup(hw); 436 s3c24xx_spi_initialsetup(hw);
437 return 0; 437 return 0;
438} 438}
439 439
440static struct dev_pm_ops s3c24xx_spi_pmops = {
441 .suspend = s3c24xx_spi_suspend,
442 .resume = s3c24xx_spi_resume,
443};
444
445#define S3C24XX_SPI_PMOPS &s3c24xx_spi_pmops
440#else 446#else
441#define s3c24xx_spi_suspend NULL 447#define S3C24XX_SPI_PMOPS NULL
442#define s3c24xx_spi_resume NULL 448#endif /* CONFIG_PM */
443#endif
444 449
445MODULE_ALIAS("platform:s3c2410-spi"); 450MODULE_ALIAS("platform:s3c2410-spi");
446static struct platform_driver s3c24xx_spi_driver = { 451static struct platform_driver s3c24xx_spi_driver = {
447 .remove = __exit_p(s3c24xx_spi_remove), 452 .remove = __exit_p(s3c24xx_spi_remove),
448 .suspend = s3c24xx_spi_suspend,
449 .resume = s3c24xx_spi_resume,
450 .driver = { 453 .driver = {
451 .name = "s3c2410-spi", 454 .name = "s3c2410-spi",
452 .owner = THIS_MODULE, 455 .owner = THIS_MODULE,
456 .pm = S3C24XX_SPI_PMOPS,
453 }, 457 },
454}; 458};
455 459