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

thermal/drivers/imx: Remove __maybe_unused notations

Replace SET_RUNTIME_PM_OPS()/SET SYSTEM_SLEEP_PM_OPS() with their modern
RUNTIME_PM_OPS() and SYSTEM_SLEEP_PM_OPS() alternatives.

The combined usage of pm_ptr() and RUNTIME_PM_OPS/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 __maybe_unused notations from the suspend/resume()
functions.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Link: https://lore.kernel.org/r/20240820012616.1449210-2-festevam@gmail.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>

authored by

Fabio Estevam and committed by
Daniel Lezcano
41df0390 bf2876f6

+8 -8
+8 -8
drivers/thermal/imx_thermal.c
··· 765 765 imx_thermal_unregister_legacy_cooling(data); 766 766 } 767 767 768 - static int __maybe_unused imx_thermal_suspend(struct device *dev) 768 + static int imx_thermal_suspend(struct device *dev) 769 769 { 770 770 struct imx_thermal_data *data = dev_get_drvdata(dev); 771 771 int ret; ··· 784 784 return pm_runtime_force_suspend(data->dev); 785 785 } 786 786 787 - static int __maybe_unused imx_thermal_resume(struct device *dev) 787 + static int imx_thermal_resume(struct device *dev) 788 788 { 789 789 struct imx_thermal_data *data = dev_get_drvdata(dev); 790 790 int ret; ··· 796 796 return thermal_zone_device_enable(data->tz); 797 797 } 798 798 799 - static int __maybe_unused imx_thermal_runtime_suspend(struct device *dev) 799 + static int imx_thermal_runtime_suspend(struct device *dev) 800 800 { 801 801 struct imx_thermal_data *data = dev_get_drvdata(dev); 802 802 const struct thermal_soc_data *socdata = data->socdata; ··· 818 818 return 0; 819 819 } 820 820 821 - static int __maybe_unused imx_thermal_runtime_resume(struct device *dev) 821 + static int imx_thermal_runtime_resume(struct device *dev) 822 822 { 823 823 struct imx_thermal_data *data = dev_get_drvdata(dev); 824 824 const struct thermal_soc_data *socdata = data->socdata; ··· 849 849 } 850 850 851 851 static const struct dev_pm_ops imx_thermal_pm_ops = { 852 - SET_SYSTEM_SLEEP_PM_OPS(imx_thermal_suspend, imx_thermal_resume) 853 - SET_RUNTIME_PM_OPS(imx_thermal_runtime_suspend, 854 - imx_thermal_runtime_resume, NULL) 852 + SYSTEM_SLEEP_PM_OPS(imx_thermal_suspend, imx_thermal_resume) 853 + RUNTIME_PM_OPS(imx_thermal_runtime_suspend, 854 + imx_thermal_runtime_resume, NULL) 855 855 }; 856 856 857 857 static struct platform_driver imx_thermal = { 858 858 .driver = { 859 859 .name = "imx_thermal", 860 - .pm = &imx_thermal_pm_ops, 860 + .pm = pm_ptr(&imx_thermal_pm_ops), 861 861 .of_match_table = of_imx_thermal_match, 862 862 }, 863 863 .probe = imx_thermal_probe,