提交 156ffcb4 编写于 作者: R Rafael J. Wysocki

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: NRafael J. Wysocki <rjw@sisk.pl>
上级 9033132d
...@@ -780,9 +780,9 @@ static const struct block_device_operations mg_disk_ops = { ...@@ -780,9 +780,9 @@ static const struct block_device_operations mg_disk_ops = {
.getgeo = mg_getgeo .getgeo = mg_getgeo
}; };
static int mg_suspend(struct platform_device *plat_dev, pm_message_t state) static int mg_suspend(struct device *dev)
{ {
struct mg_drv_data *prv_data = plat_dev->dev.platform_data; struct mg_drv_data *prv_data = dev->platform_data;
struct mg_host *host = prv_data->host; struct mg_host *host = prv_data->host;
if (mg_wait(host, MG_STAT_READY, MG_TMAX_CONF_TO_CMD)) 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,9 +804,9 @@ static int mg_suspend(struct platform_device *plat_dev, pm_message_t state)
return 0; return 0;
} }
static int mg_resume(struct platform_device *plat_dev) static int mg_resume(struct device *dev)
{ {
struct mg_drv_data *prv_data = plat_dev->dev.platform_data; struct mg_drv_data *prv_data = dev->platform_data;
struct mg_host *host = prv_data->host; struct mg_host *host = prv_data->host;
if (mg_wait(host, MG_STAT_READY, MG_TMAX_CONF_TO_CMD)) 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,6 +825,8 @@ static int mg_resume(struct platform_device *plat_dev)
return 0; return 0;
} }
static SIMPLE_DEV_PM_OPS(mg_pm, mg_suspend, mg_resume);
static int mg_probe(struct platform_device *plat_dev) static int mg_probe(struct platform_device *plat_dev)
{ {
struct mg_host *host; struct mg_host *host;
...@@ -1074,11 +1076,10 @@ static int mg_remove(struct platform_device *plat_dev) ...@@ -1074,11 +1076,10 @@ static int mg_remove(struct platform_device *plat_dev)
static struct platform_driver mg_disk_driver = { static struct platform_driver mg_disk_driver = {
.probe = mg_probe, .probe = mg_probe,
.remove = mg_remove, .remove = mg_remove,
.suspend = mg_suspend,
.resume = mg_resume,
.driver = { .driver = {
.name = MG_DEV_NAME, .name = MG_DEV_NAME,
.owner = THIS_MODULE, .owner = THIS_MODULE,
.pm = &mg_pm,
} }
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册