pinctrl: renesas: Allow the compiler to optimize away sh_pfc_pm
[ Upstream commit a6f06b909fee72c679c565adfa7f080f9595e336 ]
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: 727eb02eb7
("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
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
1dee290109
commit
93664eb8d6
|
@ -731,10 +731,12 @@ static int sh_pfc_resume_noirq(struct device *dev)
|
||||||
sh_pfc_walk_regs(pfc, sh_pfc_restore_reg);
|
sh_pfc_walk_regs(pfc, sh_pfc_restore_reg);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#define pm_psci_sleep_ptr(_ptr) pm_sleep_ptr(_ptr)
|
||||||
#else
|
#else
|
||||||
static int sh_pfc_suspend_init(struct sh_pfc *pfc) { return 0; }
|
static int sh_pfc_suspend_init(struct sh_pfc *pfc) { return 0; }
|
||||||
static int sh_pfc_suspend_noirq(struct device *dev) { return 0; }
|
static int sh_pfc_suspend_noirq(struct device *dev) { return 0; }
|
||||||
static int sh_pfc_resume_noirq(struct device *dev) { return 0; }
|
static int sh_pfc_resume_noirq(struct device *dev) { return 0; }
|
||||||
|
#define pm_psci_sleep_ptr(_ptr) PTR_IF(false, (_ptr))
|
||||||
#endif /* CONFIG_ARM_PSCI_FW */
|
#endif /* CONFIG_ARM_PSCI_FW */
|
||||||
|
|
||||||
static DEFINE_NOIRQ_DEV_PM_OPS(sh_pfc_pm, sh_pfc_suspend_noirq, sh_pfc_resume_noirq);
|
static DEFINE_NOIRQ_DEV_PM_OPS(sh_pfc_pm, sh_pfc_suspend_noirq, sh_pfc_resume_noirq);
|
||||||
|
@ -1415,7 +1417,7 @@ static struct platform_driver sh_pfc_driver = {
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = DRV_NAME,
|
.name = DRV_NAME,
|
||||||
.of_match_table = of_match_ptr(sh_pfc_of_table),
|
.of_match_table = of_match_ptr(sh_pfc_of_table),
|
||||||
.pm = pm_sleep_ptr(&sh_pfc_pm),
|
.pm = pm_psci_sleep_ptr(&sh_pfc_pm),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue