summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Shiyan <shc_work@mail.ru>2013-06-29 08:27:51 +0400
committerShawn Guo <shawn.guo@linaro.org>2013-08-16 12:59:43 +0800
commitb2d1fb7332f2bb8c0630f224d8e2151c0e157004 (patch)
tree39d75450cf65217e58d12366e975af87b6af368e
parent70ac98da780f7085d8c5f0e89bd0438a7f286d20 (diff)
drivers: bus: imx-weim: Simplify error path
Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
-rw-r--r--drivers/bus/imx-weim.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/drivers/bus/imx-weim.c b/drivers/bus/imx-weim.c
index 0c0e6fea129f..0f4b08112afb 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;
}