omap-rng: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
PATCH 1/1 omap-rng: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
Convert the deprecated SIMPLE_DEV_PM_OPS
to DEFINE_SIMPLE_DEV_PM_OPS and pm_sleep_ptr().
This lets us drop the __maybe_unused annotations from its suspend and resume callbacks, and reduces kernel size in case CONFIG_PM or CONFIG_PM_SLEEP is disabled.
Signed-off-by Triet Hoang <[email protected]>
--- drivers/char/hw_random/omap-rng.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/char/hw_random/omap-rng.c +4 -4
@@ -530,7 +530,7 @@ static void omap_rng_remove(struct platform_device *pdev)clk_disable_unprepare (priv->clk_reg); } -static int __maybe_unused omap_rng_suspend (struct device *dev) +static int omap_rng_suspend (struct device *dev) {struct omap_rng_dev *priv =dev_get_drvdata (dev);
@@ -540,7 +540,7 @@ static int __maybe_unused omap_rng_suspend(struct device *dev)return 0 ; } -static int __maybe_unused omap_rng_resume (struct device *dev) +static int omap_rng_resume (struct device *dev) {struct omap_rng_dev *priv =dev_get_drvdata (dev);int ret;
@@ -556,12 +556,12 @@ static int __maybe_unused omap_rng_resume(struct device *dev)return 0 ; } -static SIMPLE_DEV_PM_OPS(omap_rng_pm, omap_rng_suspend, omap_rng_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(omap_rng_pm, omap_rng_suspend, omap_rng_resume);static struct platform_driver omap_rng_driver = { .driver = { .name ="omap_rng" , - .pm = &omap_rng_pm, + .pm =pm_sleep_ptr (&omap_rng_pm), .of_match_table =of_match_ptr (omap_rng_of_match), }, .probe = omap_rng_probe,
Signature · 1 line
2.53.0
Herbert Xu
maintainerQuoted 11 lines · Triet Hoang
Convert the deprecated
SIMPLE_DEV_PM_OPS
toDEFINE_SIMPLE_DEV_PM_OPSandpm_sleep_ptr().This lets us drop the
__maybe_unusedannotations from its suspend and resume callbacks, and reduces kernel size in caseCONFIG_PMorCONFIG_PM_SLEEPis disabled.Signed-off-by Triet Hoang <[email protected]>--- drivers/char/hw_random/omap-rng.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Patch applied. Thanks.
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt