Skip to content

Commit

Permalink
hwspinlock: sprd: Check the return value of clk_prepare_enable()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Bjorn Andersson <[email protected]>
  • Loading branch information
wangbaolin719 authored and andersson committed Oct 5, 2019
1 parent 74cfa95 commit 3070c41
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/hwspinlock/sprd_hwspinlock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3070c41

Please sign in to comment.