OSDN Git Service

crypto: ccree - simplify Runtime PM handling
authorGeert Uytterhoeven <geert+renesas@glider.be>
Tue, 11 Feb 2020 18:19:08 +0000 (19:19 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sat, 22 Feb 2020 01:25:44 +0000 (09:25 +0800)
commit8c7849a30255cfd9a9ba412b1517e20a8572448b
tree26dc1058b4bb604002ca761bcbfd6d208f3402a2
parent1a895f1d5bceee0c6b66dcfdabcc9804006ca229
crypto: ccree - simplify Runtime PM handling

Currently, a large part of the probe function runs before Runtime PM is
enabled.  As the driver manages the device's clock manually, this may
work fine on some systems, but may break on platforms with a more
complex power hierarchy.

Fix this by moving the initialization of Runtime PM before the first
register access (in cc_wait_for_reset_completion()), and putting the
device to sleep only after the last access (in cc_set_ree_fips_status()).

This allows to remove the pm_on flag, which was used to track manually
if Runtime PM had been enabled or not.
Remove the cc_pm_{init,go,fini}() wrappers, as they are called only
once, and obscure operation.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/ccree/cc_driver.c
drivers/crypto/ccree/cc_driver.h
drivers/crypto/ccree/cc_pm.c
drivers/crypto/ccree/cc_pm.h