driver core: platform: Make use of the helper macro SET_RUNTIME_PM_OPS()
authorCai Huoqing <caihuoqing@baidu.com>
Sat, 28 Aug 2021 09:02:19 +0000 (17:02 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Sep 2021 14:52:41 +0000 (16:52 +0200)
Use the helper macro SET_RUNTIME_PM_OPS() instead of the verbose
operators ".runtime_suspend/.runtime_resume", because the
SET_RUNTIME_PM_OPS() is a nice helper macro that could be brought
in to make code a little clearer, a little more concise.

Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
Link: https://lore.kernel.org/r/20210828090219.1177-1-caihuoqing@baidu.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/platform.c

index 652531f67135a6f6b31ecad499f4962f34f91e22..598acf93a360c701630e0e32a06a8710445aba95 100644 (file)
@@ -1466,8 +1466,7 @@ int platform_dma_configure(struct device *dev)
 }
 
 static const struct dev_pm_ops platform_dev_pm_ops = {
-       .runtime_suspend = pm_generic_runtime_suspend,
-       .runtime_resume = pm_generic_runtime_resume,
+       SET_RUNTIME_PM_OPS(pm_generic_runtime_suspend, pm_generic_runtime_resume, NULL)
        USE_PLATFORM_PM_SLEEP_OPS
 };