From patchwork Sat Jun 29 04:27:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Shiyan X-Patchwork-Id: 2803061 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 608D79F245 for ; Sat, 29 Jun 2013 04:28:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5329520111 for ; Sat, 29 Jun 2013 04:28:56 +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 882AA2010F for ; Sat, 29 Jun 2013 04:28:54 +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 1Usmm5-0004aN-4P; Sat, 29 Jun 2013 04:28:37 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Usmm2-0003xy-HT; Sat, 29 Jun 2013 04:28:34 +0000 Received: from smtp2.mail.ru ([94.100.176.130]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Usmly-0003wp-Mu for linux-arm-kernel@lists.infradead.org; Sat, 29 Jun 2013 04:28:32 +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=ZjNEd8XYkxi9NG61GRINjoJuiZK6HrQH3FjCd4NoIhEsXpRDtG9vu/lbrNtW0j4t41kt4zLW995QlQKVabX435p/IuxjTNdN6ttLa/kEqP/yVr0V7zXcr4M2WgDd/Zy/cDRYnYML16XLrHZiAgjy6OD6olpDKs0xPZ55Kz1IYfM=; Received: from [188.134.40.128] (port=37063 helo=shc.zet) by smtp2.mail.ru with esmtpa (envelope-from ) id 1Usmlf-000593-Ag; Sat, 29 Jun 2013 08:28:11 +0400 From: Alexander Shiyan To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 2/5] drivers: bus: imx-weim: Simplify error path Date: Sat, 29 Jun 2013 08:27:51 +0400 Message-Id: <1372480074-24740-2-git-send-email-shc_work@mail.ru> X-Mailer: git-send-email 1.8.1.5 In-Reply-To: <1372480074-24740-1-git-send-email-shc_work@mail.ru> References: <1372480074-24740-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-20130629_002831_226919_A6E9AD6C X-CRM114-Status: GOOD ( 11.12 ) X-Spam-Score: -2.0 (--) Cc: Arnd Bergmann , Alexander Shiyan , Sascha Hauer , 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.4 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; }