From patchwork Thu Feb 26 22:54:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Nelson X-Patchwork-Id: 5896571 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 592BC9F373 for ; Thu, 26 Feb 2015 22:57:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8FF47203AB for ; Thu, 26 Feb 2015 22:57:00 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 6756C2034B for ; Thu, 26 Feb 2015 22:56:58 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 64ED326516A; Thu, 26 Feb 2015 23:56:57 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 13CEE264FEE; Thu, 26 Feb 2015 23:55:01 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id E55A4264F8D; Thu, 26 Feb 2015 23:54:59 +0100 (CET) Received: from mail-pa0-f42.google.com (mail-pa0-f42.google.com [209.85.220.42]) by alsa0.perex.cz (Postfix) with ESMTP id 5D0652606A6 for ; Thu, 26 Feb 2015 23:54:49 +0100 (CET) Received: by pabrd3 with SMTP id rd3so17563353pab.4 for ; Thu, 26 Feb 2015 14:54:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ZuQqY6OBOGRl/dQxepgTiEGGiUOySycMxU9T/A9YCfg=; b=OBDn+hcdrXxJHsVv9C8NVcvuLRH2/60UjcdJ9f0PnnT6fjTWUj5i+95SIjT7NQSPMK WW3F17cAjrZUXrcKMg+lLhUUWTsvtINkxA82kXpbwWVGfin7jGefTsgNO1p0wtslewNJ jTkUX8seIxq8+LYHF+vGjg+yVhCB9kU7KzaqI+ARvMbMo+GnpqknP4tI6KgIjrVVdP23 FRXqCefMxSfIZ7FbLxAKdh1UXO2k89wGTrs+0dJz4lPTI4oCI21sbNGuMiZ7P8cjBhjm Q8o7H/LWSC0x1jFb0KfYgs4Qg+MUWDTXInWxfZglByg9EzLYLOrGeOfx8/hgu2yn6Czx q04A== X-Gm-Message-State: ALoCoQk153sMkqWZ3Fx2tNcNu+zzoXD7EPM40TMmsquHIdlqEt1dym5pd6drkbOptBbeAJj2wX4N X-Received: by 10.66.185.230 with SMTP id ff6mr19048016pac.102.1424991288656; Thu, 26 Feb 2015 14:54:48 -0800 (PST) Received: from ericsam.boundarydevices.com (wsip-70-184-93-199.ph.ph.cox.net. [70.184.93.199]) by mx.google.com with ESMTPSA id i7sm1915431pbq.92.2015.02.26.14.54.46 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Feb 2015 14:54:47 -0800 (PST) From: Eric Nelson To: alsa-devel@alsa-project.org Date: Thu, 26 Feb 2015 15:54:31 -0700 Message-Id: <1424991273-10081-5-git-send-email-eric.nelson@boundarydevices.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1424991273-10081-1-git-send-email-eric.nelson@boundarydevices.com> References: <1424991273-10081-1-git-send-email-eric.nelson@boundarydevices.com> Cc: fabio.estevam@freescale.com, lars@metafoo.de, tiwai@suse.de, Eric Nelson , lgirdwood@gmail.com, broonie@kernel.org, rmk+kernel@arm.linux.org.uk, jean-michel.hautbois@vodalys.com, troy.kisky@boundarydevices.com Subject: [alsa-devel] [RFC PATCH 4/6] ASoC: sgtl5000: check return values X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Eric Nelson --- sound/soc/codecs/sgtl5000.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c index 0a7b96d7..c373991 100644 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c @@ -1252,12 +1252,17 @@ static int sgtl5000_i2c_probe(struct i2c_client *client, ana_pwr = SGTL5000_ANA_POWER_DEFAULT; if (sgtl5000->num_supplies <= VDDD) { /* internal VDDD at 1.2V */ - regmap_update_bits(sgtl5000->regmap, - SGTL5000_CHIP_LINREG_CTRL, - SGTL5000_LINREG_VDDD_MASK, - LINREG_VDDD); + ret = regmap_update_bits(sgtl5000->regmap, + SGTL5000_CHIP_LINREG_CTRL, + SGTL5000_LINREG_VDDD_MASK, + LINREG_VDDD); + if (ret) + dev_err(&client->dev, + "error %d setting LINREG_VDDD\n", ret); + ana_pwr |= SGTL5000_LINEREG_D_POWERUP; - dev_info(&client->dev, "Using internal LDO instead of VDDD: check ER1\n"); + dev_info(&client->dev, + "Using internal LDO instead of VDDD: check ER1\n"); } else { /* using external LDO for VDDD * Clear startup powerup and simple powerup @@ -1267,7 +1272,11 @@ static int sgtl5000_i2c_probe(struct i2c_client *client, | SGTL5000_LINREG_SIMPLE_POWERUP); dev_dbg(&client->dev, "Using external VDDD\n"); } - regmap_write(sgtl5000->regmap, SGTL5000_CHIP_ANA_POWER, ana_pwr); + ret = regmap_write(sgtl5000->regmap, SGTL5000_CHIP_ANA_POWER, ana_pwr); + if (ret) + dev_err(&client->dev, + "error %d setting CHIP_ANA_POWER to %04x\n", + ret, ana_pwr); if (np) { if (!of_property_read_u32(np,