ASoC: omap: Check regulator enable for DAC on Pandora
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Sat, 2 Mar 2013 07:47:55 +0000 (15:47 +0800)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 4 Mar 2013 05:56:23 +0000 (13:56 +0800)
This will probably never fail but it's better style.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
sound/soc/omap/omap3pandora.c

index 805512f2555a0b95571a4608f6d4e35a71312c5f..10ced9d2e0de635e516e7422229db4cc9f266246 100644 (file)
@@ -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 {