iwlwifi: mvm: no need to check return value of debugfs_create functions
[muen/linux.git] / drivers / net / wireless / intel / iwlwifi / mvm / debugfs.c
index 776b24f..d4ff6b4 100644 (file)
@@ -1349,7 +1349,7 @@ static ssize_t iwl_dbgfs_fw_dbg_collect_write(struct iwl_mvm *mvm,
                return 0;
 
        iwl_fw_dbg_collect(&mvm->fwrt, FW_DBG_TRIGGER_USER, buf,
-                          (count - 1));
+                          (count - 1), NULL);
 
        iwl_mvm_unref(mvm, IWL_MVM_REF_PRPH_WRITE);
 
@@ -1696,9 +1696,8 @@ static ssize_t iwl_dbgfs_d0i3_refs_write(struct iwl_mvm *mvm, char *buf,
 #define MVM_DEBUGFS_READ_WRITE_FILE_OPS(name, bufsz) \
        _MVM_DEBUGFS_READ_WRITE_FILE_OPS(name, bufsz, struct iwl_mvm)
 #define MVM_DEBUGFS_ADD_FILE_ALIAS(alias, name, parent, mode) do {     \
-               if (!debugfs_create_file(alias, mode, parent, mvm,      \
-                                        &iwl_dbgfs_##name##_ops))      \
-                       goto err;                                       \
+               debugfs_create_file(alias, mode, parent, mvm,           \
+                                   &iwl_dbgfs_##name##_ops);           \
        } while (0)
 #define MVM_DEBUGFS_ADD_FILE(name, parent, mode) \
        MVM_DEBUGFS_ADD_FILE_ALIAS(#name, name, parent, mode)
@@ -1709,9 +1708,8 @@ static ssize_t iwl_dbgfs_d0i3_refs_write(struct iwl_mvm *mvm, char *buf,
        _MVM_DEBUGFS_READ_WRITE_FILE_OPS(name, bufsz, struct ieee80211_sta)
 
 #define MVM_DEBUGFS_ADD_STA_FILE_ALIAS(alias, name, parent, mode) do { \
-               if (!debugfs_create_file(alias, mode, parent, sta,      \
-                                        &iwl_dbgfs_##name##_ops))      \
-                       goto err;                                       \
+               debugfs_create_file(alias, mode, parent, sta,           \
+                                   &iwl_dbgfs_##name##_ops);           \
        } while (0)
 #define MVM_DEBUGFS_ADD_STA_FILE(name, parent, mode) \
        MVM_DEBUGFS_ADD_STA_FILE_ALIAS(#name, name, parent, mode)
@@ -2092,13 +2090,9 @@ void iwl_mvm_sta_add_debugfs(struct ieee80211_hw *hw,
 
        if (iwl_mvm_has_tlc_offload(mvm))
                MVM_DEBUGFS_ADD_STA_FILE(rs_data, dir, 0400);
-
-       return;
-err:
-       IWL_ERR(mvm, "Can't create the mvm station debugfs entry\n");
 }
 
-int iwl_mvm_dbgfs_register(struct iwl_mvm *mvm, struct dentry *dbgfs_dir)
+void iwl_mvm_dbgfs_register(struct iwl_mvm *mvm, struct dentry *dbgfs_dir)
 {
        struct dentry *bcast_dir __maybe_unused;
        char buf[100];
@@ -2142,14 +2136,10 @@ int iwl_mvm_dbgfs_register(struct iwl_mvm *mvm, struct dentry *dbgfs_dir)
 #endif
        MVM_DEBUGFS_ADD_FILE(he_sniffer_params, mvm->debugfs_dir, 0600);
 
-       if (!debugfs_create_bool("enable_scan_iteration_notif",
-                                0600,
-                                mvm->debugfs_dir,
-                                &mvm->scan_iter_notif_enabled))
-               goto err;
-       if (!debugfs_create_bool("drop_bcn_ap_mode", 0600,
-                                mvm->debugfs_dir, &mvm->drop_bcn_ap_mode))
-               goto err;
+       debugfs_create_bool("enable_scan_iteration_notif", 0600,
+                           mvm->debugfs_dir, &mvm->scan_iter_notif_enabled);
+       debugfs_create_bool("drop_bcn_ap_mode", 0600, mvm->debugfs_dir,
+                           &mvm->drop_bcn_ap_mode);
 
        MVM_DEBUGFS_ADD_FILE(uapsd_noagg_bssids, mvm->debugfs_dir, S_IRUSR);
 
@@ -2157,13 +2147,9 @@ int iwl_mvm_dbgfs_register(struct iwl_mvm *mvm, struct dentry *dbgfs_dir)
        if (mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_BCAST_FILTERING) {
                bcast_dir = debugfs_create_dir("bcast_filtering",
                                               mvm->debugfs_dir);
-               if (!bcast_dir)
-                       goto err;
 
-               if (!debugfs_create_bool("override", 0600,
-                                        bcast_dir,
-                                        &mvm->dbgfs_bcast_filtering.override))
-                       goto err;
+               debugfs_create_bool("override", 0600, bcast_dir,
+                                   &mvm->dbgfs_bcast_filtering.override);
 
                MVM_DEBUGFS_ADD_FILE_ALIAS("filters", bcast_filters,
                                           bcast_dir, 0600);
@@ -2175,35 +2161,26 @@ int iwl_mvm_dbgfs_register(struct iwl_mvm *mvm, struct dentry *dbgfs_dir)
 #ifdef CONFIG_PM_SLEEP
        MVM_DEBUGFS_ADD_FILE(d3_sram, mvm->debugfs_dir, 0600);
        MVM_DEBUGFS_ADD_FILE(d3_test, mvm->debugfs_dir, 0400);
-       if (!debugfs_create_bool("d3_wake_sysassert", 0600,
-                                mvm->debugfs_dir, &mvm->d3_wake_sysassert))
-               goto err;
-       if (!debugfs_create_u32("last_netdetect_scans", 0400,
-                               mvm->debugfs_dir, &mvm->last_netdetect_scans))
-               goto err;
+       debugfs_create_bool("d3_wake_sysassert", 0600, mvm->debugfs_dir,
+                           &mvm->d3_wake_sysassert);
+       debugfs_create_u32("last_netdetect_scans", 0400, mvm->debugfs_dir,
+                          &mvm->last_netdetect_scans);
 #endif
 
-       if (!debugfs_create_u8("ps_disabled", 0400,
-                              mvm->debugfs_dir, &mvm->ps_disabled))
-               goto err;
-       if (!debugfs_create_blob("nvm_hw", 0400,
-                                mvm->debugfs_dir, &mvm->nvm_hw_blob))
-               goto err;
-       if (!debugfs_create_blob("nvm_sw", 0400,
-                                mvm->debugfs_dir, &mvm->nvm_sw_blob))
-               goto err;
-       if (!debugfs_create_blob("nvm_calib", 0400,
-                                mvm->debugfs_dir, &mvm->nvm_calib_blob))
-               goto err;
-       if (!debugfs_create_blob("nvm_prod", 0400,
-                                mvm->debugfs_dir, &mvm->nvm_prod_blob))
-               goto err;
-       if (!debugfs_create_blob("nvm_phy_sku", 0400,
-                                mvm->debugfs_dir, &mvm->nvm_phy_sku_blob))
-               goto err;
-       if (!debugfs_create_blob("nvm_reg", S_IRUSR,
-                                mvm->debugfs_dir, &mvm->nvm_reg_blob))
-               goto err;
+       debugfs_create_u8("ps_disabled", 0400, mvm->debugfs_dir,
+                         &mvm->ps_disabled);
+       debugfs_create_blob("nvm_hw", 0400, mvm->debugfs_dir,
+                           &mvm->nvm_hw_blob);
+       debugfs_create_blob("nvm_sw", 0400, mvm->debugfs_dir,
+                           &mvm->nvm_sw_blob);
+       debugfs_create_blob("nvm_calib", 0400, mvm->debugfs_dir,
+                           &mvm->nvm_calib_blob);
+       debugfs_create_blob("nvm_prod", 0400, mvm->debugfs_dir,
+                           &mvm->nvm_prod_blob);
+       debugfs_create_blob("nvm_phy_sku", 0400, mvm->debugfs_dir,
+                           &mvm->nvm_phy_sku_blob);
+       debugfs_create_blob("nvm_reg", S_IRUSR,
+                           mvm->debugfs_dir, &mvm->nvm_reg_blob);
 
        debugfs_create_file("mem", 0600, dbgfs_dir, mvm, &iwl_dbgfs_mem_ops);
 
@@ -2212,11 +2189,5 @@ int iwl_mvm_dbgfs_register(struct iwl_mvm *mvm, struct dentry *dbgfs_dir)
         * exists (before the opmode exists which removes the target.)
         */
        snprintf(buf, 100, "../../%pd2", dbgfs_dir->d_parent);
-       if (!debugfs_create_symlink("iwlwifi", mvm->hw->wiphy->debugfsdir, buf))
-               goto err;
-
-       return 0;
-err:
-       IWL_ERR(mvm, "Can't create the mvm debugfs directory\n");
-       return -ENOMEM;
+       debugfs_create_symlink("iwlwifi", mvm->hw->wiphy->debugfsdir, buf);
 }