From: Takashi Iwai Date: Mon, 17 Mar 2025 09:54:35 +0000 (+0100) Subject: ASoC: cs43130: Convert to RUNTIME_PM_OPS() X-Git-Tag: v6.15-rc1~173^2~4^2~12^2~75 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9a1d4a56565161a8bbf5b2a9d92665010303aeac;p=thirdparty%2Fkernel%2Flinux.git ASoC: cs43130: 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. This optimizes slightly when CONFIG_PM is disabled, too. Cc: patches@opensource.cirrus.com Reviewed-by: Charles Keepax Signed-off-by: Takashi Iwai Link: https://patch.msgid.link/20250317095603.20073-14-tiwai@suse.de Signed-off-by: Mark Brown --- diff --git a/sound/soc/codecs/cs43130.c b/sound/soc/codecs/cs43130.c index cd535be0b4ba9..d9b3d73c8388f 100644 --- a/sound/soc/codecs/cs43130.c +++ b/sound/soc/codecs/cs43130.c @@ -2672,7 +2672,7 @@ static void cs43130_i2c_remove(struct i2c_client *client) regulator_bulk_disable(CS43130_NUM_SUPPLIES, cs43130->supplies); } -static int __maybe_unused cs43130_runtime_suspend(struct device *dev) +static int cs43130_runtime_suspend(struct device *dev) { struct cs43130_private *cs43130 = dev_get_drvdata(dev); @@ -2691,7 +2691,7 @@ static int __maybe_unused cs43130_runtime_suspend(struct device *dev) return 0; } -static int __maybe_unused cs43130_runtime_resume(struct device *dev) +static int cs43130_runtime_resume(struct device *dev) { struct cs43130_private *cs43130 = dev_get_drvdata(dev); int ret; @@ -2727,8 +2727,7 @@ err: } static const struct dev_pm_ops cs43130_runtime_pm = { - SET_RUNTIME_PM_OPS(cs43130_runtime_suspend, cs43130_runtime_resume, - NULL) + RUNTIME_PM_OPS(cs43130_runtime_suspend, cs43130_runtime_resume, NULL) }; #if IS_ENABLED(CONFIG_OF) @@ -2768,7 +2767,7 @@ static struct i2c_driver cs43130_i2c_driver = { .name = "cs43130", .of_match_table = of_match_ptr(cs43130_of_match), .acpi_match_table = ACPI_PTR(cs43130_acpi_match), - .pm = &cs43130_runtime_pm, + .pm = pm_ptr(&cs43130_runtime_pm), }, .id_table = cs43130_i2c_id, .probe = cs43130_i2c_probe,