Skip to content

Commit a6f06b9

Browse files
committed
pinctrl: renesas: Allow the compiler to optimize away sh_pfc_pm
The conversion to DEFINE_NOIRQ_DEV_PM_OPS() lost the ability of the compiler to optimize away the struct dev_pm_ops object when it is not needed. Fix this by replacing the use of pm_sleep_ptr() by a custom wrapper. Fixes: 727eb02 ("pinctrl: renesas: Switch to use DEFINE_NOIRQ_DEV_PM_OPS() helper") Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/6238a78e32fa21f0c795406b6cba7bce7af92577.1708513940.git.geert+renesas@glider.be
1 parent 254203f commit a6f06b9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/pinctrl/renesas/core.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -737,10 +737,12 @@ static int sh_pfc_resume_noirq(struct device *dev)
737737
sh_pfc_walk_regs(pfc, sh_pfc_restore_reg);
738738
return 0;
739739
}
740+
#define pm_psci_sleep_ptr(_ptr) pm_sleep_ptr(_ptr)
740741
#else
741742
static int sh_pfc_suspend_init(struct sh_pfc *pfc) { return 0; }
742743
static int sh_pfc_suspend_noirq(struct device *dev) { return 0; }
743744
static int sh_pfc_resume_noirq(struct device *dev) { return 0; }
745+
#define pm_psci_sleep_ptr(_ptr) PTR_IF(false, (_ptr))
744746
#endif /* CONFIG_ARM_PSCI_FW */
745747

746748
static DEFINE_NOIRQ_DEV_PM_OPS(sh_pfc_pm, sh_pfc_suspend_noirq, sh_pfc_resume_noirq);
@@ -1423,7 +1425,7 @@ static struct platform_driver sh_pfc_driver = {
14231425
.driver = {
14241426
.name = DRV_NAME,
14251427
.of_match_table = of_match_ptr(sh_pfc_of_table),
1426-
.pm = pm_sleep_ptr(&sh_pfc_pm),
1428+
.pm = pm_psci_sleep_ptr(&sh_pfc_pm),
14271429
},
14281430
};
14291431

0 commit comments

Comments
 (0)