From: Mark Brown Date: Mon, 4 Jun 2012 07:16:20 +0000 (+0100) Subject: ASoC: dapm: Bodge for lack of a widely available clk API X-Git-Tag: next-20120724~59^2~118 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ec02995adad5a7b428f46c1a87fae1bc93d6dfe3;p=karo-tx-linux.git ASoC: dapm: Bodge for lack of a widely available clk API Reported-by: Stephen Rothwell Signed-off-by: Mark Brown Acked-by: Liam Girdwood --- diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index a66379accec9..39e8c2fdf50e 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -1011,12 +1011,14 @@ int dapm_clock_event(struct snd_soc_dapm_widget *w, if (!w->clk) return -EIO; +#ifdef CONFIG_HAVE_CLK if (SND_SOC_DAPM_EVENT_ON(event)) { return clk_enable(w->clk); } else { clk_disable(w->clk); return 0; } +#endif } EXPORT_SYMBOL_GPL(dapm_clock_event); @@ -2902,6 +2904,7 @@ snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm, } break; case snd_soc_dapm_clock_supply: +#ifdef CONFIG_HAVE_CLK w->clk = devm_clk_get(dapm->dev, w->name); if (IS_ERR(w->clk)) { ret = PTR_ERR(w->clk); @@ -2909,6 +2912,9 @@ snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm, w->name, ret); return NULL; } +#else + return NULL; +#endif break; default: break;