Skip to content

Commit 811e62c

Browse files
Fabio Estevamlinusw
authored andcommitted
pinctrl: imx: Switch to LATE_SYSTEM_SLEEP_PM_OPS()
Replace SET_LATE_SYSTEM_SLEEP_PM_OPS() with its modern LATE_SYSTEM_SLEEP_PM_OPS() alternative. The combined usage of pm_sleep_ptr() and LATE_SYSTEM_SLEEP_PM_OPS() allows the compiler to evaluate if the runtime suspend/resume() functions are used at build time or are simply dead code. This allows removing the __maybe_unused notation from the runtime suspend/resume() functions. Signed-off-by: Fabio Estevam <[email protected]> Reviewed-by: Peng Fan <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent 8a74a53 commit 811e62c

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

drivers/pinctrl/freescale/pinctrl-imx.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -804,23 +804,22 @@ int imx_pinctrl_probe(struct platform_device *pdev,
804804
}
805805
EXPORT_SYMBOL_GPL(imx_pinctrl_probe);
806806

807-
static int __maybe_unused imx_pinctrl_suspend(struct device *dev)
807+
static int imx_pinctrl_suspend(struct device *dev)
808808
{
809809
struct imx_pinctrl *ipctl = dev_get_drvdata(dev);
810810

811811
return pinctrl_force_sleep(ipctl->pctl);
812812
}
813813

814-
static int __maybe_unused imx_pinctrl_resume(struct device *dev)
814+
static int imx_pinctrl_resume(struct device *dev)
815815
{
816816
struct imx_pinctrl *ipctl = dev_get_drvdata(dev);
817817

818818
return pinctrl_force_default(ipctl->pctl);
819819
}
820820

821821
const struct dev_pm_ops imx_pinctrl_pm_ops = {
822-
SET_LATE_SYSTEM_SLEEP_PM_OPS(imx_pinctrl_suspend,
823-
imx_pinctrl_resume)
822+
LATE_SYSTEM_SLEEP_PM_OPS(imx_pinctrl_suspend, imx_pinctrl_resume)
824823
};
825824
EXPORT_SYMBOL_GPL(imx_pinctrl_pm_ops);
826825

drivers/pinctrl/freescale/pinctrl-imx8mq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ static struct platform_driver imx8mq_pinctrl_driver = {
341341
.driver = {
342342
.name = "imx8mq-pinctrl",
343343
.of_match_table = imx8mq_pinctrl_of_match,
344-
.pm = &imx_pinctrl_pm_ops,
344+
.pm = pm_sleep_ptr(&imx_pinctrl_pm_ops),
345345
.suppress_bind_attrs = true,
346346
},
347347
.probe = imx8mq_pinctrl_probe,

0 commit comments

Comments
 (0)