From patchwork Sat Apr 5 21:35:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 3943141 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id F38749F371 for ; Sun, 6 Apr 2014 08:06:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 409622039C for ; Sun, 6 Apr 2014 08:06:11 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id B45B920386 for ; Sun, 6 Apr 2014 08:06:09 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id B21D1265914; Sun, 6 Apr 2014 10:06:08 +0200 (CEST) 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, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 17E7B265487; Sun, 6 Apr 2014 10:00:36 +0200 (CEST) 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 6DB0C2651CB; Sat, 5 Apr 2014 23:37:17 +0200 (CEST) Received: from ring0.de (ring0.de [5.45.105.125]) by alsa0.perex.cz (Postfix) with ESMTP id B25C6265166 for ; Sat, 5 Apr 2014 23:37:10 +0200 (CEST) From: Sebastian Reichel To: Sebastian Reichel , Mark Brown , Peter Ujfalusi Date: Sat, 5 Apr 2014 23:35:53 +0200 Message-Id: <1396733753-9820-6-git-send-email-sre@kernel.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1396733753-9820-1-git-send-email-sre@kernel.org> References: <1396733753-9820-1-git-send-email-sre@kernel.org> X-Mailman-Approved-At: Sun, 06 Apr 2014 10:00:29 +0200 Cc: Mark Rutland , devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Pawel Moll , Ian Campbell , Tony Lindgren , Liam Girdwood , Rob Herring , linux-kernel@vger.kernel.org, Sebastian Reichel , Kumar Gala , linux-omap@vger.kernel.org, Jarkko Nikula Subject: [alsa-devel] [PATCH 5/5] ASoC: tlv320aic3x: fix shared reset pin for DT 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 Currently the second tlv320aic3x instance fails to be probed from DT if the reset pin is shared with the first one. This patch fixes it by moving the list add of the reset pin into the i2c_probe method. Signed-off-by: Sebastian Reichel --- sound/soc/codecs/tlv320aic3x.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c index b183510..d7349bc 100644 --- a/sound/soc/codecs/tlv320aic3x.c +++ b/sound/soc/codecs/tlv320aic3x.c @@ -1399,7 +1399,6 @@ static int aic3x_probe(struct snd_soc_codec *codec) } aic3x_add_widgets(codec); - list_add(&aic3x->list, &reset_list); return 0; @@ -1569,7 +1568,13 @@ static int aic3x_i2c_probe(struct i2c_client *i2c, ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_aic3x, &aic3x_dai, 1); - return ret; + + if (ret != 0) + goto err_gpio; + + list_add(&aic3x->list, &reset_list); + + return 0; err_gpio: if (gpio_is_valid(aic3x->gpio_reset) &&