@@ -1334,9 +1334,7 @@ static int mv_xor_probe(struct platform_device *pdev)
/* Not all platforms can gate the clock, so it is not
* an error if the clock does not exists.
*/
- xordev->clk = clk_get(&pdev->dev, NULL);
- if (!IS_ERR(xordev->clk))
- clk_prepare_enable(xordev->clk);
+ xordev->clk = devm_clk_get_optional_enabled(&pdev->dev, NULL);
/*
* We don't want to have more than one channel per CPU in
@@ -1425,11 +1423,6 @@ static int mv_xor_probe(struct platform_device *pdev)
irq_dispose_mapping(xordev->channels[i]->irq);
}
- if (!IS_ERR(xordev->clk)) {
- clk_disable_unprepare(xordev->clk);
- clk_put(xordev->clk);
- }
-
return ret;
}
Driver was written before this was available. Simplifies code slightly. Actually also a bugfix. clk_disable_unprepare is missing in _remove, which is also missing. Signed-off-by: Rosen Penev <rosenp@gmail.com> --- drivers/dma/mv_xor.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)