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

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: fsl_mqs: Switch to RUNTIME/SYSTEM_SLEEP_PM_OPS()

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 the CONFIG_PM ifdefery from the runtime
suspend/resume() functions.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Link: https://patch.msgid.link/20240808184944.267686-2-festevam@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Fabio Estevam and committed by
Mark Brown
b7e4dd8d 73abd969

+3 -8
+3 -8
sound/soc/fsl/fsl_mqs.c
··· 265 265 pm_runtime_disable(&pdev->dev); 266 266 } 267 267 268 - #ifdef CONFIG_PM 269 268 static int fsl_mqs_runtime_resume(struct device *dev) 270 269 { 271 270 struct fsl_mqs *mqs_priv = dev_get_drvdata(dev); ··· 298 299 299 300 return 0; 300 301 } 301 - #endif 302 302 303 303 static const struct dev_pm_ops fsl_mqs_pm_ops = { 304 - SET_RUNTIME_PM_OPS(fsl_mqs_runtime_suspend, 305 - fsl_mqs_runtime_resume, 306 - NULL) 307 - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, 308 - pm_runtime_force_resume) 304 + RUNTIME_PM_OPS(fsl_mqs_runtime_suspend, fsl_mqs_runtime_resume, NULL) 305 + SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) 309 306 }; 310 307 311 308 static const struct fsl_mqs_soc_data fsl_mqs_imx8qm_data = { ··· 385 390 .driver = { 386 391 .name = "fsl-mqs", 387 392 .of_match_table = fsl_mqs_dt_ids, 388 - .pm = &fsl_mqs_pm_ops, 393 + .pm = pm_ptr(&fsl_mqs_pm_ops), 389 394 }, 390 395 }; 391 396