Message ID | 20220705205144.131702-1-u.kleine-koenig@pengutronix.de (mailing list archive) |
---|---|
State | Accepted |
Delegated to: | Herbert Xu |
Headers | show |
Series | [1/7] crypto: atmel-aes: Drop if with an always false condition | expand |
On Tue, Jul 05, 2022 at 10:51:38PM +0200, Uwe Kleine-König wrote: > The remove callback is only called after probe completed successfully. > In this case platform_set_drvdata() was called with a non-NULL argument > and so aes_dd is never NULL. > > This is a preparation for making platform remove callbacks return void. > > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> > --- > drivers/crypto/atmel-aes.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) All applid. Thanks.
diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c index f72c6b3e4ad8..886bf258544c 100644 --- a/drivers/crypto/atmel-aes.c +++ b/drivers/crypto/atmel-aes.c @@ -2669,8 +2669,7 @@ static int atmel_aes_remove(struct platform_device *pdev) struct atmel_aes_dev *aes_dd; aes_dd = platform_get_drvdata(pdev); - if (!aes_dd) - return -ENODEV; + spin_lock(&atmel_aes.lock); list_del(&aes_dd->list); spin_unlock(&atmel_aes.lock);
The remove callback is only called after probe completed successfully. In this case platform_set_drvdata() was called with a non-NULL argument and so aes_dd is never NULL. This is a preparation for making platform remove callbacks return void. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> --- drivers/crypto/atmel-aes.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) base-commit: f2906aa863381afb0015a9eb7fefad885d4e5a56