clk_prepare_enable() can fail here and we must check its return value.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
return -ENOENT;
}
- clk_prepare_enable(ts.clock);
+ ret = clk_prepare_enable(ts.clock);
+ if (ret) {
+ dev_err(dev, "Failed! to enabled clocks\n");
+ goto err_clk_get;
+ }
dev_dbg(dev, "got and enabled clocks\n");
ts.irq_tc = ret = platform_get_irq(pdev, 0);
err_iomap:
iounmap(ts.io);
err_clk:
+ clk_disable_unprepare(ts.clock);
del_timer_sync(&touch_timer);
+ err_clk_get:
clk_put(ts.clock);
return ret;
}