Skip to content

Commit 28e70ed

Browse files
Ruan Jinjiejonmason
authored andcommitted
ntb: amd: Drop unnecessary error check for debugfs_create_dir
This patch removes the error checking for debugfs_create_dir in ntb_hw_amd.c. This is because the DebugFS kernel API is developed in a way that the caller can safely ignore the errors that occur during the creation of DebugFS nodes. The debugfs APIs have a IS_ERR() judge in start_creating() which can handle it gracefully. so these checks are unnecessary. Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com> Acked-by: Sanjay R Mehta <sanju.mehta@amd.com> Signed-off-by: Jon Mason <jdmason@kudzu.us>
1 parent 03c9e6f commit 28e70ed

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

drivers/ntb/hw/amd/ntb_hw_amd.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -941,13 +941,10 @@ static void ndev_init_debugfs(struct amd_ntb_dev *ndev)
941941
ndev->debugfs_dir =
942942
debugfs_create_dir(pci_name(ndev->ntb.pdev),
943943
debugfs_dir);
944-
if (IS_ERR(ndev->debugfs_dir))
945-
ndev->debugfs_info = NULL;
946-
else
947-
ndev->debugfs_info =
948-
debugfs_create_file("info", S_IRUSR,
949-
ndev->debugfs_dir, ndev,
950-
&amd_ntb_debugfs_info);
944+
ndev->debugfs_info =
945+
debugfs_create_file("info", S_IRUSR,
946+
ndev->debugfs_dir, ndev,
947+
&amd_ntb_debugfs_info);
951948
}
952949
}
953950

0 commit comments

Comments
 (0)