ASoC: cs42xx8: 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: patches@opensource.cirrus.com Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250317095603.20073-13-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
850910df7a
commit
7b7e2292e0
|
@ -61,7 +61,7 @@ MODULE_DEVICE_TABLE(i2c, cs42xx8_i2c_id);
|
|||
static struct i2c_driver cs42xx8_i2c_driver = {
|
||||
.driver = {
|
||||
.name = "cs42xx8",
|
||||
.pm = &cs42xx8_pm,
|
||||
.pm = pm_ptr(&cs42xx8_pm),
|
||||
.of_match_table = cs42xx8_of_match,
|
||||
},
|
||||
.probe = cs42xx8_i2c_probe,
|
||||
|
|
|
@ -606,7 +606,6 @@ err_enable:
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(cs42xx8_probe);
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static int cs42xx8_runtime_resume(struct device *dev)
|
||||
{
|
||||
struct cs42xx8_priv *cs42xx8 = dev_get_drvdata(dev);
|
||||
|
@ -665,14 +664,11 @@ static int cs42xx8_runtime_suspend(struct device *dev)
|
|||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
const struct dev_pm_ops cs42xx8_pm = {
|
||||
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
|
||||
pm_runtime_force_resume)
|
||||
SET_RUNTIME_PM_OPS(cs42xx8_runtime_suspend, cs42xx8_runtime_resume, NULL)
|
||||
EXPORT_GPL_DEV_PM_OPS(cs42xx8_pm) = {
|
||||
SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
|
||||
RUNTIME_PM_OPS(cs42xx8_runtime_suspend, cs42xx8_runtime_resume, NULL)
|
||||
};
|
||||
EXPORT_SYMBOL_GPL(cs42xx8_pm);
|
||||
|
||||
MODULE_DESCRIPTION("Cirrus Logic CS42448/CS42888 ALSA SoC Codec Driver");
|
||||
MODULE_AUTHOR("Freescale Semiconductor, Inc.");
|
||||
|
|
Loading…
Reference in New Issue