linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: shc_work@mail.ru (Alexander Shiyan)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 2/7] drivers: bus: imx-weim: Simplify error path
Date: Wed, 19 Jun 2013 23:54:33 +0400	[thread overview]
Message-ID: <1371671678-6345-2-git-send-email-shc_work@mail.ru> (raw)
In-Reply-To: <1371671678-6345-1-git-send-email-shc_work@mail.ru>


Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 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;
 }
 
-- 
1.8.1.5

  reply	other threads:[~2013-06-19 19:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-19 19:54 [PATCH v2 1/7] drivers: bus: imx-weim: Remove private driver data Alexander Shiyan
2013-06-19 19:54 ` Alexander Shiyan [this message]
2013-06-19 19:54 ` [PATCH v2 3/7] drivers: bus: imx-weim: use module_platform_driver_probe() Alexander Shiyan
2013-06-19 19:54 ` [PATCH v2 4/7] drivers: bus: imx-weim: Preparation driver to support different CPUs Alexander Shiyan
2013-06-19 19:54 ` [PATCH v2 5/7] drivers: bus: imx-weim: Add missing platform_friver.owner field Alexander Shiyan
2013-06-19 19:54 ` [PATCH v2 6/7] drivers: bus: imx-weim: Add support for i.MX1/21/25/27/31/35/50/51/53 Alexander Shiyan
2013-06-19 20:07   ` Sascha Hauer
2013-06-19 20:16     ` Re[2]: " Alexander Shiyan
2013-06-19 20:29       ` Sascha Hauer
2013-06-19 19:54 ` [PATCH v2 7/7] drivers: bus: imx-weim: Change compatible string for i.MX6Q Alexander Shiyan
2013-06-20  7:10   ` Shawn Guo
2013-06-20  8:07     ` Sascha Hauer
2013-06-20  8:15       ` Shawn Guo
2013-06-20 12:47       ` Fabio Estevam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1371671678-6345-2-git-send-email-shc_work@mail.ru \
    --to=shc_work@mail.ru \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).