From: Mark Brown Date: Sat, 2 Mar 2013 07:47:55 +0000 (+0800) Subject: ASoC: omap: Check regulator enable for DAC on Pandora X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=dd194b48465ba9c4eef7f16a4815b7761a8172ce;p=openwrt%2Fstaging%2Fblogic.git ASoC: omap: Check regulator enable for DAC on Pandora This will probably never fail but it's better style. Signed-off-by: Mark Brown Acked-by: Peter Ujfalusi Acked-by: Jarkko Nikula --- diff --git a/sound/soc/omap/omap3pandora.c b/sound/soc/omap/omap3pandora.c index 805512f2555a..10ced9d2e0de 100644 --- a/sound/soc/omap/omap3pandora.c +++ b/sound/soc/omap/omap3pandora.c @@ -80,12 +80,18 @@ static int omap3pandora_hw_params(struct snd_pcm_substream *substream, static int omap3pandora_dac_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *k, int event) { + int ret; + /* * The PCM1773 DAC datasheet requires 1ms delay between switching * VCC power on/off and /PD pin high/low */ if (SND_SOC_DAPM_EVENT_ON(event)) { - regulator_enable(omap3pandora_dac_reg); + ret = regulator_enable(omap3pandora_dac_reg); + if (ret) { + dev_err(w->dapm.dev, "Failed to power DAC: %d\n", ret); + return ret; + } mdelay(1); gpio_set_value(OMAP3_PANDORA_DAC_POWER_GPIO, 1); } else {