Commit 41df0390 authored by Fabio Estevam's avatar Fabio Estevam Committed by Daniel Lezcano

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: default avatarFabio Estevam <festevam@denx.de>
Link: https://lore.kernel.org/r/20240820012616.1449210-2-festevam@gmail.comSigned-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
parent bf2876f6
...@@ -765,7 +765,7 @@ static void imx_thermal_remove(struct platform_device *pdev) ...@@ -765,7 +765,7 @@ static void imx_thermal_remove(struct platform_device *pdev)
imx_thermal_unregister_legacy_cooling(data); imx_thermal_unregister_legacy_cooling(data);
} }
static int __maybe_unused imx_thermal_suspend(struct device *dev) static int imx_thermal_suspend(struct device *dev)
{ {
struct imx_thermal_data *data = dev_get_drvdata(dev); struct imx_thermal_data *data = dev_get_drvdata(dev);
int ret; int ret;
...@@ -784,7 +784,7 @@ static int __maybe_unused imx_thermal_suspend(struct device *dev) ...@@ -784,7 +784,7 @@ static int __maybe_unused imx_thermal_suspend(struct device *dev)
return pm_runtime_force_suspend(data->dev); return pm_runtime_force_suspend(data->dev);
} }
static int __maybe_unused imx_thermal_resume(struct device *dev) static int imx_thermal_resume(struct device *dev)
{ {
struct imx_thermal_data *data = dev_get_drvdata(dev); struct imx_thermal_data *data = dev_get_drvdata(dev);
int ret; int ret;
...@@ -796,7 +796,7 @@ static int __maybe_unused imx_thermal_resume(struct device *dev) ...@@ -796,7 +796,7 @@ static int __maybe_unused imx_thermal_resume(struct device *dev)
return thermal_zone_device_enable(data->tz); return thermal_zone_device_enable(data->tz);
} }
static int __maybe_unused imx_thermal_runtime_suspend(struct device *dev) static int imx_thermal_runtime_suspend(struct device *dev)
{ {
struct imx_thermal_data *data = dev_get_drvdata(dev); struct imx_thermal_data *data = dev_get_drvdata(dev);
const struct thermal_soc_data *socdata = data->socdata; const struct thermal_soc_data *socdata = data->socdata;
...@@ -818,7 +818,7 @@ static int __maybe_unused imx_thermal_runtime_suspend(struct device *dev) ...@@ -818,7 +818,7 @@ static int __maybe_unused imx_thermal_runtime_suspend(struct device *dev)
return 0; return 0;
} }
static int __maybe_unused imx_thermal_runtime_resume(struct device *dev) static int imx_thermal_runtime_resume(struct device *dev)
{ {
struct imx_thermal_data *data = dev_get_drvdata(dev); struct imx_thermal_data *data = dev_get_drvdata(dev);
const struct thermal_soc_data *socdata = data->socdata; const struct thermal_soc_data *socdata = data->socdata;
...@@ -849,15 +849,15 @@ static int __maybe_unused imx_thermal_runtime_resume(struct device *dev) ...@@ -849,15 +849,15 @@ static int __maybe_unused imx_thermal_runtime_resume(struct device *dev)
} }
static const struct dev_pm_ops imx_thermal_pm_ops = { static const struct dev_pm_ops imx_thermal_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(imx_thermal_suspend, imx_thermal_resume) SYSTEM_SLEEP_PM_OPS(imx_thermal_suspend, imx_thermal_resume)
SET_RUNTIME_PM_OPS(imx_thermal_runtime_suspend, RUNTIME_PM_OPS(imx_thermal_runtime_suspend,
imx_thermal_runtime_resume, NULL) imx_thermal_runtime_resume, NULL)
}; };
static struct platform_driver imx_thermal = { static struct platform_driver imx_thermal = {
.driver = { .driver = {
.name = "imx_thermal", .name = "imx_thermal",
.pm = &imx_thermal_pm_ops, .pm = pm_ptr(&imx_thermal_pm_ops),
.of_match_table = of_imx_thermal_match, .of_match_table = of_imx_thermal_match,
}, },
.probe = imx_thermal_probe, .probe = imx_thermal_probe,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment