Skip to content

Commit 67826db

Browse files
Zhen Leikuba-moo
authored andcommitted
bna: Remove field bnad_dentry_files[] in struct bnad
Function debugfs_remove() recursively removes a directory, include all files created by debugfs_create_file(). Therefore, there is no need to explicitly record each file with member ->bnad_dentry_files[] and explicitly delete them at the end. Remove field bnad_dentry_files[] and its related processing codes for simplification. Signed-off-by: Zhen Lei <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent bf8207e commit 67826db

File tree

2 files changed

+5
-16
lines changed

2 files changed

+5
-16
lines changed

drivers/net/ethernet/brocade/bna/bnad.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,6 @@ struct bnad {
351351
/* debugfs specific data */
352352
char *regdata;
353353
u32 reglen;
354-
struct dentry *bnad_dentry_files[5];
355354
struct dentry *port_debugfs_root;
356355
};
357356

drivers/net/ethernet/brocade/bna/bnad_debugfs.c

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -512,12 +512,11 @@ bnad_debugfs_init(struct bnad *bnad)
512512

513513
for (i = 0; i < ARRAY_SIZE(bnad_debugfs_files); i++) {
514514
file = &bnad_debugfs_files[i];
515-
bnad->bnad_dentry_files[i] =
516-
debugfs_create_file(file->name,
517-
file->mode,
518-
bnad->port_debugfs_root,
519-
bnad,
520-
file->fops);
515+
debugfs_create_file(file->name,
516+
file->mode,
517+
bnad->port_debugfs_root,
518+
bnad,
519+
file->fops);
521520
}
522521
}
523522
}
@@ -526,15 +525,6 @@ bnad_debugfs_init(struct bnad *bnad)
526525
void
527526
bnad_debugfs_uninit(struct bnad *bnad)
528527
{
529-
int i;
530-
531-
for (i = 0; i < ARRAY_SIZE(bnad_debugfs_files); i++) {
532-
if (bnad->bnad_dentry_files[i]) {
533-
debugfs_remove(bnad->bnad_dentry_files[i]);
534-
bnad->bnad_dentry_files[i] = NULL;
535-
}
536-
}
537-
538528
/* Remove the pci_dev debugfs directory for the port */
539529
if (bnad->port_debugfs_root) {
540530
debugfs_remove(bnad->port_debugfs_root);

0 commit comments

Comments
 (0)