hwrng: omap - Remove useless test before clk_disable_unprepare
authorGregory CLEMENT <gregory.clement@bootlin.com>
Wed, 28 Feb 2018 14:27:22 +0000 (15:27 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 9 Mar 2018 14:45:40 +0000 (22:45 +0800)
clk_disable_unprepare() already checks that the clock pointer is valid.
No need to test it before calling it.

Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/char/hw_random/omap-rng.c

index 74d11ae6abe9a675992f45a3af1fe4cc12e0328b..159d4a1347b8f97eb8e576a67605ecb69089f275 100644 (file)
@@ -499,8 +499,7 @@ err_register:
        pm_runtime_put_sync(&pdev->dev);
        pm_runtime_disable(&pdev->dev);
 
-       if (!IS_ERR(priv->clk))
-               clk_disable_unprepare(priv->clk);
+       clk_disable_unprepare(priv->clk);
 err_ioremap:
        dev_err(dev, "initialization failed.\n");
        return ret;
@@ -517,8 +516,7 @@ static int omap_rng_remove(struct platform_device *pdev)
        pm_runtime_put_sync(&pdev->dev);
        pm_runtime_disable(&pdev->dev);
 
-       if (!IS_ERR(priv->clk))
-               clk_disable_unprepare(priv->clk);
+       clk_disable_unprepare(priv->clk);
 
        return 0;
 }