From patchwork Tue Jan 8 08:31:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 13906 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 B8ABF23E2D for ; Tue, 8 Jan 2013 08:39:38 +0000 (UTC) Received: from mail-vb0-f43.google.com (mail-vb0-f43.google.com [209.85.212.43]) by fiordland.canonical.com (Postfix) with ESMTP id 5E1A5A18ABD for ; Tue, 8 Jan 2013 08:39:38 +0000 (UTC) Received: by mail-vb0-f43.google.com with SMTP id fs19so124723vbb.30 for ; Tue, 08 Jan 2013 00:39:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=uMFJhk6vH3kj6YtoBUQWTLUKLYG4yOveLHjuji7KALU=; b=LliL055wBn+rLb+0wk1hxQYGhywT/HHaqo7yZKMsjV1pYhfepp0pTiyIiY8kpY5P4c fxkIlun6KSiWoHGUkAWXzvTWprPJ06ZACBVvozablAduO5wNTuOZw1vH01WfbwhwmZHo CwGyDK5kCTmnUPs2bjuV88jWKRySdPBow3+CyCwdXcQlh8Fiy4wt7vHXPoIhu0z0z8gL k50Taaa/PNn4zDQ8FGlFjlxt7oFMbr83fVZ4vFINrAyCaRoQFIBk/Jm+Qdm4XOfI82gR qpq0Ide9kfBlKObKSq4ZCwofm2ArrZMwBv6w7cq5X0uq8K0ZHgVXCgXsKVNtCjFhfNVq S45A== X-Received: by 10.220.238.139 with SMTP id ks11mr83954151vcb.49.1357634377784; Tue, 08 Jan 2013 00:39:37 -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.58.145.101 with SMTP id st5csp99628veb; Tue, 8 Jan 2013 00:39:36 -0800 (PST) X-Received: by 10.68.235.200 with SMTP id uo8mr5244883pbc.29.1357634375707; Tue, 08 Jan 2013 00:39:35 -0800 (PST) Received: from mail-pb0-f51.google.com (mail-pb0-f51.google.com [209.85.160.51]) by mx.google.com with ESMTPS id rr6si61835722pbc.221.2013.01.08.00.39.35 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 08 Jan 2013 00:39:35 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.51 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.160.51; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.51 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-pb0-f51.google.com with SMTP id ro12so109988pbb.10 for ; Tue, 08 Jan 2013 00:39:35 -0800 (PST) X-Received: by 10.68.233.201 with SMTP id ty9mr199305586pbc.14.1357634375097; Tue, 08 Jan 2013 00:39:35 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id x2sm40371086paw.8.2013.01.08.00.39.32 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 08 Jan 2013 00:39:34 -0800 (PST) From: Sachin Kamat To: linux-kernel@vger.kernel.org Cc: patches@opensource.wolfsonmicro.com, broonie@opensource.wolfsonmicro.com, sameo@linux.intel.com, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH 1/1] mfd: wm8994: Use devm_regulator_bulk_get API Date: Tue, 8 Jan 2013 14:01:22 +0530 Message-Id: <1357633882-5191-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQlk9e65ZAphTCgzTEQ/NZQWRXVux7+ZLW8pV0ntf+PLxnM8HYLTlkCWJiODt8jPBzl4VeDK devm_regulator_bulk_get is device managed and saves some cleanup and exit code. Signed-off-by: Sachin Kamat Acked-by: Mark Brown --- Compile tested against linux-next tree (20130108). --- drivers/mfd/wm8994-core.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/mfd/wm8994-core.c b/drivers/mfd/wm8994-core.c index 57c488d..803e93f 100644 --- a/drivers/mfd/wm8994-core.c +++ b/drivers/mfd/wm8994-core.c @@ -467,7 +467,7 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq) goto err; } - ret = regulator_bulk_get(wm8994->dev, wm8994->num_supplies, + ret = devm_regulator_bulk_get(wm8994->dev, wm8994->num_supplies, wm8994->supplies); if (ret != 0) { dev_err(wm8994->dev, "Failed to get supplies: %d\n", ret); @@ -478,7 +478,7 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq) wm8994->supplies); if (ret != 0) { dev_err(wm8994->dev, "Failed to enable supplies: %d\n", ret); - goto err_get; + goto err; } ret = wm8994_reg_read(wm8994, WM8994_SOFTWARE_RESET); @@ -658,8 +658,6 @@ err_irq: err_enable: regulator_bulk_disable(wm8994->num_supplies, wm8994->supplies); -err_get: - regulator_bulk_free(wm8994->num_supplies, wm8994->supplies); err: mfd_remove_devices(wm8994->dev); return ret; @@ -672,7 +670,6 @@ static void wm8994_device_exit(struct wm8994 *wm8994) wm8994_irq_exit(wm8994); regulator_bulk_disable(wm8994->num_supplies, wm8994->supplies); - regulator_bulk_free(wm8994->num_supplies, wm8994->supplies); } static const struct of_device_id wm8994_of_match[] = {