Skip to content

Commit 727eb02

Browse files
committed
pinctrl: renesas: Switch to use DEFINE_NOIRQ_DEV_PM_OPS() helper
Since pm.h provides a helper for system no-IRQ PM callbacks, switch the driver to use it instead of open coded variant. Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/20230717172821.62827-10-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
1 parent c9008b7 commit 727eb02

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

drivers/pinctrl/renesas/core.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ static const struct of_device_id sh_pfc_of_table[] = {
649649
};
650650
#endif
651651

652-
#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_ARM_PSCI_FW)
652+
#if defined(CONFIG_ARM_PSCI_FW)
653653
static void sh_pfc_nop_reg(struct sh_pfc *pfc, u32 reg, unsigned int idx)
654654
{
655655
}
@@ -732,15 +732,13 @@ static int sh_pfc_resume_noirq(struct device *dev)
732732
sh_pfc_walk_regs(pfc, sh_pfc_restore_reg);
733733
return 0;
734734
}
735-
736-
static const struct dev_pm_ops sh_pfc_pm = {
737-
SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(sh_pfc_suspend_noirq, sh_pfc_resume_noirq)
738-
};
739-
#define DEV_PM_OPS &sh_pfc_pm
740735
#else
741736
static int sh_pfc_suspend_init(struct sh_pfc *pfc) { return 0; }
742-
#define DEV_PM_OPS NULL
743-
#endif /* CONFIG_PM_SLEEP && CONFIG_ARM_PSCI_FW */
737+
static int sh_pfc_suspend_noirq(struct device *dev) { return 0; }
738+
static int sh_pfc_resume_noirq(struct device *dev) { return 0; }
739+
#endif /* CONFIG_ARM_PSCI_FW */
740+
741+
static DEFINE_NOIRQ_DEV_PM_OPS(sh_pfc_pm, sh_pfc_suspend_noirq, sh_pfc_resume_noirq);
744742

745743
#ifdef DEBUG
746744
#define SH_PFC_MAX_REGS 300
@@ -1418,7 +1416,7 @@ static struct platform_driver sh_pfc_driver = {
14181416
.driver = {
14191417
.name = DRV_NAME,
14201418
.of_match_table = of_match_ptr(sh_pfc_of_table),
1421-
.pm = DEV_PM_OPS,
1419+
.pm = pm_sleep_ptr(&sh_pfc_pm),
14221420
},
14231421
};
14241422

0 commit comments

Comments
 (0)