[PATCH v2 00/12] mtd: Remove #ifdef guards for PM functions
Paul Cercueil
paul.cercueil at bootlin.com
Tue Nov 17 01:37:38 PST 2026
Hi,
This is the v2 of my patchset that updates the MTD core / NAND core as
well as several drivers to get rid of the #ifdef CONFIG_PM guards.
Instead, the code that depends on PM or runtime PM will be
garbage-collected by the compiler automatically if this config option is
not set.
The rationale behind this change is that in general conditionally
compiled code is a bad choice, as code behind a rarely-used config can
get broken without anybody noticing.
In this v2, I removed the pm_ptr() use on shutdown callbacks, as neither
platform_driver.shutdown() nor the mtd_suspend() / mtd_resume() that the
shutdown callbacks call are related to CONFIG_PM.
Changelog:
v2:
- [04/12]: Don't use pm_ptr(), and rewrite commit message
- [05/12]: Don't use pm_ptr(), and rewrite commit message
Cheers,
-Paul
Paul Cercueil (12):
mtd: Remove #ifdef guards for PM related functions
mtd: rawnand: vf610: Remove #ifdef guards for PM related functions
mtd: spear_smi: Remove #ifdef guards for PM related functions
mtd: physmap: Remove #ifdef guards around shutdown callback
mtd: maps: pxa2xx: Remove #ifdef guards around shutdown callback
mtd: nand: mtk: Remove #ifdef guards for PM related functions
mtd: rawnand: fsmc: Remove #ifdef guards for PM related functions
mtd: rawnand: hisi504: Remove #ifdef guards for PM related functions
mtd: rawnand: mtk: Remove #ifdef guards for PM related functions
mtd: rawnand: omap_elm: Remove #ifdef guards for PM related functions
mtd: rawnand: r852: Remove #ifdef guards for PM related functions
mtd: rawnand: txx9ndfmc: Remove #ifdef guards for PM related functions
drivers/mtd/devices/spear_smi.c | 6 ++----
drivers/mtd/maps/physmap-core.c | 4 ----
drivers/mtd/maps/pxa2xx-flash.c | 4 ----
drivers/mtd/mtdcore.c | 10 ++--------
drivers/mtd/nand/ecc-mtk.c | 8 ++------
drivers/mtd/nand/raw/fsmc_nand.c | 6 ++----
drivers/mtd/nand/raw/hisi504_nand.c | 7 +++----
drivers/mtd/nand/raw/mtk_nand.c | 8 ++------
drivers/mtd/nand/raw/omap_elm.c | 6 ++----
drivers/mtd/nand/raw/r852.c | 6 ++----
drivers/mtd/nand/raw/txx9ndfmc.c | 6 +-----
drivers/mtd/nand/raw/vf610_nfc.c | 6 ++----
12 files changed, 20 insertions(+), 57 deletions(-)
Cc: Stefan Agner <stefan at agner.ch>
Cc: Matthias Brugger <matthias.bgg at gmail.com>
Cc: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com>
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-mediatek at lists.infradead.org
Cc: Maxim Levitsky <maximlevitsky at gmail.com>
--
2.47.3
More information about the Linux-mediatek
mailing list