Skip to content

Commit 7369a2d

Browse files
tiwaibroonie
authored andcommitted
ASoC: stm: Convert to SYSTEM_SLEEP_PM_OPS()
Use the newer SYSTEM_SLEEP_PM_OPS() macro instead SET_SYSTEM_SLEEP_PM_OPS() together with pm_ptr(), which allows us dropping superfluous CONFIG_PM_SLEEP ifdefs. This optimizes slightly when CONFIG_PM is disabled, too. Cc: Olivier Moysan <[email protected]> Cc: Arnaud Pouliquen <[email protected]> Signed-off-by: Takashi Iwai <[email protected]> Reviewed-by: Charles Keepax <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent f8d952c commit 7369a2d

File tree

4 files changed

+8
-16
lines changed

4 files changed

+8
-16
lines changed

sound/soc/stm/stm32_i2s.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,7 +1352,6 @@ static int stm32_i2s_probe(struct platform_device *pdev)
13521352

13531353
MODULE_DEVICE_TABLE(of, stm32_i2s_ids);
13541354

1355-
#ifdef CONFIG_PM_SLEEP
13561355
static int stm32_i2s_suspend(struct device *dev)
13571356
{
13581357
struct stm32_i2s_data *i2s = dev_get_drvdata(dev);
@@ -1370,17 +1369,16 @@ static int stm32_i2s_resume(struct device *dev)
13701369
regcache_cache_only(i2s->regmap, false);
13711370
return regcache_sync(i2s->regmap);
13721371
}
1373-
#endif /* CONFIG_PM_SLEEP */
13741372

13751373
static const struct dev_pm_ops stm32_i2s_pm_ops = {
1376-
SET_SYSTEM_SLEEP_PM_OPS(stm32_i2s_suspend, stm32_i2s_resume)
1374+
SYSTEM_SLEEP_PM_OPS(stm32_i2s_suspend, stm32_i2s_resume)
13771375
};
13781376

13791377
static struct platform_driver stm32_i2s_driver = {
13801378
.driver = {
13811379
.name = "st,stm32-i2s",
13821380
.of_match_table = stm32_i2s_ids,
1383-
.pm = &stm32_i2s_pm_ops,
1381+
.pm = pm_ptr(&stm32_i2s_pm_ops),
13841382
},
13851383
.probe = stm32_i2s_probe,
13861384
.remove = stm32_i2s_remove,

sound/soc/stm/stm32_sai.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,6 @@ static int stm32_sai_probe(struct platform_device *pdev)
270270
return devm_of_platform_populate(&pdev->dev);
271271
}
272272

273-
#ifdef CONFIG_PM_SLEEP
274273
/*
275274
* When pins are shared by two sai sub instances, pins have to be defined
276275
* in sai parent node. In this case, pins state is not managed by alsa fw.
@@ -305,10 +304,9 @@ static int stm32_sai_resume(struct device *dev)
305304

306305
return pinctrl_pm_select_default_state(dev);
307306
}
308-
#endif /* CONFIG_PM_SLEEP */
309307

310308
static const struct dev_pm_ops stm32_sai_pm_ops = {
311-
SET_SYSTEM_SLEEP_PM_OPS(stm32_sai_suspend, stm32_sai_resume)
309+
SYSTEM_SLEEP_PM_OPS(stm32_sai_suspend, stm32_sai_resume)
312310
};
313311

314312
MODULE_DEVICE_TABLE(of, stm32_sai_ids);
@@ -317,7 +315,7 @@ static struct platform_driver stm32_sai_driver = {
317315
.driver = {
318316
.name = "st,stm32-sai",
319317
.of_match_table = stm32_sai_ids,
320-
.pm = &stm32_sai_pm_ops,
318+
.pm = pm_ptr(&stm32_sai_pm_ops),
321319
},
322320
.probe = stm32_sai_probe,
323321
};

sound/soc/stm/stm32_sai_sub.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1704,7 +1704,6 @@ static void stm32_sai_sub_remove(struct platform_device *pdev)
17041704
pm_runtime_disable(&pdev->dev);
17051705
}
17061706

1707-
#ifdef CONFIG_PM_SLEEP
17081707
static int stm32_sai_sub_suspend(struct device *dev)
17091708
{
17101709
struct stm32_sai_sub_data *sai = dev_get_drvdata(dev);
@@ -1738,17 +1737,16 @@ static int stm32_sai_sub_resume(struct device *dev)
17381737

17391738
return ret;
17401739
}
1741-
#endif /* CONFIG_PM_SLEEP */
17421740

17431741
static const struct dev_pm_ops stm32_sai_sub_pm_ops = {
1744-
SET_SYSTEM_SLEEP_PM_OPS(stm32_sai_sub_suspend, stm32_sai_sub_resume)
1742+
SYSTEM_SLEEP_PM_OPS(stm32_sai_sub_suspend, stm32_sai_sub_resume)
17451743
};
17461744

17471745
static struct platform_driver stm32_sai_sub_driver = {
17481746
.driver = {
17491747
.name = "st,stm32-sai-sub",
17501748
.of_match_table = stm32_sai_sub_ids,
1751-
.pm = &stm32_sai_sub_pm_ops,
1749+
.pm = pm_ptr(&stm32_sai_sub_pm_ops),
17521750
},
17531751
.probe = stm32_sai_sub_probe,
17541752
.remove = stm32_sai_sub_remove,

sound/soc/stm/stm32_spdifrx.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,7 +1040,6 @@ static int stm32_spdifrx_probe(struct platform_device *pdev)
10401040

10411041
MODULE_DEVICE_TABLE(of, stm32_spdifrx_ids);
10421042

1043-
#ifdef CONFIG_PM_SLEEP
10441043
static int stm32_spdifrx_suspend(struct device *dev)
10451044
{
10461045
struct stm32_spdifrx_data *spdifrx = dev_get_drvdata(dev);
@@ -1059,17 +1058,16 @@ static int stm32_spdifrx_resume(struct device *dev)
10591058

10601059
return regcache_sync(spdifrx->regmap);
10611060
}
1062-
#endif /* CONFIG_PM_SLEEP */
10631061

10641062
static const struct dev_pm_ops stm32_spdifrx_pm_ops = {
1065-
SET_SYSTEM_SLEEP_PM_OPS(stm32_spdifrx_suspend, stm32_spdifrx_resume)
1063+
SYSTEM_SLEEP_PM_OPS(stm32_spdifrx_suspend, stm32_spdifrx_resume)
10661064
};
10671065

10681066
static struct platform_driver stm32_spdifrx_driver = {
10691067
.driver = {
10701068
.name = "st,stm32-spdifrx",
10711069
.of_match_table = stm32_spdifrx_ids,
1072-
.pm = &stm32_spdifrx_pm_ops,
1070+
.pm = pm_ptr(&stm32_spdifrx_pm_ops),
10731071
},
10741072
.probe = stm32_spdifrx_probe,
10751073
.remove = stm32_spdifrx_remove,

0 commit comments

Comments
 (0)