• Andrey Smirnov's avatar
    crypto: caam - drop global context pointer and init_done · 1517f63c
    Andrey Smirnov authored
    Leverage devres to get rid of code storing global context as well as
    init_done flag.
    
    Original code also has a circular deallocation dependency where
    unregister_algs() -> caam_rng_exit() -> caam_jr_free() chain would
    only happen if all of JRs were freed. Fix this by moving
    caam_rng_exit() outside of unregister_algs() and doing it specifically
    for JR that instantiated HWRNG.
    Signed-off-by: default avatarAndrey Smirnov <andrew.smirnov@gmail.com>
    Cc: Chris Healy <cphealy@gmail.com>
    Cc: Lucas Stach <l.stach@pengutronix.de>
    Cc: Horia Geantă <horia.geanta@nxp.com>
    Cc: Herbert Xu <herbert@gondor.apana.org.au>
    Cc: Iuliana Prodan <iuliana.prodan@nxp.com>
    Cc: linux-crypto@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-imx@nxp.com
    Reviewed-by: default avatarHoria Geantă <horia.geanta@nxp.com>
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    1517f63c
intern.h 5.67 KB