}
void ice_debugfs_fwlog_init(struct ice_pf *pf);
+int ice_debugfs_pf_init(struct ice_pf *pf);
void ice_debugfs_pf_deinit(struct ice_pf *pf);
void ice_debugfs_init(void);
void ice_debugfs_exit(void);
.send_cmd = __fwlog_send_cmd,
.priv = hw,
};
+ int err;
+
+ err = ice_debugfs_pf_init(pf);
+ if (err)
+ return err;
return ice_fwlog_init(hw, &hw->fwlog, &api);
}
return status;
}
+static void __fwlog_deinit(struct ice_hw *hw)
+{
+ ice_debugfs_pf_deinit(hw->back);
+ ice_fwlog_deinit(hw, &hw->fwlog);
+}
+
/**
* ice_deinit_hw - unroll initialization operations done by ice_init_hw
* @hw: pointer to the hardware structure
ice_free_seg(hw);
ice_free_hw_tbls(hw);
mutex_destroy(&hw->tnl_lock);
-
- ice_fwlog_deinit(hw, &hw->fwlog);
+ __fwlog_deinit(hw);
ice_destroy_all_ctrlq(hw);
/* Clear VSI contexts if not already cleared */
*/
void ice_debugfs_fwlog_init(struct ice_pf *pf)
{
- const char *name = pci_name(pf->pdev);
struct dentry *fw_modules_dir;
struct dentry **fw_modules;
int i;
if (!fw_modules)
return;
- pf->ice_debugfs_pf = debugfs_create_dir(name, ice_debugfs_root);
- if (IS_ERR(pf->ice_debugfs_pf))
- goto err_create_module_files;
-
pf->ice_debugfs_pf_fwlog = debugfs_create_dir("fwlog",
pf->ice_debugfs_pf);
if (IS_ERR(pf->ice_debugfs_pf_fwlog))
kfree(fw_modules);
}
+int ice_debugfs_pf_init(struct ice_pf *pf)
+{
+ const char *name = pci_name(pf->pdev);
+
+ pf->ice_debugfs_pf = debugfs_create_dir(name, ice_debugfs_root);
+ if (IS_ERR(pf->ice_debugfs_pf))
+ return PTR_ERR(pf->ice_debugfs_pf);
+
+ return 0;
+}
+
/**
* ice_debugfs_pf_deinit - cleanup PF's debugfs
* @pf: pointer to the PF struct
if (hw->bus.func)
return;
- ice_debugfs_pf_deinit(hw->back);
-
/* make sure FW logging is disabled to not put the FW in a weird state
* for the next driver load
*/