aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bus
diff options
context:
space:
mode:
authorAlexander Shiyan <shc_work@mail.ru>2013-06-29 00:27:51 -0400
committerShawn Guo <shawn.guo@linaro.org>2013-08-16 00:59:43 -0400
commitb2d1fb7332f2bb8c0630f224d8e2151c0e157004 (patch)
tree39d75450cf65217e58d12366e975af87b6af368e /drivers/bus
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>
Diffstat (limited to 'drivers/bus')
-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)
78 struct resource *res; 78 struct resource *res;
79 struct clk *clk; 79 struct clk *clk;
80 void __iomem *base; 80 void __iomem *base;
81 int ret = -EINVAL; 81 int ret;
82 82
83 /* get the resource */ 83 /* get the resource */
84 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 84 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
85 base = devm_ioremap_resource(&pdev->dev, res); 85 base = devm_ioremap_resource(&pdev->dev, res);
86 if (IS_ERR(base)) { 86 if (IS_ERR(base))
87 ret = PTR_ERR(base); 87 return PTR_ERR(base);
88 goto weim_err;
89 }
90 88
91 /* get the clock */ 89 /* get the clock */
92 clk = devm_clk_get(&pdev->dev, NULL); 90 clk = devm_clk_get(&pdev->dev, NULL);
93 if (IS_ERR(clk)) 91 if (IS_ERR(clk))
94 goto weim_err; 92 return PTR_ERR(clk);
95 93
96 ret = clk_prepare_enable(clk); 94 ret = clk_prepare_enable(clk);
97 if (ret) 95 if (ret)
98 goto weim_err; 96 return ret;
99 97
100 /* parse the device node */ 98 /* parse the device node */
101 ret = weim_parse_dt(pdev, base); 99 ret = weim_parse_dt(pdev, base);
102 if (ret) { 100 if (ret)
103 clk_disable_unprepare(clk); 101 clk_disable_unprepare(clk);
104 goto weim_err; 102 else
105 } 103 dev_info(&pdev->dev, "Driver registered.\n");
106
107 dev_info(&pdev->dev, "WEIM driver registered.\n");
108 return 0;
109 104
110weim_err:
111 return ret; 105 return ret;
112} 106}
113 107