@@ -511,7 +511,7 @@ static int hisi_zip_core_debug_init(struct hisi_zip_ctrl *ctrl)
511
511
struct hisi_qm * qm = & hisi_zip -> qm ;
512
512
struct device * dev = & qm -> pdev -> dev ;
513
513
struct debugfs_regset32 * regset ;
514
- struct dentry * tmp_d , * tmp ;
514
+ struct dentry * tmp_d ;
515
515
char buf [HZIP_BUF_SIZE ];
516
516
int i ;
517
517
@@ -521,10 +521,6 @@ static int hisi_zip_core_debug_init(struct hisi_zip_ctrl *ctrl)
521
521
else
522
522
sprintf (buf , "decomp_core%d" , i - HZIP_COMP_CORE_NUM );
523
523
524
- tmp_d = debugfs_create_dir (buf , ctrl -> debug_root );
525
- if (!tmp_d )
526
- return - ENOENT ;
527
-
528
524
regset = devm_kzalloc (dev , sizeof (* regset ), GFP_KERNEL );
529
525
if (!regset )
530
526
return - ENOENT ;
@@ -533,29 +529,25 @@ static int hisi_zip_core_debug_init(struct hisi_zip_ctrl *ctrl)
533
529
regset -> nregs = ARRAY_SIZE (hzip_dfx_regs );
534
530
regset -> base = qm -> io_base + core_offsets [i ];
535
531
536
- tmp = debugfs_create_regset32 ("regs" , 0444 , tmp_d , regset );
537
- if (!tmp )
538
- return - ENOENT ;
532
+ tmp_d = debugfs_create_dir (buf , ctrl -> debug_root );
533
+ debugfs_create_regset32 ("regs" , 0444 , tmp_d , regset );
539
534
}
540
535
541
536
return 0 ;
542
537
}
543
538
544
539
static int hisi_zip_ctrl_debug_init (struct hisi_zip_ctrl * ctrl )
545
540
{
546
- struct dentry * tmp ;
547
541
int i ;
548
542
549
543
for (i = HZIP_CURRENT_QM ; i < HZIP_DEBUG_FILE_NUM ; i ++ ) {
550
544
spin_lock_init (& ctrl -> files [i ].lock );
551
545
ctrl -> files [i ].ctrl = ctrl ;
552
546
ctrl -> files [i ].index = i ;
553
547
554
- tmp = debugfs_create_file (ctrl_debug_file_name [i ], 0600 ,
555
- ctrl -> debug_root , ctrl -> files + i ,
556
- & ctrl_debug_fops );
557
- if (!tmp )
558
- return - ENOENT ;
548
+ debugfs_create_file (ctrl_debug_file_name [i ], 0600 ,
549
+ ctrl -> debug_root , ctrl -> files + i ,
550
+ & ctrl_debug_fops );
559
551
}
560
552
561
553
return hisi_zip_core_debug_init (ctrl );
@@ -569,8 +561,6 @@ static int hisi_zip_debugfs_init(struct hisi_zip *hisi_zip)
569
561
int ret ;
570
562
571
563
dev_d = debugfs_create_dir (dev_name (dev ), hzip_debugfs_root );
572
- if (!dev_d )
573
- return - ENOENT ;
574
564
575
565
qm -> debug .debug_root = dev_d ;
576
566
ret = hisi_qm_debug_init (qm );
@@ -955,8 +945,6 @@ static void hisi_zip_register_debugfs(void)
955
945
return ;
956
946
957
947
hzip_debugfs_root = debugfs_create_dir ("hisi_zip" , NULL );
958
- if (IS_ERR_OR_NULL (hzip_debugfs_root ))
959
- hzip_debugfs_root = NULL ;
960
948
}
961
949
962
950
static void hisi_zip_unregister_debugfs (void )
0 commit comments