File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
drivers/crypto/hisilicon/trng Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -267,12 +267,12 @@ static int hisi_trng_probe(struct platform_device *pdev)
267267 }
268268
269269 hisi_trng_add_to_list (trng );
270- if (atomic_add_return ( 1 , & trng_active_devs ) == 1 ) {
270+ if (atomic_inc_return ( & trng_active_devs ) == 1 ) {
271271 ret = crypto_register_rng (& hisi_trng_alg );
272272 if (ret ) {
273273 dev_err (& pdev -> dev ,
274274 "failed to register crypto(%d)\n" , ret );
275- atomic_sub_return ( 1 , & trng_active_devs );
275+ atomic_dec_return ( & trng_active_devs );
276276 goto err_remove_from_list ;
277277 }
278278 }
@@ -289,7 +289,7 @@ static int hisi_trng_probe(struct platform_device *pdev)
289289 return ret ;
290290
291291err_crypto_unregister :
292- if (atomic_sub_return ( 1 , & trng_active_devs ) == 0 )
292+ if (atomic_dec_return ( & trng_active_devs ) == 0 )
293293 crypto_unregister_rng (& hisi_trng_alg );
294294
295295err_remove_from_list :
@@ -305,7 +305,7 @@ static int hisi_trng_remove(struct platform_device *pdev)
305305 while (hisi_trng_del_from_list (trng ))
306306 ;
307307
308- if (atomic_sub_return ( 1 , & trng_active_devs ) == 0 )
308+ if (atomic_dec_return ( & trng_active_devs ) == 0 )
309309 crypto_unregister_rng (& hisi_trng_alg );
310310
311311 return 0 ;
You can’t perform that action at this time.
0 commit comments