Skip to content

Commit d846b17

Browse files
committed
ALSA: hda - Fix build without CONFIG_PM
I forgot this again... codec->in_pm is in #ifdef CONFIG_PM Reported-by: Markus Trippelsdorf <markus@trippelsdorf.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 947d299 commit d846b17

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sound/pci/hda/hda_codec.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ int snd_hda_delete_codec_preset(struct hda_codec_preset_list *preset)
9595
EXPORT_SYMBOL_HDA(snd_hda_delete_codec_preset);
9696

9797
#ifdef CONFIG_PM
98+
#define codec_in_pm(codec) ((codec)->in_pm)
9899
static void hda_power_work(struct work_struct *work);
99100
static void hda_keep_power_on(struct hda_codec *codec);
100101
#define hda_codec_is_power_on(codec) ((codec)->power_on)
@@ -104,6 +105,7 @@ static inline void hda_call_pm_notify(struct hda_bus *bus, bool power_up)
104105
bus->ops.pm_notify(bus, power_up);
105106
}
106107
#else
108+
#define codec_in_pm(codec) 0
107109
static inline void hda_keep_power_on(struct hda_codec *codec) {}
108110
#define hda_codec_is_power_on(codec) 1
109111
#define hda_call_pm_notify(bus, state) {}
@@ -228,7 +230,7 @@ static int codec_exec_verb(struct hda_codec *codec, unsigned int cmd,
228230
}
229231
mutex_unlock(&bus->cmd_mutex);
230232
snd_hda_power_down(codec);
231-
if (!codec->in_pm && res && *res == -1 && bus->rirb_error) {
233+
if (!codec_in_pm(codec) && res && *res == -1 && bus->rirb_error) {
232234
if (bus->response_reset) {
233235
snd_printd("hda_codec: resetting BUS due to "
234236
"fatal communication error\n");
@@ -238,7 +240,7 @@ static int codec_exec_verb(struct hda_codec *codec, unsigned int cmd,
238240
goto again;
239241
}
240242
/* clear reset-flag when the communication gets recovered */
241-
if (!err || codec->in_pm)
243+
if (!err || codec_in_pm(codec))
242244
bus->response_reset = 0;
243245
return err;
244246
}

0 commit comments

Comments
 (0)