diff options
author | Geert Uytterhoeven <geert+renesas@glider.be> | 2020-02-11 19:19:02 +0100 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2020-02-22 09:25:43 +0800 |
commit | 2f272ef37c29425a6526fec976cf200dda950ee1 (patch) | |
tree | 3777f5d7b8116f3f1189d054aea7080ad00cdf27 /drivers/crypto/ccree/cc_pm.c | |
parent | fc3b8c11aab728a536b6bb89d6760df9c8694d23 (diff) | |
download | lwn-2f272ef37c29425a6526fec976cf200dda950ee1.tar.gz lwn-2f272ef37c29425a6526fec976cf200dda950ee1.zip |
crypto: ccree - clean up clock handling
Use devm_clk_get_optional() instead of devm_clk_get() and explicit
optional clock handling.
As clk_prepare_enable() and clk_disable_unprepare() handle optional
clocks fine, the cc_clk_on() and cc_clk_off() wrappers can be removed.
While at it, use the new "%pe" format specifier to print error codes.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/ccree/cc_pm.c')
-rw-r--r-- | drivers/crypto/ccree/cc_pm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/crypto/ccree/cc_pm.c b/drivers/crypto/ccree/cc_pm.c index 24c368b866f6..81376173c3ec 100644 --- a/drivers/crypto/ccree/cc_pm.c +++ b/drivers/crypto/ccree/cc_pm.c @@ -26,7 +26,7 @@ int cc_pm_suspend(struct device *dev) dev_dbg(dev, "set HOST_POWER_DOWN_EN\n"); fini_cc_regs(drvdata); cc_iowrite(drvdata, CC_REG(HOST_POWER_DOWN_EN), POWER_DOWN_ENABLE); - cc_clk_off(drvdata); + clk_disable_unprepare(drvdata->clk); return 0; } @@ -37,7 +37,7 @@ int cc_pm_resume(struct device *dev) dev_dbg(dev, "unset HOST_POWER_DOWN_EN\n"); /* Enables the device source clk */ - rc = cc_clk_on(drvdata); + rc = clk_prepare_enable(drvdata->clk); if (rc) { dev_err(dev, "failed getting clock back on. We're toast.\n"); return rc; |