From patchwork Wed Jul 23 08:42:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 4609361 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 858CCC0514 for ; Wed, 23 Jul 2014 08:42:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BF21720173 for ; Wed, 23 Jul 2014 08:42:45 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 5C7F7201B4 for ; Wed, 23 Jul 2014 08:42:44 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 5E40626567B; Wed, 23 Jul 2014 10:42:43 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: 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 5716F26563F; Wed, 23 Jul 2014 10:42:38 +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 962C1265644; Wed, 23 Jul 2014 10:42:36 +0200 (CEST) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by alsa0.perex.cz (Postfix) with ESMTP id 69017265635 for ; Wed, 23 Jul 2014 10:42:29 +0200 (CEST) Received: by mail-pa0-f54.google.com with SMTP id fa1so1319856pad.27 for ; Wed, 23 Jul 2014 01:42:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:subject:from:to:cc:date:content-type :mime-version:content-transfer-encoding; bh=RMhScBlpbaU+urgYjjBw5OfxqgjnVkFVQeeroO3jzq8=; b=BK8ovRrqsTlQjPTX30F8hIFascyW7SZGK2/0lLY4N9cnebJ6WyDKJQF4lBbzNXh0kb qhh3dusOfCLjiH7RGEoGeyrZdpRwQ7LB8ysxI9uyWyw4T2rA3myJOrmD6tJSrNvDwXAb tmbiOXQ78G3gwwvV8q+F0pttvd5rFki3UQ58hoGdseON6gpKMNg4gImFmxlbd4FxMVeD duXm7+1FbSyzLMm+NM7hHdTE3/eBpzQrKjjNYaby3g9Inbsev7m7u5i/bSLr/NLbB8RU gyEMdyduSjJv6cJ9NjQo3vrWhLsK4jxhwhZWaV4G7K64HAo0SFx0jS0j+4KU5tnvG+JR qDRA== X-Gm-Message-State: ALoCoQkGXCvyoGJrn+bx//QI8hmxwOYjxSMXcdplZrB5qGseFBpkSgnwvI90is+zEvefhKXH8tbI X-Received: by 10.68.68.234 with SMTP id z10mr29325044pbt.59.1406104945883; Wed, 23 Jul 2014 01:42:25 -0700 (PDT) Received: from [10.118.50.153] ([60.245.64.174]) by mx.google.com with ESMTPSA id k8sm1600545pbq.94.2014.07.23.01.42.24 for (version=SSLv3 cipher=RC4-SHA bits=128/128); Wed, 23 Jul 2014 01:42:25 -0700 (PDT) Message-ID: <1406104941.666.0.camel@phoenix> From: Axel Lin To: Mark Brown Date: Wed, 23 Jul 2014 16:42:21 +0800 X-Mailer: Evolution 3.10.4-0ubuntu1 Mime-Version: 1.0 Cc: "alsa-devel@alsa-project.org" , Liam Girdwood , Dan Murphy Subject: [alsa-devel] [PATCH] ASoC: tas2552: Return proper error for probe error paths 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Return error if devm_regulator_bulk_get() or snd_soc_register_codec() fails. Signed-off-by: Axel Lin --- sound/soc/codecs/tas2552.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/tas2552.c b/sound/soc/codecs/tas2552.c index f0760af..05f3737 100644 --- a/sound/soc/codecs/tas2552.c +++ b/sound/soc/codecs/tas2552.c @@ -480,8 +480,10 @@ static int tas2552_probe(struct i2c_client *client, ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(data->supplies), data->supplies); - if (ret != 0) + if (ret != 0) { dev_err(dev, "Failed to request supplies: %d\n", ret); + return ret; + } pm_runtime_set_active(&client->dev); pm_runtime_set_autosuspend_delay(&client->dev, 1000); @@ -498,7 +500,7 @@ static int tas2552_probe(struct i2c_client *client, if (ret < 0) dev_err(&client->dev, "Failed to register codec: %d\n", ret); - return 0; + return ret; } static int tas2552_i2c_remove(struct i2c_client *client)