From patchwork Sat Mar 2 07:49:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 2206231 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id CF77F3FCF2 for ; Sat, 2 Mar 2013 07:50:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751422Ab3CBHub (ORCPT ); Sat, 2 Mar 2013 02:50:31 -0500 Received: from opensource.wolfsonmicro.com ([80.75.67.52]:57960 "EHLO opensource.wolfsonmicro.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751185Ab3CBHub (ORCPT ); Sat, 2 Mar 2013 02:50:31 -0500 Received: from finisterre.wolfsonmicro.main (unknown [1.203.5.31]) by opensource.wolfsonmicro.com (Postfix) with ESMTPSA id D34357503C2; Sat, 2 Mar 2013 07:50:29 +0000 (GMT) Received: from broonie by finisterre.wolfsonmicro.main with local (Exim 4.80) (envelope-from ) id 1UBhCn-0004ax-FZ; Sat, 02 Mar 2013 15:50:05 +0800 From: Mark Brown To: Peter Ujfalusi , Jarkko Nikula Cc: linux-omap@vger.kernel.org, alsa-devel@alsa-project.org, Liam Girdwood , Mark Brown Subject: [PATCH] ASoC: omap: Check regulator enable for DAC on Pandora Date: Sat, 2 Mar 2013 15:49:54 +0800 Message-Id: <1362210594-17633-1-git-send-email-broonie@opensource.wolfsonmicro.com> X-Mailer: git-send-email 1.7.10.4 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org This will probably never fail but it's better style. Signed-off-by: Mark Brown Acked-by: Peter Ujfalusi Acked-by: Jarkko Nikula --- sound/soc/omap/omap3pandora.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sound/soc/omap/omap3pandora.c b/sound/soc/omap/omap3pandora.c index 805512f..953483e 100644 --- a/sound/soc/omap/omap3pandora.c +++ b/sound/soc/omap/omap3pandora.c @@ -85,7 +85,11 @@ static int omap3pandora_dac_event(struct snd_soc_dapm_widget *w, * 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 != 0) { + 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 {