From patchwork Tue May 10 12:46:17 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot for Andy Shevchenko X-Patchwork-Id: 774192 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p4ACfsYD011593 for ; Tue, 10 May 2011 12:41:54 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932486Ab1EJMlh (ORCPT ); Tue, 10 May 2011 08:41:37 -0400 Received: from smtp.nokia.com ([147.243.128.24]:26398 "EHLO mgw-da01.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932423Ab1EJMlg (ORCPT ); Tue, 10 May 2011 08:41:36 -0400 Received: from nokia.com (localhost [127.0.0.1]) by mgw-da01.nokia.com (Switch-3.4.4/Switch-3.4.3) with ESMTP id p4ACfYlI006621; Tue, 10 May 2011 15:41:34 +0300 Received: from fs-test.research.nokia.com ([esdhcp05135.research.nokia.com [172.21.51.35]]) by mgw-da01.nokia.com with ESMTP id p4ACfIRC006222 ; Tue, 10 May 2011 15:41:19 +0300 Received: by fs-test.research.nokia.com (Postfix, from userid 1001) id CF03DC0040; Tue, 10 May 2011 15:46:21 +0300 (EEST) From: Andy Shevchenko To: linux-mmc@vger.kernel.org, linux-omap@vger.kernel.org Cc: Tony Lindgren , Madhusudhan Chikkature , Andy Shevchenko , Adrian Hunter Subject: [PATCHv2.1] mmc: omap_hsmmc: reduce a bit the error handlers in probe() Date: Tue, 10 May 2011 15:46:17 +0300 Message-Id: <062f4c5e2c7007b40780fb38d48e27917f63afb4.1305030674.git.ext-andriy.shevchenko@nokia.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: References: X-Nokia-AV: Clean Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 10 May 2011 12:41:54 +0000 (UTC) The code contains the similarities in the error path of probe function. Let's combine them at one place. Signed-off-by: Andy Shevchenko Signed-off-by: Adrian Hunter --- drivers/mmc/host/omap_hsmmc.c | 17 ++++++----------- 1 files changed, 6 insertions(+), 11 deletions(-) diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index aeaf0cf..b9200ef 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -2118,18 +2118,11 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev) /* we start off in DISABLED state */ host->dpm_state = DISABLED; - if (clk_enable(host->iclk) != 0) { - clk_put(host->iclk); - clk_put(host->fclk); - goto err1; - } + if (clk_enable(host->iclk) != 0) + goto err2; - if (mmc_host_enable(host->mmc) != 0) { - clk_disable(host->iclk); - clk_put(host->iclk); - clk_put(host->fclk); - goto err1; - } + if (mmc_host_enable(host->mmc) != 0) + goto err3; if (cpu_is_omap2430()) { host->dbclk = clk_get(&pdev->dev, "mmchsdb_fck"); @@ -2274,7 +2267,9 @@ err_irq_cd_init: free_irq(host->irq, host); err_irq: mmc_host_disable(host->mmc); +err3: clk_disable(host->iclk); +err2: clk_put(host->fclk); clk_put(host->iclk); if (host->got_dbclk) {