Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: imx6ul_tsc - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()

SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection
against unused function warnings. The new combination of pm_sleep_ptr()
and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions,
thus suppressing the warning, but still allowing the unused code to be
removed. Thus also drop the __maybe_unused markings.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Haibo Chen <haibo.chen@nxp.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230102181842.718010-51-jic23@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Jonathan Cameron and committed by
Dmitry Torokhov
a068aa57 a9b11330

+5 -5
+5 -5
drivers/input/touchscreen/imx6ul_tsc.c
··· 512 512 return 0; 513 513 } 514 514 515 - static int __maybe_unused imx6ul_tsc_suspend(struct device *dev) 515 + static int imx6ul_tsc_suspend(struct device *dev) 516 516 { 517 517 struct platform_device *pdev = to_platform_device(dev); 518 518 struct imx6ul_tsc *tsc = platform_get_drvdata(pdev); ··· 528 528 return 0; 529 529 } 530 530 531 - static int __maybe_unused imx6ul_tsc_resume(struct device *dev) 531 + static int imx6ul_tsc_resume(struct device *dev) 532 532 { 533 533 struct platform_device *pdev = to_platform_device(dev); 534 534 struct imx6ul_tsc *tsc = platform_get_drvdata(pdev); ··· 545 545 return retval; 546 546 } 547 547 548 - static SIMPLE_DEV_PM_OPS(imx6ul_tsc_pm_ops, 549 - imx6ul_tsc_suspend, imx6ul_tsc_resume); 548 + static DEFINE_SIMPLE_DEV_PM_OPS(imx6ul_tsc_pm_ops, 549 + imx6ul_tsc_suspend, imx6ul_tsc_resume); 550 550 551 551 static const struct of_device_id imx6ul_tsc_match[] = { 552 552 { .compatible = "fsl,imx6ul-tsc", }, ··· 558 558 .driver = { 559 559 .name = "imx6ul-tsc", 560 560 .of_match_table = imx6ul_tsc_match, 561 - .pm = &imx6ul_tsc_pm_ops, 561 + .pm = pm_sleep_ptr(&imx6ul_tsc_pm_ops), 562 562 }, 563 563 .probe = imx6ul_tsc_probe, 564 564 };