From patchwork Fri Jan 10 17:30:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balaji T K X-Patchwork-Id: 3467281 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7EC32C02DD for ; Fri, 10 Jan 2014 17:31:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 78EA52013A for ; Fri, 10 Jan 2014 17:31:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3AF7620148 for ; Fri, 10 Jan 2014 17:31:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750816AbaAJRba (ORCPT ); Fri, 10 Jan 2014 12:31:30 -0500 Received: from comal.ext.ti.com ([198.47.26.152]:44223 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750983AbaAJRbL (ORCPT ); Fri, 10 Jan 2014 12:31:11 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id s0AHUvPi018074; Fri, 10 Jan 2014 11:30:57 -0600 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s0AHUv1p020856; Fri, 10 Jan 2014 11:30:57 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.2.342.3; Fri, 10 Jan 2014 11:30:56 -0600 Received: from ulaa0393241.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s0AHUoT1005654; Fri, 10 Jan 2014 11:30:54 -0600 From: Balaji T K To: , , , , , , CC: , Balaji T K Subject: [PATCH v9 1/7] mmc: omap_hsmmc: use devm_regulator API Date: Fri, 10 Jan 2014 23:00:42 +0530 Message-ID: <1389375049-5248-2-git-send-email-balajitk@ti.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1389375049-5248-1-git-send-email-balajitk@ti.com> References: <1389279062-32291-1-git-send-email-balajitk@ti.com> <1389375049-5248-1-git-send-email-balajitk@ti.com> MIME-Version: 1.0 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use devm_regulator API, while at it use devm_regulator_get_optional for optional vmmc_aux supply Signed-off-by: Balaji T K Acked-by: Tony Lindgren --- drivers/mmc/host/omap_hsmmc.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index dbd32ad..1eb4350 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -316,7 +316,7 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host) struct regulator *reg; int ocr_value = 0; - reg = regulator_get(host->dev, "vmmc"); + reg = devm_regulator_get(host->dev, "vmmc"); if (IS_ERR(reg)) { dev_err(host->dev, "vmmc regulator missing\n"); return PTR_ERR(reg); @@ -336,7 +336,7 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host) } /* Allow an aux regulator */ - reg = regulator_get(host->dev, "vmmc_aux"); + reg = devm_regulator_get_optional(host->dev, "vmmc_aux"); host->vcc_aux = IS_ERR(reg) ? NULL : reg; /* For eMMC do not power off when not in sleep state */ @@ -366,8 +366,6 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host) static void omap_hsmmc_reg_put(struct omap_hsmmc_host *host) { - regulator_put(host->vcc); - regulator_put(host->vcc_aux); mmc_slot(host).set_power = NULL; }