From 9e5341b92d1d2dde11691b394721b45b36416bef Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Tue, 21 Sep 2010 09:57:06 +0200 Subject: ALSA: hda - Introduce hda_call_check_power_status() helper Replace the explicit ifdef check and call of check_power_status ops with a new helper function, hda_call_check_power_status(). Signed-off-by: Takashi Iwai --- sound/pci/hda/hda_codec.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'sound/pci/hda/hda_codec.h') diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h index 62c70224010..ebf8eb02e3c 100644 --- a/sound/pci/hda/hda_codec.h +++ b/sound/pci/hda/hda_codec.h @@ -989,6 +989,18 @@ int snd_hda_suspend(struct hda_bus *bus); int snd_hda_resume(struct hda_bus *bus); #endif +#ifdef CONFIG_SND_HDA_POWER_SAVE +static inline +int hda_call_check_power_status(struct hda_codec *codec, hda_nid_t nid) +{ + if (codec->patch_ops.check_power_status) + return codec->patch_ops.check_power_status(codec, nid); + return 0; +} +#else +#define hda_call_check_power_status(codec, nid) 0 +#endif + /* * get widget information */ -- cgit v1.2.3