From patchwork Sun Jun 23 07:48:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Shiyan X-Patchwork-Id: 2766951 Return-Path: X-Original-To: patchwork-linux-arm@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 8F9F8C0AB1 for ; Sun, 23 Jun 2013 07:50:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BCAB020111 for ; Sun, 23 Jun 2013 07:50:54 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CC5332010F for ; Sun, 23 Jun 2013 07:50:53 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uqf3J-00044d-Sj; Sun, 23 Jun 2013 07:49:39 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uqf33-0000Xd-2w; Sun, 23 Jun 2013 07:49:21 +0000 Received: from smtp20.mail.ru ([94.100.176.173]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uqf2g-0000V3-9U for linux-arm-kernel@lists.infradead.org; Sun, 23 Jun 2013 07:49:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail2; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=BeX+r8E4F0S888VQOmswIIHVUZj77qJlPGI1S8saeco=; b=nLfZsQtQjwQUOeAZEG6iqw/QxGESi6Q9GiA75h0lmv67uclF8UggkLRExVm9G10b8W+/XCBvfl3nwQn1RWErtF8uhHH3mTN+dbp4P7/PcXaVNlGmcIadq2TP1mDo0luYPefBZfEF/z/0HsTD37KZGsbYSgI9K361vDLMlDa6ows=; Received: from [188.134.40.128] (port=47950 helo=shc.zet) by smtp20.mail.ru with esmtpa (envelope-from ) id 1Uqf2J-0008DD-BX; Sun, 23 Jun 2013 11:48:35 +0400 From: Alexander Shiyan To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 2/5] drivers: bus: imx-weim: Simplify error path Date: Sun, 23 Jun 2013 11:48:15 +0400 Message-Id: <1371973698-16150-2-git-send-email-shc_work@mail.ru> X-Mailer: git-send-email 1.8.1.5 In-Reply-To: <1371973698-16150-1-git-send-email-shc_work@mail.ru> References: <1371973698-16150-1-git-send-email-shc_work@mail.ru> X-Mras: Ok X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130623_034858_879585_92E01B62 X-CRM114-Status: GOOD ( 11.00 ) X-Spam-Score: -2.0 (--) Cc: Alexander Shiyan , Sascha Hauer , Rob Herring , Huang Shijie , Grant Likely , Shawn Guo X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID, 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 Signed-off-by: Alexander Shiyan --- drivers/bus/imx-weim.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/drivers/bus/imx-weim.c b/drivers/bus/imx-weim.c index 0c0e6fe..0f4b081 100644 --- a/drivers/bus/imx-weim.c +++ b/drivers/bus/imx-weim.c @@ -78,36 +78,30 @@ static int weim_probe(struct platform_device *pdev) struct resource *res; struct clk *clk; void __iomem *base; - int ret = -EINVAL; + int ret; /* get the resource */ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); base = devm_ioremap_resource(&pdev->dev, res); - if (IS_ERR(base)) { - ret = PTR_ERR(base); - goto weim_err; - } + if (IS_ERR(base)) + return PTR_ERR(base); /* get the clock */ clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(clk)) - goto weim_err; + return PTR_ERR(clk); ret = clk_prepare_enable(clk); if (ret) - goto weim_err; + return ret; /* parse the device node */ ret = weim_parse_dt(pdev, base); - if (ret) { + if (ret) clk_disable_unprepare(clk); - goto weim_err; - } - - dev_info(&pdev->dev, "WEIM driver registered.\n"); - return 0; + else + dev_info(&pdev->dev, "Driver registered.\n"); -weim_err: return ret; }