From patchwork Mon Nov 26 11:49:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 13200 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id D633123FC6 for ; Mon, 26 Nov 2012 11:56:21 +0000 (UTC) Received: from mail-ia0-f180.google.com (mail-ia0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 7394CA18312 for ; Mon, 26 Nov 2012 11:56:21 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id t4so5135959iag.11 for ; Mon, 26 Nov 2012 03:56:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=16CsXpUJ7zQD6NJPQOJSFMkQFGrgY+P5xkIJNP56IiA=; b=LOVpIzwyqFTBEp8/1bjatbl8TLoZ+gj5UQ25CNuqMUFPtSdUI1wHQd7631UyHE1ZjR Lb/NvMApt/Dn4hnNqn50ge8QEAKVKnJJYuO09V/Bdh1EmlwWJT9hU8sitbbVhtswJwFN p3vOnk4CAosqFTScz3Ub699Kg+0ISuOTLM2TE3Fd0LySv/zxcHGzptXcDrTF7pmHORp1 9qzmVGgwPUqZJSSbNp+GOHsTWomC84eLoYm7+zfy2Efe5VHATBC6t6xSrNyOT1tqAz0B ZFjxZZwSdMnTTvve0TPgdFFd+7bIMMzw+fsyvx45OJhWZGUfKCIor+nBs8v1EL/L/xNO m/0w== Received: by 10.50.186.199 with SMTP id fm7mr10543010igc.62.1353930981260; Mon, 26 Nov 2012 03:56:21 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp245061igt; Mon, 26 Nov 2012 03:56:20 -0800 (PST) Received: by 10.68.234.167 with SMTP id uf7mr36931070pbc.20.1353930980727; Mon, 26 Nov 2012 03:56:20 -0800 (PST) Received: from mail-pa0-f41.google.com (mail-pa0-f41.google.com [209.85.220.41]) by mx.google.com with ESMTPS id h9si18745255paw.337.2012.11.26.03.56.20 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 26 Nov 2012 03:56:20 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.41 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.220.41; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.41 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) smtp.mail=sachin.kamat@linaro.org Received: by mail-pa0-f41.google.com with SMTP id bj3so3316824pad.28 for ; Mon, 26 Nov 2012 03:56:20 -0800 (PST) Received: by 10.68.242.9 with SMTP id wm9mr36678508pbc.7.1353930980486; Mon, 26 Nov 2012 03:56:20 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id kb3sm8677482pbc.27.2012.11.26.03.56.17 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 26 Nov 2012 03:56:19 -0800 (PST) From: Sachin Kamat To: alsa-devel@alsa-project.org Cc: broonie@opensource.wolfsonmicro.com, lrg@ti.com, tiwai@suse.de, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH 02/14] ASoC: wm8962: Use devm_regulator_bulk_get Date: Mon, 26 Nov 2012 17:19:35 +0530 Message-Id: <1353930587-12907-3-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1353930587-12907-1-git-send-email-sachin.kamat@linaro.org> References: <1353930587-12907-1-git-send-email-sachin.kamat@linaro.org> X-Gm-Message-State: ALoCoQmf2hb0/TtzOyk5H6L4pDhhsJPBsmRerVLBoZfw7uF75gWMcXuTm+ysOj98p9lJ/K6CHA9v devm_regulator_bulk_get() is device managed and makes error handling and code cleanup simpler. Signed-off-by: Sachin Kamat --- sound/soc/codecs/wm8962.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c index ce67200..285a9ef 100644 --- a/sound/soc/codecs/wm8962.c +++ b/sound/soc/codecs/wm8962.c @@ -3610,7 +3610,7 @@ static __devinit int wm8962_i2c_probe(struct i2c_client *i2c, for (i = 0; i < ARRAY_SIZE(wm8962->supplies); i++) wm8962->supplies[i].supply = wm8962_supply_names[i]; - ret = regulator_bulk_get(&i2c->dev, ARRAY_SIZE(wm8962->supplies), + ret = devm_regulator_bulk_get(&i2c->dev, ARRAY_SIZE(wm8962->supplies), wm8962->supplies); if (ret != 0) { dev_err(&i2c->dev, "Failed to request supplies: %d\n", ret); @@ -3621,7 +3621,7 @@ static __devinit int wm8962_i2c_probe(struct i2c_client *i2c, wm8962->supplies); if (ret != 0) { dev_err(&i2c->dev, "Failed to enable supplies: %d\n", ret); - goto err_get; + return ret; } wm8962->regmap = regmap_init_i2c(i2c, &wm8962_regmap); @@ -3697,8 +3697,6 @@ err_regmap: regmap_exit(wm8962->regmap); err_enable: regulator_bulk_disable(ARRAY_SIZE(wm8962->supplies), wm8962->supplies); -err_get: - regulator_bulk_free(ARRAY_SIZE(wm8962->supplies), wm8962->supplies); err: return ret; } @@ -3709,7 +3707,6 @@ static __devexit int wm8962_i2c_remove(struct i2c_client *client) snd_soc_unregister_codec(&client->dev); regmap_exit(wm8962->regmap); - regulator_bulk_free(ARRAY_SIZE(wm8962->supplies), wm8962->supplies); return 0; }