diff mbox series

crypto: keembay-ocs-ecc: Drop if with an always false condition

Message ID 20220714212820.59237-1-u.kleine-koenig@pengutronix.de (mailing list archive)
State Accepted
Delegated to: Herbert Xu
Headers show
Series crypto: keembay-ocs-ecc: Drop if with an always false condition | expand

Commit Message

Uwe Kleine-König July 14, 2022, 9:28 p.m. UTC
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 ecc_dev 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/keembay/keembay-ocs-ecc.c | 2 --
 1 file changed, 2 deletions(-)


base-commit: f2906aa863381afb0015a9eb7fefad885d4e5a56

Comments

Herbert Xu July 22, 2022, 8:44 a.m. UTC | #1
On Thu, Jul 14, 2022 at 11:28:20PM +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 ecc_dev 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/keembay/keembay-ocs-ecc.c | 2 --
>  1 file changed, 2 deletions(-)

Patch applied.  Thanks.
diff mbox series

Patch

diff --git a/drivers/crypto/keembay/keembay-ocs-ecc.c b/drivers/crypto/keembay/keembay-ocs-ecc.c
index 5d0785d3f1b5..2269df17514c 100644
--- a/drivers/crypto/keembay/keembay-ocs-ecc.c
+++ b/drivers/crypto/keembay/keembay-ocs-ecc.c
@@ -976,8 +976,6 @@  static int kmb_ocs_ecc_remove(struct platform_device *pdev)
 	struct ocs_ecc_dev *ecc_dev;
 
 	ecc_dev = platform_get_drvdata(pdev);
-	if (!ecc_dev)
-		return -ENODEV;
 
 	crypto_unregister_kpp(&ocs_ecdh_p384);
 	crypto_unregister_kpp(&ocs_ecdh_p256);