From patchwork Tue Jan 8 09:42:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 13915 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 4AF6923E2E for ; Tue, 8 Jan 2013 09:51:03 +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 D7C14A18DE0 for ; Tue, 8 Jan 2013 09:51:02 +0000 (UTC) Received: by mail-vb0-f43.google.com with SMTP id fs19so173446vbb.2 for ; Tue, 08 Jan 2013 01:51:02 -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=IalBVQeJMtVhsIHZoXx/b37Sj+lLCenbrriEUiJx8bU=; b=Tuv4Cx/fRrKO+0P86R/3+BDflQZ3hZfexBQR16Fa/h7eowRfaxVOCKTRQ2ksvwW2an H6SWEF/A4KdXl6N87jMMAAc9jYkGhzRcYBBdS1Hl9JcNfe8xw2d9+pB2MwukEuWZSCke FfDK7kKcI/QBSmkafj4PaAuj7kbCAi99HlDUMAl+TCMAHQmL/25mmGxV56m8o65Vm4Dz AdsC+AzBAlDNQP2sKMepBC8vCxy16CR772c/ar8fSTFXJi1r+I+EwQ+/LN3uoS5xJS7l itTJmjMmeZnbXZ/VSB7sKALxZMstPF0+RuBhe2CS/XWvdfP+eYaV/NYPQGCAQvUHCRrz /QUg== X-Received: by 10.58.196.196 with SMTP id io4mr88395737vec.22.1357638662319; Tue, 08 Jan 2013 01:51:02 -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 st5csp101823veb; Tue, 8 Jan 2013 01:51:01 -0800 (PST) X-Received: by 10.68.241.136 with SMTP id wi8mr197945481pbc.95.1357638661228; Tue, 08 Jan 2013 01:51:01 -0800 (PST) Received: from mail-pa0-f45.google.com (mail-pa0-f45.google.com [209.85.220.45]) by mx.google.com with ESMTPS id vy7si61985254pbc.246.2013.01.08.01.51.00 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 08 Jan 2013 01:51:01 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.45 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.220.45; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.45 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-f45.google.com with SMTP id bg2so234795pad.18 for ; Tue, 08 Jan 2013 01:51:00 -0800 (PST) X-Received: by 10.69.1.65 with SMTP id be1mr155079772pbd.66.1357638660866; Tue, 08 Jan 2013 01:51:00 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id gl5sm2579635pbc.51.2013.01.08.01.50.58 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 08 Jan 2013 01:51:00 -0800 (PST) From: Sachin Kamat To: linux-mmc@vger.kernel.org Cc: cjb@laptop.org, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH 1/1] mmc: mmci: Use devm_regulator_get API Date: Tue, 8 Jan 2013 15:12:49 +0530 Message-Id: <1357638169-23321-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQn7NCKvL2OQBUeVhagkVWJSyvPCUZAJZnLXoEeAJmo/Uj9RBf8rFsM7Vu7wiNpZmcLSkYGt devm_regulator_get is device managed and saves some cleanup and exit code. Signed-off-by: Sachin Kamat --- Compile tested against linux-next tree (20130108). --- drivers/mmc/host/mmci.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 1507723..3ef9b1f 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -1386,7 +1386,7 @@ static int mmci_probe(struct amba_device *dev, #ifdef CONFIG_REGULATOR /* If we're using the regulator framework, try to fetch a regulator */ - host->vcc = regulator_get(&dev->dev, "vmmc"); + host->vcc = devm_regulator_get(&dev->dev, "vmmc"); if (IS_ERR(host->vcc)) host->vcc = NULL; else { @@ -1587,7 +1587,6 @@ static int mmci_remove(struct amba_device *dev) if (host->vcc) mmc_regulator_set_ocr(mmc, host->vcc, 0); - regulator_put(host->vcc); mmc_free_host(mmc);