mtd: rawnand: stm32_fmc2: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
Subsystems (3)
PATCH 1/1 mtd: rawnand: stm32_fmc2: 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, also reduces kernel size in case CONFIG_PM or CONFIG_PM_SLEEP is disabled.
--- drivers/mtd/nand/raw/stm32_fmc2_nand.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/mtd/nand/raw/stm32_fmc2_nand.c +4 -4
@@ -2076,7 +2076,7 @@ static void stm32_fmc2_nfc_remove(struct platform_device *pdev)stm32_fmc2_nfc_wp_enable (nand); } -static int __maybe_unused stm32_fmc2_nfc_suspend (struct device *dev) +static int stm32_fmc2_nfc_suspend (struct device *dev) {struct stm32_fmc2_nfc *nfc =dev_get_drvdata (dev);struct stm32_fmc2_nand *nand = &nfc->nand;
@@ -2090,7 +2090,7 @@ static int __maybe_unused stm32_fmc2_nfc_suspend(struct device *dev)return 0 ; } -static int __maybe_unused stm32_fmc2_nfc_resume (struct device *dev) +static int stm32_fmc2_nfc_resume (struct device *dev) {struct stm32_fmc2_nfc *nfc =dev_get_drvdata (dev);struct stm32_fmc2_nand *nand = &nfc->nand;
@@ -2118,7 +2118,7 @@ static int __maybe_unused stm32_fmc2_nfc_resume(struct device *dev)return 0 ; } -static SIMPLE_DEV_PM_OPS(stm32_fmc2_nfc_pm_ops, stm32_fmc2_nfc_suspend, +static DEFINE_SIMPLE_DEV_PM_OPS(stm32_fmc2_nfc_pm_ops, stm32_fmc2_nfc_suspend, stm32_fmc2_nfc_resume);static const struct stm32_fmc2_nfc_data stm32_fmc2_nfc_mp1_data = {
@@ -2153,7 +2153,7 @@ static struct platform_driver stm32_fmc2_nfc_driver = { .driver = { .name = "stm32_fmc2_nfc", .of_match_table = stm32_fmc2_nfc_match, - .pm = &stm32_fmc2_nfc_pm_ops, + .pm = pm_sleep_ptr(&stm32_fmc2_nfc_pm_ops), }, };module_platform_driver (stm32_fmc2_nfc_driver);
Signature · 1 line
2.53.0
Quoted 8 lines · Triet Hoang
Convert the deprecated
SIMPLE_DEV_PM_OPStoDEFINE_SIMPLE_DEV_PM_OPSandpm_sleep_ptr().This lets us drop the
__maybe_unusedannotations from its suspend and resume callbacks, also reduces kernel size in caseCONFIG_PMorCONFIG_PM_SLEEPis disabled.[...]
Applied to nand/next, thanks!
[1/1] mtd: rawnand: stm32_fmc2: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
commit: 09ec4fe9036ed0a0293518dc11f2480423d1139a
Patche(s) should be available on mtd/linux.git and will be part of the next PR (provided that no robot complains by then).
Kind regards,
Miquèl