Commit b1bdd4f8 authored by Jingoo Han's avatar Jingoo Han Committed by Mark Brown

spi: bcm63xx-hsspi: Use devm_clk_get()

Use devm_clk_get() to make cleanup paths simpler.
Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
Acked-by: default avatarJonas Gorski <jogo@openwrt.org>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 87917528
...@@ -342,16 +342,14 @@ static int bcm63xx_hsspi_probe(struct platform_device *pdev) ...@@ -342,16 +342,14 @@ static int bcm63xx_hsspi_probe(struct platform_device *pdev)
if (IS_ERR(regs)) if (IS_ERR(regs))
return PTR_ERR(regs); return PTR_ERR(regs);
clk = clk_get(dev, "hsspi"); clk = devm_clk_get(dev, "hsspi");
if (IS_ERR(clk)) if (IS_ERR(clk))
return PTR_ERR(clk); return PTR_ERR(clk);
rate = clk_get_rate(clk); rate = clk_get_rate(clk);
if (!rate) { if (!rate)
ret = -EINVAL; return -EINVAL;
goto out_put_clk;
}
clk_prepare_enable(clk); clk_prepare_enable(clk);
...@@ -409,9 +407,6 @@ static int bcm63xx_hsspi_probe(struct platform_device *pdev) ...@@ -409,9 +407,6 @@ static int bcm63xx_hsspi_probe(struct platform_device *pdev)
spi_master_put(master); spi_master_put(master);
out_disable_clk: out_disable_clk:
clk_disable_unprepare(clk); clk_disable_unprepare(clk);
out_put_clk:
clk_put(clk);
return ret; return ret;
} }
...@@ -426,7 +421,6 @@ static int bcm63xx_hsspi_remove(struct platform_device *pdev) ...@@ -426,7 +421,6 @@ static int bcm63xx_hsspi_remove(struct platform_device *pdev)
/* reset the hardware and block queue progress */ /* reset the hardware and block queue progress */
__raw_writel(0, bs->regs + HSSPI_INT_MASK_REG); __raw_writel(0, bs->regs + HSSPI_INT_MASK_REG);
clk_disable_unprepare(bs->clk); clk_disable_unprepare(bs->clk);
clk_put(bs->clk);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment