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: 1944711 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id C3DACDF23A for ; Tue, 8 Jan 2013 09:51:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755088Ab3AHJvC (ORCPT ); Tue, 8 Jan 2013 04:51:02 -0500 Received: from mail-pb0-f46.google.com ([209.85.160.46]:36534 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754532Ab3AHJvB (ORCPT ); Tue, 8 Jan 2013 04:51:01 -0500 Received: by mail-pb0-f46.google.com with SMTP id wy7so145830pbc.5 for ; Tue, 08 Jan 2013 01:51:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=IalBVQeJMtVhsIHZoXx/b37Sj+lLCenbrriEUiJx8bU=; b=NIr3ZiBcyhBQ+U/pH4tGf7YQghL28q8m8gSNeBVOspueqlRpzeTNwhhRYmBQK5Vb8x uTKSUlyAfettIF0+F3cH+GNFUkjZVgUUj4ybT/NHTBYEIKI9g4AiomNT9Jc9tbOgx4rK q3Q2joQV0A+BtDYx1Tyb2Fwtvx1TFBp2dmm4Xe+AHEcfGcgzqK231nGxvDxjl/d73KRe vmJ5YMOTmFDTb4xW8vdN+ky0HrrSnJsrVmVNxicnCCVHhS9xGmGgaNgbCS3eiEjHZriS kW2TIqv3QF/0CgGPfUJ6bpg91IrB3CaKN9K0oBFlr48a1gtIHJr+kzsdPr+K67rGN9ZQ 4C6Q== 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: ALoCoQnh1WIpPOlsK+c9Nrp/Ftsiw4O78RBMAevyxIInMCGj/XAMJPGU1M4bCWrUx9NqKIeSbgAq Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org 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);