Skip to content

Commit

Permalink
crypto: caam - check caam_emi_slow instead of re-lookup platform
Browse files Browse the repository at this point in the history
Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
Marcus Folkesson authored and Herbert Xu committed Dec 7, 2016
1 parent 5937d81 commit b80609a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/crypto/caam/ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ static int caam_remove(struct platform_device *pdev)
clk_disable_unprepare(ctrlpriv->caam_ipg);
clk_disable_unprepare(ctrlpriv->caam_mem);
clk_disable_unprepare(ctrlpriv->caam_aclk);
if (!of_machine_is_compatible("fsl,imx6ul"))
if (ctrlpriv->caam_emi_slow)
clk_disable_unprepare(ctrlpriv->caam_emi_slow);
return 0;
}
Expand Down Expand Up @@ -506,7 +506,7 @@ static int caam_probe(struct platform_device *pdev)
goto disable_caam_mem;
}

if (!of_machine_is_compatible("fsl,imx6ul")) {
if (ctrlpriv->caam_emi_slow) {
ret = clk_prepare_enable(ctrlpriv->caam_emi_slow);
if (ret < 0) {
dev_err(&pdev->dev, "can't enable CAAM emi slow clock: %d\n",
Expand Down Expand Up @@ -830,7 +830,7 @@ static int caam_probe(struct platform_device *pdev)
iounmap_ctrl:
iounmap(ctrl);
disable_caam_emi_slow:
if (!of_machine_is_compatible("fsl,imx6ul"))
if (ctrlpriv->caam_emi_slow)
clk_disable_unprepare(ctrlpriv->caam_emi_slow);
disable_caam_aclk:
clk_disable_unprepare(ctrlpriv->caam_aclk);
Expand Down

0 comments on commit b80609a

Please sign in to comment.