Skip to content

Commit f923335

Browse files
committed
ALSA: hda/tegra: Convert to RUNTIME_PM_OPS() & co
Use the newer RUNTIME_PM_OPS() and SYSTEM_SLEEP_PM_OPS() macros instead of SET_SET_RUNTIME_PM_OPS() and SET_SYSTEM_SLEEP_PM_OPS() together with pm_ptr(), which allows us dropping ugly __maybe_unused attributes. This optimizes slightly when CONFIG_PM is disabled, too. Signed-off-by: Takashi Iwai <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent dd69342 commit f923335

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

sound/pci/hda/hda_tegra.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ static void hda_tegra_init(struct hda_tegra *hda)
125125
/*
126126
* power management
127127
*/
128-
static int __maybe_unused hda_tegra_suspend(struct device *dev)
128+
static int hda_tegra_suspend(struct device *dev)
129129
{
130130
struct snd_card *card = dev_get_drvdata(dev);
131131
int rc;
@@ -138,7 +138,7 @@ static int __maybe_unused hda_tegra_suspend(struct device *dev)
138138
return 0;
139139
}
140140

141-
static int __maybe_unused hda_tegra_resume(struct device *dev)
141+
static int hda_tegra_resume(struct device *dev)
142142
{
143143
struct snd_card *card = dev_get_drvdata(dev);
144144
int rc;
@@ -151,7 +151,7 @@ static int __maybe_unused hda_tegra_resume(struct device *dev)
151151
return 0;
152152
}
153153

154-
static int __maybe_unused hda_tegra_runtime_suspend(struct device *dev)
154+
static int hda_tegra_runtime_suspend(struct device *dev)
155155
{
156156
struct snd_card *card = dev_get_drvdata(dev);
157157
struct azx *chip = card->private_data;
@@ -170,7 +170,7 @@ static int __maybe_unused hda_tegra_runtime_suspend(struct device *dev)
170170
return 0;
171171
}
172172

173-
static int __maybe_unused hda_tegra_runtime_resume(struct device *dev)
173+
static int hda_tegra_runtime_resume(struct device *dev)
174174
{
175175
struct snd_card *card = dev_get_drvdata(dev);
176176
struct azx *chip = card->private_data;
@@ -204,10 +204,8 @@ static int __maybe_unused hda_tegra_runtime_resume(struct device *dev)
204204
}
205205

206206
static const struct dev_pm_ops hda_tegra_pm = {
207-
SET_SYSTEM_SLEEP_PM_OPS(hda_tegra_suspend, hda_tegra_resume)
208-
SET_RUNTIME_PM_OPS(hda_tegra_runtime_suspend,
209-
hda_tegra_runtime_resume,
210-
NULL)
207+
SYSTEM_SLEEP_PM_OPS(hda_tegra_suspend, hda_tegra_resume)
208+
RUNTIME_PM_OPS(hda_tegra_runtime_suspend, hda_tegra_runtime_resume, NULL)
211209
};
212210

213211
static int hda_tegra_dev_disconnect(struct snd_device *device)
@@ -602,7 +600,7 @@ static void hda_tegra_shutdown(struct platform_device *pdev)
602600
static struct platform_driver tegra_platform_hda = {
603601
.driver = {
604602
.name = "tegra-hda",
605-
.pm = &hda_tegra_pm,
603+
.pm = pm_ptr(&hda_tegra_pm),
606604
.of_match_table = hda_tegra_match,
607605
},
608606
.probe = hda_tegra_probe,

0 commit comments

Comments
 (0)