summaryrefslogtreecommitdiff
path: root/drivers/hwspinlock
diff options
context:
space:
mode:
authorBaolin Wang <baolin.wang@linaro.org>2019-09-27 10:10:45 +0300
committerBjorn Andersson <bjorn.andersson@linaro.org>2019-10-05 07:07:44 +0300
commit3070c41643609c66d33de3577fc9d8ca15932513 (patch)
tree20c8dc5faf26a4e2804167efbca18cad82043dd4 /drivers/hwspinlock
parent74cfa956cbead238cf6c5307be461a087c569c97 (diff)
downloadlinux-3070c41643609c66d33de3577fc9d8ca15932513.tar.xz
hwspinlock: sprd: Check the return value of clk_prepare_enable()
We must check the return value of clk_prepare_enable() to make sure the hardware spinlock controller can be enabled successfully, otherwise we should return error. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Diffstat (limited to 'drivers/hwspinlock')
-rw-r--r--drivers/hwspinlock/sprd_hwspinlock.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/hwspinlock/sprd_hwspinlock.c b/drivers/hwspinlock/sprd_hwspinlock.c
index 7a8534f77737..d2104248013b 100644
--- a/drivers/hwspinlock/sprd_hwspinlock.c
+++ b/drivers/hwspinlock/sprd_hwspinlock.c
@@ -105,7 +105,9 @@ static int sprd_hwspinlock_probe(struct platform_device *pdev)
return PTR_ERR(sprd_hwlock->clk);
}
- clk_prepare_enable(sprd_hwlock->clk);
+ ret = clk_prepare_enable(sprd_hwlock->clk);
+ if (ret)
+ return ret;
/* set the hwspinlock to record user id to identify subsystems */
writel(HWSPINLOCK_USER_BITS, sprd_hwlock->base + HWSPINLOCK_RECCTRL);