clk: sprd: Add check for return value of sprd_clk_regmap_init()

sprd_clk_regmap_init() doesn't always return success, adding check
for its return value should make the code more strong.

Signed-off-by: Chunyan Zhang <zhang.chunyan@linaro.org>
Reviewed-by: Baolin Wang <baolin.wang@linaro.org>
[sboyd@kernel.org: Add a missing int ret]
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
This commit is contained in:
Chunyan Zhang 2019-05-22 09:15:03 +08:00 committed by Stephen Boyd
parent 78f5296951
commit c974c48dee

View File

@ -2023,6 +2023,7 @@ static int sc9860_clk_probe(struct platform_device *pdev)
{ {
const struct of_device_id *match; const struct of_device_id *match;
const struct sprd_clk_desc *desc; const struct sprd_clk_desc *desc;
int ret;
match = of_match_node(sprd_sc9860_clk_ids, pdev->dev.of_node); match = of_match_node(sprd_sc9860_clk_ids, pdev->dev.of_node);
if (!match) { if (!match) {
@ -2031,7 +2032,9 @@ static int sc9860_clk_probe(struct platform_device *pdev)
} }
desc = match->data; desc = match->data;
sprd_clk_regmap_init(pdev, desc); ret = sprd_clk_regmap_init(pdev, desc);
if (ret)
return ret;
return sprd_clk_probe(&pdev->dev, desc->hw_clks); return sprd_clk_probe(&pdev->dev, desc->hw_clks);
} }