From: Uwe Kleine-König Date: Tue, 5 Jul 2022 20:51:38 +0000 (+0200) Subject: crypto: atmel-aes - Drop if with an always false condition X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=4fdcabb86ab17621b54695e5bb52ceddef434e82;p=linux.git crypto: atmel-aes - Drop if with an always false condition 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 Signed-off-by: Herbert Xu --- diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c index f72c6b3e4ad81..886bf258544c6 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);