diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2012-07-05 16:11:33 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2012-07-06 13:07:00 -0400 |
commit | 156ffcb42a3b3fbebbb7f0e08e679b0954c0829c (patch) | |
tree | 0752345513efda4932e72c2301d91f6088b1aec1 /drivers/block | |
parent | 9033132ddff7d096f3e54704c4250384c5ab3aa2 (diff) |
mg_disk: Use struct dev_pm_ops for power management
Make the mg_disk driver define its PM callbacks through
a struct dev_pm_ops object rather than by using legacy PM hooks
in struct platform_driver.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/mg_disk.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/block/mg_disk.c b/drivers/block/mg_disk.c index 76fa3deaee84..1788f491e0fb 100644 --- a/drivers/block/mg_disk.c +++ b/drivers/block/mg_disk.c | |||
@@ -780,9 +780,9 @@ static const struct block_device_operations mg_disk_ops = { | |||
780 | .getgeo = mg_getgeo | 780 | .getgeo = mg_getgeo |
781 | }; | 781 | }; |
782 | 782 | ||
783 | static int mg_suspend(struct platform_device *plat_dev, pm_message_t state) | 783 | static int mg_suspend(struct device *dev) |
784 | { | 784 | { |
785 | struct mg_drv_data *prv_data = plat_dev->dev.platform_data; | 785 | struct mg_drv_data *prv_data = dev->platform_data; |
786 | struct mg_host *host = prv_data->host; | 786 | struct mg_host *host = prv_data->host; |
787 | 787 | ||
788 | if (mg_wait(host, MG_STAT_READY, MG_TMAX_CONF_TO_CMD)) | 788 | if (mg_wait(host, MG_STAT_READY, MG_TMAX_CONF_TO_CMD)) |
@@ -804,9 +804,9 @@ static int mg_suspend(struct platform_device *plat_dev, pm_message_t state) | |||
804 | return 0; | 804 | return 0; |
805 | } | 805 | } |
806 | 806 | ||
807 | static int mg_resume(struct platform_device *plat_dev) | 807 | static int mg_resume(struct device *dev) |
808 | { | 808 | { |
809 | struct mg_drv_data *prv_data = plat_dev->dev.platform_data; | 809 | struct mg_drv_data *prv_data = dev->platform_data; |
810 | struct mg_host *host = prv_data->host; | 810 | struct mg_host *host = prv_data->host; |
811 | 811 | ||
812 | if (mg_wait(host, MG_STAT_READY, MG_TMAX_CONF_TO_CMD)) | 812 | if (mg_wait(host, MG_STAT_READY, MG_TMAX_CONF_TO_CMD)) |
@@ -825,6 +825,8 @@ static int mg_resume(struct platform_device *plat_dev) | |||
825 | return 0; | 825 | return 0; |
826 | } | 826 | } |
827 | 827 | ||
828 | static SIMPLE_DEV_PM_OPS(mg_pm, mg_suspend, mg_resume); | ||
829 | |||
828 | static int mg_probe(struct platform_device *plat_dev) | 830 | static int mg_probe(struct platform_device *plat_dev) |
829 | { | 831 | { |
830 | struct mg_host *host; | 832 | struct mg_host *host; |
@@ -1074,11 +1076,10 @@ static int mg_remove(struct platform_device *plat_dev) | |||
1074 | static struct platform_driver mg_disk_driver = { | 1076 | static struct platform_driver mg_disk_driver = { |
1075 | .probe = mg_probe, | 1077 | .probe = mg_probe, |
1076 | .remove = mg_remove, | 1078 | .remove = mg_remove, |
1077 | .suspend = mg_suspend, | ||
1078 | .resume = mg_resume, | ||
1079 | .driver = { | 1079 | .driver = { |
1080 | .name = MG_DEV_NAME, | 1080 | .name = MG_DEV_NAME, |
1081 | .owner = THIS_MODULE, | 1081 | .owner = THIS_MODULE, |
1082 | .pm = &mg_pm, | ||
1082 | } | 1083 | } |
1083 | }; | 1084 | }; |
1084 | 1085 | ||