Skip to content

Commit bf2876f

Browse files
Fabio Estevamdlezcano
authored andcommitted
thermal/drivers/qoriq: Remove __maybe_unused notations
The combined usage of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to evaluate if the 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 d571452 commit bf2876f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/thermal/qoriq_thermal.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ static int qoriq_tmu_probe(struct platform_device *pdev)
347347
return 0;
348348
}
349349

350-
static int __maybe_unused qoriq_tmu_suspend(struct device *dev)
350+
static int qoriq_tmu_suspend(struct device *dev)
351351
{
352352
struct qoriq_tmu_data *data = dev_get_drvdata(dev);
353353
int ret;
@@ -361,7 +361,7 @@ static int __maybe_unused qoriq_tmu_suspend(struct device *dev)
361361
return 0;
362362
}
363363

364-
static int __maybe_unused qoriq_tmu_resume(struct device *dev)
364+
static int qoriq_tmu_resume(struct device *dev)
365365
{
366366
int ret;
367367
struct qoriq_tmu_data *data = dev_get_drvdata(dev);
@@ -374,8 +374,8 @@ static int __maybe_unused qoriq_tmu_resume(struct device *dev)
374374
return regmap_update_bits(data->regmap, REGS_TMR, TMR_ME, TMR_ME);
375375
}
376376

377-
static SIMPLE_DEV_PM_OPS(qoriq_tmu_pm_ops,
378-
qoriq_tmu_suspend, qoriq_tmu_resume);
377+
static DEFINE_SIMPLE_DEV_PM_OPS(qoriq_tmu_pm_ops,
378+
qoriq_tmu_suspend, qoriq_tmu_resume);
379379

380380
static const struct of_device_id qoriq_tmu_match[] = {
381381
{ .compatible = "fsl,qoriq-tmu", },
@@ -387,7 +387,7 @@ MODULE_DEVICE_TABLE(of, qoriq_tmu_match);
387387
static struct platform_driver qoriq_tmu = {
388388
.driver = {
389389
.name = "qoriq_thermal",
390-
.pm = &qoriq_tmu_pm_ops,
390+
.pm = pm_sleep_ptr(&qoriq_tmu_pm_ops),
391391
.of_match_table = qoriq_tmu_match,
392392
},
393393
.probe = qoriq_tmu_probe,

0 commit comments

Comments
 (0)