ASoC: wm2200: Convert to RUNTIME_PM_OPS()
Use the newer RUNTIME_PM_OPS() macro instead of SET_RUNTIME_PM_OPS() together with pm_ptr(), which allows us dropping ugly __maybe_unused attributes and 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-51-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
6714a569c8
commit
208a479d03
|
@ -2429,7 +2429,6 @@ static void wm2200_i2c_remove(struct i2c_client *i2c)
|
||||||
wm2200->core_supplies);
|
wm2200->core_supplies);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
|
||||||
static int wm2200_runtime_suspend(struct device *dev)
|
static int wm2200_runtime_suspend(struct device *dev)
|
||||||
{
|
{
|
||||||
struct wm2200_priv *wm2200 = dev_get_drvdata(dev);
|
struct wm2200_priv *wm2200 = dev_get_drvdata(dev);
|
||||||
|
@ -2466,11 +2465,9 @@ static int wm2200_runtime_resume(struct device *dev)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static const struct dev_pm_ops wm2200_pm = {
|
static const struct dev_pm_ops wm2200_pm = {
|
||||||
SET_RUNTIME_PM_OPS(wm2200_runtime_suspend, wm2200_runtime_resume,
|
RUNTIME_PM_OPS(wm2200_runtime_suspend, wm2200_runtime_resume, NULL)
|
||||||
NULL)
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct i2c_device_id wm2200_i2c_id[] = {
|
static const struct i2c_device_id wm2200_i2c_id[] = {
|
||||||
|
@ -2482,7 +2479,7 @@ MODULE_DEVICE_TABLE(i2c, wm2200_i2c_id);
|
||||||
static struct i2c_driver wm2200_i2c_driver = {
|
static struct i2c_driver wm2200_i2c_driver = {
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "wm2200",
|
.name = "wm2200",
|
||||||
.pm = &wm2200_pm,
|
.pm = pm_ptr(&wm2200_pm),
|
||||||
},
|
},
|
||||||
.probe = wm2200_i2c_probe,
|
.probe = wm2200_i2c_probe,
|
||||||
.remove = wm2200_i2c_remove,
|
.remove = wm2200_i2c_remove,
|
||||||
|
|
Loading…
Reference in New Issue