From patchwork Mon Nov 26 11:49:37 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 13202 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 5016923FC6 for ; Mon, 26 Nov 2012 11:56:28 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 1862EA1968A for ; Mon, 26 Nov 2012 11:56:27 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id c10so4419020ieb.11 for ; Mon, 26 Nov 2012 03:56:27 -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=1PtfF1cA51OTYMq8h3Ta14Zkbaqv3Gyo7J5FQmmWC5M=; b=IwWze1TJjJjgBkuRDzzIbvD0tTlQZrIxRY6Q16BZHk8pF8smipcbF3dsLWWPadvpew brTP25GIsJgoakxWBnTpfaNKP3ZgN1VDloTwDiyaZSO/g1klN1kQp3nh86LAltXJsgel 5/J6C0UDcOqFSMTbULc+M6I7NF/Is6ERp0DclofQ1NrhO9hmmBNxgy3eMjfprKnctKoI 3VeqCUhpUf6K0wGfG9OVfb1rMJjaGCFArrMNMJ0C6r2rfeFG6tuPjOsk5UPddgiCG4tM rH+JrfMxh/zQFHiL3iLz9aMBXB7uzWNn+NjS2bnExAczn9B/55loy12OLif+Dy8ABbJB rwwg== Received: by 10.50.213.69 with SMTP id nq5mr13272010igc.70.1353930987859; Mon, 26 Nov 2012 03:56:27 -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 n20csp245072igt; Mon, 26 Nov 2012 03:56:27 -0800 (PST) Received: by 10.68.223.35 with SMTP id qr3mr8595435pbc.27.1353930987315; Mon, 26 Nov 2012 03:56:27 -0800 (PST) Received: from mail-pa0-f42.google.com (mail-pa0-f42.google.com [209.85.220.42]) by mx.google.com with ESMTPS id a6si1515920paw.284.2012.11.26.03.56.27 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 26 Nov 2012 03:56:27 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.42 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.220.42; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.42 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-f42.google.com with SMTP id rl6so5720935pac.1 for ; Mon, 26 Nov 2012 03:56:27 -0800 (PST) Received: by 10.66.87.133 with SMTP id ay5mr32149400pab.59.1353930987083; Mon, 26 Nov 2012 03:56:27 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id kb3sm8677482pbc.27.2012.11.26.03.56.24 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 26 Nov 2012 03:56:26 -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 04/14] ASoC: wm8993: Use devm_regulator_bulk_get Date: Mon, 26 Nov 2012 17:19:37 +0530 Message-Id: <1353930587-12907-5-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: ALoCoQnKQOHq9Ad6HKfXap21wk8Tw/MHjj/4cLObcdzuG6qY8dtrkXCnTCDAuER9KS+7HICQ0eVT devm_regulator_bulk_get() is device managed and makes error handling and code cleanup simpler. Signed-off-by: Sachin Kamat --- sound/soc/codecs/wm8993.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/sound/soc/codecs/wm8993.c b/sound/soc/codecs/wm8993.c index 94737a3..c3d3107 100644 --- a/sound/soc/codecs/wm8993.c +++ b/sound/soc/codecs/wm8993.c @@ -1672,7 +1672,7 @@ static __devinit int wm8993_i2c_probe(struct i2c_client *i2c, for (i = 0; i < ARRAY_SIZE(wm8993->supplies); i++) wm8993->supplies[i].supply = wm8993_supply_names[i]; - ret = regulator_bulk_get(&i2c->dev, ARRAY_SIZE(wm8993->supplies), + ret = devm_regulator_bulk_get(&i2c->dev, ARRAY_SIZE(wm8993->supplies), wm8993->supplies); if (ret != 0) { dev_err(&i2c->dev, "Failed to request supplies: %d\n", ret); @@ -1683,7 +1683,7 @@ static __devinit int wm8993_i2c_probe(struct i2c_client *i2c, wm8993->supplies); if (ret != 0) { dev_err(&i2c->dev, "Failed to enable supplies: %d\n", ret); - goto err_get; + goto err; } ret = regmap_read(wm8993->regmap, WM8993_SOFTWARE_RESET, ®); @@ -1742,8 +1742,6 @@ err_irq: free_irq(i2c->irq, wm8993); err_enable: regulator_bulk_disable(ARRAY_SIZE(wm8993->supplies), wm8993->supplies); -err_get: - regulator_bulk_free(ARRAY_SIZE(wm8993->supplies), wm8993->supplies); err: regmap_exit(wm8993->regmap); return ret; @@ -1758,7 +1756,6 @@ static __devexit int wm8993_i2c_remove(struct i2c_client *i2c) free_irq(i2c->irq, wm8993); regmap_exit(wm8993->regmap); regulator_bulk_disable(ARRAY_SIZE(wm8993->supplies), wm8993->supplies); - regulator_bulk_free(ARRAY_SIZE(wm8993->supplies), wm8993->supplies); return 0; }