Skip to content

Commit 41df039

Browse files
Fabio Estevamdlezcano
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Daniel Lezcano <[email protected]>
1 parent bf2876f commit 41df039

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

drivers/thermal/imx_thermal.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ static void imx_thermal_remove(struct platform_device *pdev)
765765
imx_thermal_unregister_legacy_cooling(data);
766766
}
767767

768-
static int __maybe_unused imx_thermal_suspend(struct device *dev)
768+
static int imx_thermal_suspend(struct device *dev)
769769
{
770770
struct imx_thermal_data *data = dev_get_drvdata(dev);
771771
int ret;
@@ -784,7 +784,7 @@ static int __maybe_unused imx_thermal_suspend(struct device *dev)
784784
return pm_runtime_force_suspend(data->dev);
785785
}
786786

787-
static int __maybe_unused imx_thermal_resume(struct device *dev)
787+
static int imx_thermal_resume(struct device *dev)
788788
{
789789
struct imx_thermal_data *data = dev_get_drvdata(dev);
790790
int ret;
@@ -796,7 +796,7 @@ static int __maybe_unused imx_thermal_resume(struct device *dev)
796796
return thermal_zone_device_enable(data->tz);
797797
}
798798

799-
static int __maybe_unused imx_thermal_runtime_suspend(struct device *dev)
799+
static int imx_thermal_runtime_suspend(struct device *dev)
800800
{
801801
struct imx_thermal_data *data = dev_get_drvdata(dev);
802802
const struct thermal_soc_data *socdata = data->socdata;
@@ -818,7 +818,7 @@ static int __maybe_unused imx_thermal_runtime_suspend(struct device *dev)
818818
return 0;
819819
}
820820

821-
static int __maybe_unused imx_thermal_runtime_resume(struct device *dev)
821+
static int imx_thermal_runtime_resume(struct device *dev)
822822
{
823823
struct imx_thermal_data *data = dev_get_drvdata(dev);
824824
const struct thermal_soc_data *socdata = data->socdata;
@@ -849,15 +849,15 @@ static int __maybe_unused imx_thermal_runtime_resume(struct device *dev)
849849
}
850850

851851
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)
855855
};
856856

857857
static struct platform_driver imx_thermal = {
858858
.driver = {
859859
.name = "imx_thermal",
860-
.pm = &imx_thermal_pm_ops,
860+
.pm = pm_ptr(&imx_thermal_pm_ops),
861861
.of_match_table = of_imx_thermal_match,
862862
},
863863
.probe = imx_thermal_probe,

0 commit comments

Comments
 (0)