From: Ruan Jinjie Date: Thu, 17 Aug 2023 06:32:19 +0000 (+0800) Subject: ntb: amd: Drop unnecessary error check for debugfs_create_dir X-Git-Tag: v6.6.17~3951^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=28e70ed9d0fab935f78b565d9c026585559b86a4;p=platform%2Fkernel%2Flinux-rpi.git 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 Acked-by: Sanjay R Mehta Signed-off-by: Jon Mason --- diff --git a/drivers/ntb/hw/amd/ntb_hw_amd.c b/drivers/ntb/hw/amd/ntb_hw_amd.c index 4940b63..d687e8c 100644 --- a/drivers/ntb/hw/amd/ntb_hw_amd.c +++ b/drivers/ntb/hw/amd/ntb_hw_amd.c @@ -941,13 +941,10 @@ static void ndev_init_debugfs(struct amd_ntb_dev *ndev) ndev->debugfs_dir = debugfs_create_dir(pci_name(ndev->ntb.pdev), debugfs_dir); - if (IS_ERR(ndev->debugfs_dir)) - ndev->debugfs_info = NULL; - else - ndev->debugfs_info = - debugfs_create_file("info", S_IRUSR, - ndev->debugfs_dir, ndev, - &amd_ntb_debugfs_info); + ndev->debugfs_info = + debugfs_create_file("info", S_IRUSR, + ndev->debugfs_dir, ndev, + &amd_ntb_debugfs_info); } }