Skip to content

Commit 15559cd

Browse files
tiwaibroonie
authored andcommitted
ASoC: pcm3168a: Convert to EXPORT_GPL_DEV_PM_OPS()
Use the newer EXPORT_GPL_DEV_PM_OPS() macro together with pm_ptr(), which allows us to drop superfluous CONFIG_PM ifdefs. This optimizes slightly when CONFIG_PM is disabled, too. Cc: Shenghao Ding <[email protected]> Cc: Kevin Lu <[email protected]> Cc: Baojun Xu <[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 5f86b16 commit 15559cd

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

sound/soc/codecs/pcm3168a-i2c.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ static struct i2c_driver pcm3168a_i2c_driver = {
5959
.name = "pcm3168a",
6060
.acpi_match_table = pcm3168a_acpi_match,
6161
.of_match_table = pcm3168a_of_match,
62-
.pm = &pcm3168a_pm_ops,
62+
.pm = pm_ptr(&pcm3168a_pm_ops),
6363
},
6464
};
6565
module_i2c_driver(pcm3168a_i2c_driver);

sound/soc/codecs/pcm3168a-spi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ static struct spi_driver pcm3168a_spi_driver = {
5050
.driver = {
5151
.name = "pcm3168a",
5252
.of_match_table = pcm3168a_of_match,
53-
.pm = &pcm3168a_pm_ops,
53+
.pm = pm_ptr(&pcm3168a_pm_ops),
5454
},
5555
};
5656
module_spi_driver(pcm3168a_spi_driver);

sound/soc/codecs/pcm3168a.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,6 @@ void pcm3168a_remove(struct device *dev)
849849
}
850850
EXPORT_SYMBOL_GPL(pcm3168a_remove);
851851

852-
#ifdef CONFIG_PM
853852
static int pcm3168a_rt_resume(struct device *dev)
854853
{
855854
struct pcm3168a_priv *pcm3168a = dev_get_drvdata(dev);
@@ -905,12 +904,10 @@ static int pcm3168a_rt_suspend(struct device *dev)
905904

906905
return 0;
907906
}
908-
#endif
909907

910-
const struct dev_pm_ops pcm3168a_pm_ops = {
911-
SET_RUNTIME_PM_OPS(pcm3168a_rt_suspend, pcm3168a_rt_resume, NULL)
908+
EXPORT_GPL_DEV_PM_OPS(pcm3168a_pm_ops) = {
909+
RUNTIME_PM_OPS(pcm3168a_rt_suspend, pcm3168a_rt_resume, NULL)
912910
};
913-
EXPORT_SYMBOL_GPL(pcm3168a_pm_ops);
914911

915912
MODULE_DESCRIPTION("PCM3168A codec driver");
916913
MODULE_AUTHOR("Damien Horsley <[email protected]>");

0 commit comments

Comments
 (0)