diff mbox series

[7/7] crypto: s5p-sss: Drop if with an always false condition

Message ID 20220705205144.131702-7-u.kleine-koenig@pengutronix.de
State New
Headers show
Series None | expand

Commit Message

Uwe Kleine-König July 5, 2022, 8:51 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 pdata 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/s5p-sss.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Vladimir Zapolskiy July 5, 2022, 9:47 p.m. UTC | #1
On 7/5/22 23:51, 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 pdata 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/s5p-sss.c | 3 ---
>   1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/crypto/s5p-sss.c b/drivers/crypto/s5p-sss.c
> index 7717e9e5977b..b79e49aa724f 100644
> --- a/drivers/crypto/s5p-sss.c
> +++ b/drivers/crypto/s5p-sss.c
> @@ -2321,9 +2321,6 @@ static int s5p_aes_remove(struct platform_device *pdev)
>   	struct s5p_aes_dev *pdata = platform_get_drvdata(pdev);
>   	int i;
>   
> -	if (!pdata)
> -		return -ENODEV;
> -
>   	for (i = 0; i < ARRAY_SIZE(algs); i++)
>   		crypto_unregister_skcipher(&algs[i]);
>   

Acked-by: Vladimir Zapolskiy <vz@mleia.com>

--
Best wishes,
Vladimir
Krzysztof Kozlowski July 6, 2022, 6:34 a.m. UTC | #2
On 05/07/2022 22:51, 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 pdata 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>
> ---


Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>


Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/drivers/crypto/s5p-sss.c b/drivers/crypto/s5p-sss.c
index 7717e9e5977b..b79e49aa724f 100644
--- a/drivers/crypto/s5p-sss.c
+++ b/drivers/crypto/s5p-sss.c
@@ -2321,9 +2321,6 @@  static int s5p_aes_remove(struct platform_device *pdev)
 	struct s5p_aes_dev *pdata = platform_get_drvdata(pdev);
 	int i;
 
-	if (!pdata)
-		return -ENODEV;
-
 	for (i = 0; i < ARRAY_SIZE(algs); i++)
 		crypto_unregister_skcipher(&algs[i]);