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)
267
267
}
268
268
269
269
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 ) {
271
271
ret = crypto_register_rng (& hisi_trng_alg );
272
272
if (ret ) {
273
273
dev_err (& pdev -> dev ,
274
274
"failed to register crypto(%d)\n" , ret );
275
- atomic_sub_return ( 1 , & trng_active_devs );
275
+ atomic_dec_return ( & trng_active_devs );
276
276
goto err_remove_from_list ;
277
277
}
278
278
}
@@ -289,7 +289,7 @@ static int hisi_trng_probe(struct platform_device *pdev)
289
289
return ret ;
290
290
291
291
err_crypto_unregister :
292
- if (atomic_sub_return ( 1 , & trng_active_devs ) == 0 )
292
+ if (atomic_dec_return ( & trng_active_devs ) == 0 )
293
293
crypto_unregister_rng (& hisi_trng_alg );
294
294
295
295
err_remove_from_list :
@@ -305,7 +305,7 @@ static int hisi_trng_remove(struct platform_device *pdev)
305
305
while (hisi_trng_del_from_list (trng ))
306
306
;
307
307
308
- if (atomic_sub_return ( 1 , & trng_active_devs ) == 0 )
308
+ if (atomic_dec_return ( & trng_active_devs ) == 0 )
309
309
crypto_unregister_rng (& hisi_trng_alg );
310
310
311
311
return 0 ;
You can’t perform that action at this time.
0 commit comments