• Uwe Kleine-König's avatar
    crypto: caam/jr - Convert to platform remove callback returning void · 304a2efe
    Uwe Kleine-König authored
    The .remove() callback for a platform driver returns an int which makes
    many driver authors wrongly assume it's possible to do error handling by
    returning an error code. However the value returned is (mostly) ignored
    and this typically results in resource leaks. To improve here there is a
    quest to make the remove callback return void. In the first step of this
    quest all drivers are converted to .remove_new() which already returns
    void.
    
    The driver adapted here suffers from this wrong assumption. Returning
    -EBUSY if there are still users results in resource leaks and probably a
    crash. Also further down passing the error code of caam_jr_shutdown() to
    the caller only results in another error message and has no further
    consequences compared to returning zero.
    
    Still convert the driver to return no value in the remove callback. This
    also allows to drop caam_jr_platform_shutdown() as the only function
    called by it now has the same prototype.
    Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    304a2efe
jr.c 21.6 KB