From: Baolin Wang Date: Fri, 27 Sep 2019 07:10:45 +0000 (+0800) Subject: hwspinlock: sprd: Check the return value of clk_prepare_enable() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=3070c41643609c66d33de3577fc9d8ca15932513;p=linux.git 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 Signed-off-by: Bjorn Andersson --- diff --git a/drivers/hwspinlock/sprd_hwspinlock.c b/drivers/hwspinlock/sprd_hwspinlock.c index 7a8534f77737b..d2104248013bc 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);