From patchwork Tue Jun 18 15:46:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Shiyan X-Patchwork-Id: 2743081 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 6DE8FC0AB1 for ; Tue, 18 Jun 2013 15:48:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1D498204C4 for ; Tue, 18 Jun 2013 15:48:33 +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 17A06204BE for ; Tue, 18 Jun 2013 15:48:31 +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 1Uoy8U-0002wx-5A; Tue, 18 Jun 2013 15:47:58 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uoy8L-00041i-4A; Tue, 18 Jun 2013 15:47:49 +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 1Uoy87-0003yg-6c for linux-arm-kernel@lists.infradead.org; Tue, 18 Jun 2013 15:47:38 +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=HW/IscSpAqzpF7hcuMMR5EK3Y+8VWzIugtoqYTCwY7taknP1bAMfk4IqUG0kqtmUF5Kt3PJrWp3Tk2V2FSEmGvrG3Wrzut3/CVG8fwk8iOJ6jNH2PujHZW7EE0rbfo8o03SgNnEGu9/i5Pw+/PCmrK7nscq8qt4KAi+w4CkEI5o=; Received: from [188.134.40.128] (port=29480 helo=shc.zet) by smtp20.mail.ru with esmtpa (envelope-from ) id 1Uoy7j-000311-D1; Tue, 18 Jun 2013 19:47:11 +0400 From: Alexander Shiyan To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/4] drivers: bus: imx-weim: Simplify error path Date: Tue, 18 Jun 2013 19:46:48 +0400 Message-Id: <1371570410-12773-2-git-send-email-shc_work@mail.ru> X-Mailer: git-send-email 1.8.1.5 In-Reply-To: <1371570410-12773-1-git-send-email-shc_work@mail.ru> References: <1371570410-12773-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-20130618_114736_126318_3809662A X-CRM114-Status: GOOD ( 10.97 ) X-Spam-Score: -2.0 (--) Cc: Huang Shijie , Sascha Hauer , Shawn Guo , Alexander Shiyan 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.3 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; }