summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorArvind Yadav <arvind.yadav.cs@gmail.com>2017-06-01 12:47:10 +0200
committerDominik Brodowski <linux@dominikbrodowski.net>2018-01-24 19:24:39 +0100
commitd3fdd701248290b511683ff8d348073295f07833 (patch)
treea8fd80284eedd2e39407e8289e0f43fe89761bf4 /drivers
parentpcmcia: use proper printk format for resource (diff)
downloadlinux-d3fdd701248290b511683ff8d348073295f07833.tar.xz
linux-d3fdd701248290b511683ff8d348073295f07833.zip
pcmcia: soc_common: Handle return value of clk_prepare_enable
clk_prepare_enable() can fail here and we must check its return value. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> CC: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pcmcia/soc_common.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/pcmcia/soc_common.c b/drivers/pcmcia/soc_common.c
index 764650eb8897..c5f2344c189b 100644
--- a/drivers/pcmcia/soc_common.c
+++ b/drivers/pcmcia/soc_common.c
@@ -191,12 +191,16 @@ static int soc_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
{
int ret = 0, i;
- clk_prepare_enable(skt->clk);
+ ret = clk_prepare_enable(skt->clk);
+ if (ret)
+ return ret;
if (skt->ops->hw_init) {
ret = skt->ops->hw_init(skt);
- if (ret)
+ if (ret) {
+ clk_disable_unprepare(skt->clk);
return ret;
+ }
}
for (i = 0; i < ARRAY_SIZE(skt->stat); i++) {