mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
drivers: rkflash: nandc: use dev_pm_ops instead of legacy callback
If the device has a 'power-domains' property that the power framework prefer to use dev_pm_ops for suspend&resume. The legacy suspend & resume callback for nandc driver would not be used. Anyway, it's better use dev_pm_ops whether 'power-domains' is existent. Change-Id: I0e2822a44f3f0d458b778636cd84c5ae54505cf5 Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
This commit is contained in:
@@ -139,16 +139,20 @@ static int rknandc_probe(struct platform_device *pdev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int rknandc_suspend(struct platform_device *pdev, pm_message_t state)
|
||||
static int __maybe_unused rknandc_suspend(struct device *dev)
|
||||
{
|
||||
return rkflash_dev_suspend();
|
||||
}
|
||||
|
||||
static int rknandc_resume(struct platform_device *pdev)
|
||||
static int __maybe_unused rknandc_resume(struct device *dev)
|
||||
{
|
||||
return rkflash_dev_resume(g_nandc_info.reg_base);
|
||||
}
|
||||
|
||||
static SIMPLE_DEV_PM_OPS(rknandc_pmops,
|
||||
rknandc_suspend,
|
||||
rknandc_resume);
|
||||
|
||||
static void rknandc_shutdown(struct platform_device *pdev)
|
||||
{
|
||||
rkflash_dev_shutdown();
|
||||
@@ -164,14 +168,13 @@ static const struct of_device_id of_rknandc_match[] = {
|
||||
|
||||
static struct platform_driver rknandc_driver = {
|
||||
.probe = rknandc_probe,
|
||||
.suspend = rknandc_suspend,
|
||||
.resume = rknandc_resume,
|
||||
.shutdown = rknandc_shutdown,
|
||||
.driver = {
|
||||
.name = "rknandc",
|
||||
#ifdef CONFIG_OF
|
||||
.of_match_table = of_rknandc_match,
|
||||
#endif
|
||||
.pm = &rknandc_pmops,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user