]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drivers: bus: imx-weim: Simplify error path
authorAlexander Shiyan <shc_work@mail.ru>
Sat, 29 Jun 2013 04:27:51 +0000 (08:27 +0400)
committerShawn Guo <shawn.guo@linaro.org>
Tue, 16 Jul 2013 06:58:25 +0000 (14:58 +0800)
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
drivers/bus/imx-weim.c

index 0c0e6fea129fd1c3f05c9925ef8aa145ef1484d0..0f4b08112afbe66f5888c0d2d88ab0e62d2211c5 100644 (file)
@@ -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;
 }