From patchwork Tue Apr 30 14:03:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balaji T K X-Patchwork-Id: 2504611 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 3FCD43FD85 for ; Tue, 30 Apr 2013 14:04:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760738Ab3D3OEI (ORCPT ); Tue, 30 Apr 2013 10:04:08 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:58086 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760713Ab3D3OEG (ORCPT ); Tue, 30 Apr 2013 10:04:06 -0400 Received: from dbdlxv05.itg.ti.com ([172.24.171.60]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id r3UE43pw019737; Tue, 30 Apr 2013 09:04:04 -0500 Received: from DBDE72.ent.ti.com (dbde72.ent.ti.com [172.24.171.97]) by dbdlxv05.itg.ti.com (8.14.3/8.13.8) with ESMTP id r3UE3vac005935; Tue, 30 Apr 2013 09:04:02 -0500 Received: from dbdp32.itg.ti.com (172.24.170.251) by DBDE72.ent.ti.com (172.24.171.97) with Microsoft SMTP Server id 14.2.342.3; Tue, 30 Apr 2013 22:03:57 +0800 Received: from ulaa0393241.apr.dhcp.ti.com (smtpvbd.itg.ti.com [172.24.170.250]) by dbdp32.itg.ti.com (8.13.8/8.13.8) with ESMTP id r3UE3sme003935; Tue, 30 Apr 2013 19:33:57 +0530 From: Balaji T K To: , , , , CC: Balaji T K Subject: [PATCH 05/13] mmc: omap_hsmmc: remove use_reg Date: Tue, 30 Apr 2013 19:33:45 +0530 Message-ID: <1367330633-5941-6-git-send-email-balajitk@ti.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1367330633-5941-1-git-send-email-balajitk@ti.com> References: <1367330633-5941-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 Since regulator_put can handle NULL / IS_ERR(regulator) use_reg can be removed, so that regulator_put in omap_hsmmc_reg_put can be reused for vmmc_aux regulator error scenario. Signed-off-by: Balaji T K --- drivers/mmc/host/omap_hsmmc.c | 8 ++------ 1 files changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 5fd78b2..6616621 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -178,7 +178,6 @@ struct omap_hsmmc_host { int context_loss; int protect_card; int reqs_blocked; - int use_reg; int req_in_progress; struct omap_hsmmc_next next_data; @@ -1961,7 +1960,6 @@ static int omap_hsmmc_probe(struct platform_device *pdev) ret = omap_hsmmc_reg_get(host); if (ret) goto err_irq_cd; - host->use_reg = 1; } mmc->ocr_avail = mmc_slot(host).ocr_mask; @@ -2015,8 +2013,7 @@ err_slot_name: mmc_remove_host(mmc); free_irq(mmc_slot(host).card_detect_irq, host); err_irq_cd: - if (host->use_reg) - omap_hsmmc_reg_put(host); + omap_hsmmc_reg_put(host); if (host->pdata->cleanup) host->pdata->cleanup(&pdev->dev); err_irq_cd_init: @@ -2053,8 +2050,7 @@ static int omap_hsmmc_remove(struct platform_device *pdev) pm_runtime_get_sync(host->dev); mmc_remove_host(host->mmc); - if (host->use_reg) - omap_hsmmc_reg_put(host); + omap_hsmmc_reg_put(host); if (host->pdata->cleanup) host->pdata->cleanup(&pdev->dev); free_irq(host->irq, host);