Skip to content

Commit

Permalink
ALSA: hda/tegra: avoid build error without CONFIG_PM
Browse files Browse the repository at this point in the history
The #ifdef protection around the PM functions is wrong, leading to
a failed reference in some configurations:

sound/pci/hda/hda_tegra.c: In function 'hda_tegra_runtime_suspend':
sound/pci/hda/hda_tegra.c:273:2: error: implicit declaration of function 'hda_tegra_disable_clocks'; did you mean 'hda_tegra_enable_clocks'? [-Werror=implicit-function-declaration]

Better remove the #ifdefs entirely and rely on the compiler silently
dropping unused functions marked __maybe_unused.

Fixes: 707e075 ("ALSA: hda/tegra: implement runtime suspend/resume")
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Arnd Bergmann authored and Takashi Iwai committed Mar 13, 2019
1 parent a2c6433 commit 7472946
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions sound/pci/hda/hda_tegra.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ static int hda_tegra_enable_clocks(struct hda_tegra *data)
return rc;
}

#ifdef CONFIG_PM_SLEEP
static void hda_tegra_disable_clocks(struct hda_tegra *data)
{
clk_disable_unprepare(data->hda2hdmi_clk);
Expand All @@ -230,7 +229,7 @@ static void hda_tegra_disable_clocks(struct hda_tegra *data)
/*
* power management
*/
static int hda_tegra_suspend(struct device *dev)
static int __maybe_unused hda_tegra_suspend(struct device *dev)
{
struct snd_card *card = dev_get_drvdata(dev);
int rc;
Expand All @@ -243,7 +242,7 @@ static int hda_tegra_suspend(struct device *dev)
return 0;
}

static int hda_tegra_resume(struct device *dev)
static int __maybe_unused hda_tegra_resume(struct device *dev)
{
struct snd_card *card = dev_get_drvdata(dev);
int rc;
Expand All @@ -255,10 +254,8 @@ static int hda_tegra_resume(struct device *dev)

return 0;
}
#endif /* CONFIG_PM_SLEEP */

#ifdef CONFIG_PM
static int hda_tegra_runtime_suspend(struct device *dev)
static int __maybe_unused hda_tegra_runtime_suspend(struct device *dev)
{
struct snd_card *card = dev_get_drvdata(dev);
struct azx *chip = card->private_data;
Expand All @@ -275,7 +272,7 @@ static int hda_tegra_runtime_suspend(struct device *dev)
return 0;
}

static int hda_tegra_runtime_resume(struct device *dev)
static int __maybe_unused hda_tegra_runtime_resume(struct device *dev)
{
struct snd_card *card = dev_get_drvdata(dev);
struct azx *chip = card->private_data;
Expand All @@ -292,7 +289,6 @@ static int hda_tegra_runtime_resume(struct device *dev)

return 0;
}
#endif /* CONFIG_PM */

static const struct dev_pm_ops hda_tegra_pm = {
SET_SYSTEM_SLEEP_PM_OPS(hda_tegra_suspend, hda_tegra_resume)
Expand Down

0 comments on commit 7472946

Please sign in to comment.