crypto: inside-secure - fix clock management
authorGregory CLEMENT <gregory.clement@bootlin.com>
Tue, 13 Mar 2018 16:48:40 +0000 (17:48 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 23 Mar 2018 15:39:58 +0000 (23:39 +0800)
In this driver the clock is got but never put when the driver is removed
or if there is an error in the probe.

Using the managed version of clk_get() allows to let the kernel take care
of it.

Fixes: 1b44c5a60c13 ("crypto: inside-secure - add SafeXcel EIP197 crypto
engine driver")
cc: stable@vger.kernel.org
Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/inside-secure/safexcel.c

index 384b4ceb37f0e2ffe07229462641fd9e7757d8d0..09adeaa0da6be010e2c27a9aa64d4323fdf4b7c5 100644 (file)
@@ -881,7 +881,7 @@ static int safexcel_probe(struct platform_device *pdev)
                return PTR_ERR(priv->base);
        }
 
-       priv->clk = of_clk_get(dev->of_node, 0);
+       priv->clk = devm_clk_get(&pdev->dev, NULL);
        if (!IS_ERR(priv->clk)) {
                ret = clk_prepare_enable(priv->clk);
                if (ret) {