Driver ath11k can work fine even if the debugfs files fail to be created. Therefore, the return value check of debugfs_create_file() should be ignored, as it says. Suggested-by: Jeff Johnson <quic_jjohnson@xxxxxxxxxxx> Signed-off-by: Zhen Lei <thunder.leizhen@xxxxxxxxxx> --- drivers/net/wireless/ath/ath11k/spectral.c | 24 ---------------------- 1 file changed, 24 deletions(-) v1 --> v2: Remove error checking for debugfs_create_file() instead of fixing it. diff --git a/drivers/net/wireless/ath/ath11k/spectral.c b/drivers/net/wireless/ath/ath11k/spectral.c index 79e091134515b43..a6426eda023a944 100644 --- a/drivers/net/wireless/ath/ath11k/spectral.c +++ b/drivers/net/wireless/ath/ath11k/spectral.c @@ -925,8 +925,6 @@ void ath11k_spectral_deinit(struct ath11k_base *ab) static inline int ath11k_spectral_debug_register(struct ath11k *ar) { - int ret; - ar->spectral.rfs_scan = relay_open("spectral_scan", ar->debug.debugfs_pdev, ATH11K_SPECTRAL_SUB_BUFF_SIZE(ar->ab), @@ -942,40 +940,18 @@ static inline int ath11k_spectral_debug_register(struct ath11k *ar) 0600, ar->debug.debugfs_pdev, ar, &fops_scan_ctl); - if (!ar->spectral.scan_ctl) { - ath11k_warn(ar->ab, "failed to open debugfs in pdev %d\n", - ar->pdev_idx); - ret = -EINVAL; - goto debug_unregister; - } ar->spectral.scan_count = debugfs_create_file("spectral_count", 0600, ar->debug.debugfs_pdev, ar, &fops_scan_count); - if (!ar->spectral.scan_count) { - ath11k_warn(ar->ab, "failed to open debugfs in pdev %d\n", - ar->pdev_idx); - ret = -EINVAL; - goto debug_unregister; - } ar->spectral.scan_bins = debugfs_create_file("spectral_bins", 0600, ar->debug.debugfs_pdev, ar, &fops_scan_bins); - if (!ar->spectral.scan_bins) { - ath11k_warn(ar->ab, "failed to open debugfs in pdev %d\n", - ar->pdev_idx); - ret = -EINVAL; - goto debug_unregister; - } return 0; - -debug_unregister: - ath11k_spectral_debug_unregister(ar); - return ret; } int ath11k_spectral_init(struct ath11k_base *ab) -- 2.34.1