Skip to content

Commit 27dfc8a

Browse files
committed
ASoC: cs35l45: Use modern pm_ops
Make use of the recently introduced EXPORT_GPL_DEV_PM_OPS() macro, to conditionally export the runtime/system PM functions. Replace the old SET_{RUNTIME,SYSTEM_SLEEP,NOIRQ_SYSTEM_SLEEP}_PM_OPS() helpers with their modern alternatives and get rid of the now unnecessary '__maybe_unused' annotations on all PM functions. Additionally, use the pm_ptr() macro to fix the following errors when building with CONFIG_PM disabled: Change-Id: I8208fa86e7bc612263074e00e5abafe104a4fade Signed-off-by: Ricardo Rivera-Matos <[email protected]> Acked-by: Charles Keepax <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 3917500 commit 27dfc8a

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

sound/soc/codecs/cs35l45-i2c.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ static struct i2c_driver cs35l45_i2c_driver = {
6262
.driver = {
6363
.name = "cs35l45",
6464
.of_match_table = cs35l45_of_match,
65-
.pm = &cs35l45_pm_ops,
65+
.pm = pm_ptr(&cs35l45_pm_ops),
6666
},
6767
.id_table = cs35l45_id_i2c,
6868
.probe_new = cs35l45_i2c_probe,

sound/soc/codecs/cs35l45-spi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static struct spi_driver cs35l45_spi_driver = {
6464
.driver = {
6565
.name = "cs35l45",
6666
.of_match_table = cs35l45_of_match,
67-
.pm = &cs35l45_pm_ops,
67+
.pm = pm_ptr(&cs35l45_pm_ops),
6868
},
6969
.id_table = cs35l45_id_spi,
7070
.probe = cs35l45_spi_probe,

sound/soc/codecs/cs35l45.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,7 @@ static int cs35l45_exit_hibernate(struct cs35l45_private *cs35l45)
982982
return -ETIMEDOUT;
983983
}
984984

985-
static int __maybe_unused cs35l45_runtime_suspend(struct device *dev)
985+
static int cs35l45_runtime_suspend(struct device *dev)
986986
{
987987
struct cs35l45_private *cs35l45 = dev_get_drvdata(dev);
988988

@@ -999,7 +999,7 @@ static int __maybe_unused cs35l45_runtime_suspend(struct device *dev)
999999
return 0;
10001000
}
10011001

1002-
static int __maybe_unused cs35l45_runtime_resume(struct device *dev)
1002+
static int cs35l45_runtime_resume(struct device *dev)
10031003
{
10041004
struct cs35l45_private *cs35l45 = dev_get_drvdata(dev);
10051005
int ret;
@@ -1466,10 +1466,9 @@ void cs35l45_remove(struct cs35l45_private *cs35l45)
14661466
}
14671467
EXPORT_SYMBOL_NS_GPL(cs35l45_remove, SND_SOC_CS35L45);
14681468

1469-
const struct dev_pm_ops cs35l45_pm_ops = {
1470-
SET_RUNTIME_PM_OPS(cs35l45_runtime_suspend, cs35l45_runtime_resume, NULL)
1469+
EXPORT_GPL_DEV_PM_OPS(cs35l45_pm_ops) = {
1470+
RUNTIME_PM_OPS(cs35l45_runtime_suspend, cs35l45_runtime_resume, NULL)
14711471
};
1472-
EXPORT_SYMBOL_NS_GPL(cs35l45_pm_ops, SND_SOC_CS35L45);
14731472

14741473
MODULE_DESCRIPTION("ASoC CS35L45 driver");
14751474
MODULE_AUTHOR("James Schulman, Cirrus Logic Inc, <[email protected]>");

0 commit comments

Comments
 (0)