Commit a8ff38bd authored by Weili Qian's avatar Weili Qian Committed by Herbert Xu

crypto: hisilicon/qm - modify the return type of debugfs interface

Since 'qm_create_debugfs_file' always returns 0, change it as 'void'.
Signed-off-by: default avatarWeili Qian <qianweili@huawei.com>
Reviewed-by: default avatarZhou Wang <wangzhou1@hisilicon.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent e926d753
...@@ -705,9 +705,7 @@ static int hpre_debugfs_init(struct hisi_qm *qm) ...@@ -705,9 +705,7 @@ static int hpre_debugfs_init(struct hisi_qm *qm)
qm->debug.sqe_mask_offset = HPRE_SQE_MASK_OFFSET; qm->debug.sqe_mask_offset = HPRE_SQE_MASK_OFFSET;
qm->debug.sqe_mask_len = HPRE_SQE_MASK_LEN; qm->debug.sqe_mask_len = HPRE_SQE_MASK_LEN;
ret = hisi_qm_debug_init(qm); hisi_qm_debug_init(qm);
if (ret)
goto failed_to_create;
if (qm->pdev->device == HPRE_PCI_DEVICE_ID) { if (qm->pdev->device == HPRE_PCI_DEVICE_ID) {
ret = hpre_ctrl_debug_init(qm); ret = hpre_ctrl_debug_init(qm);
......
...@@ -1520,7 +1520,7 @@ static const struct file_operations qm_cmd_fops = { ...@@ -1520,7 +1520,7 @@ static const struct file_operations qm_cmd_fops = {
.write = qm_cmd_write, .write = qm_cmd_write,
}; };
static int qm_create_debugfs_file(struct hisi_qm *qm, enum qm_debug_file index) static void qm_create_debugfs_file(struct hisi_qm *qm, enum qm_debug_file index)
{ {
struct dentry *qm_d = qm->debug.qm_d; struct dentry *qm_d = qm->debug.qm_d;
struct debugfs_file *file = qm->debug.files + index; struct debugfs_file *file = qm->debug.files + index;
...@@ -1531,8 +1531,6 @@ static int qm_create_debugfs_file(struct hisi_qm *qm, enum qm_debug_file index) ...@@ -1531,8 +1531,6 @@ static int qm_create_debugfs_file(struct hisi_qm *qm, enum qm_debug_file index)
file->index = index; file->index = index;
mutex_init(&file->lock); mutex_init(&file->lock);
file->debug = &qm->debug; file->debug = &qm->debug;
return 0;
} }
static void qm_hw_error_init_v1(struct hisi_qm *qm, u32 ce, u32 nfe, u32 fe) static void qm_hw_error_init_v1(struct hisi_qm *qm, u32 ce, u32 nfe, u32 fe)
...@@ -2824,12 +2822,12 @@ DEFINE_DEBUGFS_ATTRIBUTE(qm_atomic64_ops, qm_debugfs_atomic64_get, ...@@ -2824,12 +2822,12 @@ DEFINE_DEBUGFS_ATTRIBUTE(qm_atomic64_ops, qm_debugfs_atomic64_get,
* *
* Create qm related debugfs files. * Create qm related debugfs files.
*/ */
int hisi_qm_debug_init(struct hisi_qm *qm) void hisi_qm_debug_init(struct hisi_qm *qm)
{ {
struct qm_dfx *dfx = &qm->debug.dfx; struct qm_dfx *dfx = &qm->debug.dfx;
struct dentry *qm_d; struct dentry *qm_d;
void *data; void *data;
int i, ret; int i;
qm_d = debugfs_create_dir("qm", qm->debug.debug_root); qm_d = debugfs_create_dir("qm", qm->debug.debug_root);
qm->debug.qm_d = qm_d; qm->debug.qm_d = qm_d;
...@@ -2837,10 +2835,7 @@ int hisi_qm_debug_init(struct hisi_qm *qm) ...@@ -2837,10 +2835,7 @@ int hisi_qm_debug_init(struct hisi_qm *qm)
/* only show this in PF */ /* only show this in PF */
if (qm->fun_type == QM_HW_PF) if (qm->fun_type == QM_HW_PF)
for (i = CURRENT_Q; i < DEBUG_FILE_NUM; i++) for (i = CURRENT_Q; i < DEBUG_FILE_NUM; i++)
if (qm_create_debugfs_file(qm, i)) { qm_create_debugfs_file(qm, i);
ret = -ENOENT;
goto failed_to_create;
}
debugfs_create_file("regs", 0444, qm->debug.qm_d, qm, &qm_regs_fops); debugfs_create_file("regs", 0444, qm->debug.qm_d, qm, &qm_regs_fops);
...@@ -2856,12 +2851,6 @@ int hisi_qm_debug_init(struct hisi_qm *qm) ...@@ -2856,12 +2851,6 @@ int hisi_qm_debug_init(struct hisi_qm *qm)
data, data,
&qm_atomic64_ops); &qm_atomic64_ops);
} }
return 0;
failed_to_create:
debugfs_remove_recursive(qm_d);
return ret;
} }
EXPORT_SYMBOL_GPL(hisi_qm_debug_init); EXPORT_SYMBOL_GPL(hisi_qm_debug_init);
......
...@@ -350,7 +350,7 @@ void hisi_qm_release_qp(struct hisi_qp *qp); ...@@ -350,7 +350,7 @@ void hisi_qm_release_qp(struct hisi_qp *qp);
int hisi_qp_send(struct hisi_qp *qp, const void *msg); int hisi_qp_send(struct hisi_qp *qp, const void *msg);
int hisi_qm_get_free_qp_num(struct hisi_qm *qm); int hisi_qm_get_free_qp_num(struct hisi_qm *qm);
int hisi_qm_get_vft(struct hisi_qm *qm, u32 *base, u32 *number); int hisi_qm_get_vft(struct hisi_qm *qm, u32 *base, u32 *number);
int hisi_qm_debug_init(struct hisi_qm *qm); void hisi_qm_debug_init(struct hisi_qm *qm);
enum qm_hw_ver hisi_qm_get_hw_version(struct pci_dev *pdev); enum qm_hw_ver hisi_qm_get_hw_version(struct pci_dev *pdev);
void hisi_qm_debug_regs_clear(struct hisi_qm *qm); void hisi_qm_debug_regs_clear(struct hisi_qm *qm);
int hisi_qm_sriov_enable(struct pci_dev *pdev, int max_vfs); int hisi_qm_sriov_enable(struct pci_dev *pdev, int max_vfs);
......
...@@ -652,9 +652,7 @@ static int sec_debugfs_init(struct hisi_qm *qm) ...@@ -652,9 +652,7 @@ static int sec_debugfs_init(struct hisi_qm *qm)
sec_debugfs_root); sec_debugfs_root);
qm->debug.sqe_mask_offset = SEC_SQE_MASK_OFFSET; qm->debug.sqe_mask_offset = SEC_SQE_MASK_OFFSET;
qm->debug.sqe_mask_len = SEC_SQE_MASK_LEN; qm->debug.sqe_mask_len = SEC_SQE_MASK_LEN;
ret = hisi_qm_debug_init(qm); hisi_qm_debug_init(qm);
if (ret)
goto failed_to_create;
ret = sec_debug_init(qm); ret = sec_debug_init(qm);
if (ret) if (ret)
......
...@@ -590,9 +590,7 @@ static int hisi_zip_debugfs_init(struct hisi_qm *qm) ...@@ -590,9 +590,7 @@ static int hisi_zip_debugfs_init(struct hisi_qm *qm)
qm->debug.sqe_mask_offset = HZIP_SQE_MASK_OFFSET; qm->debug.sqe_mask_offset = HZIP_SQE_MASK_OFFSET;
qm->debug.sqe_mask_len = HZIP_SQE_MASK_LEN; qm->debug.sqe_mask_len = HZIP_SQE_MASK_LEN;
qm->debug.debug_root = dev_d; qm->debug.debug_root = dev_d;
ret = hisi_qm_debug_init(qm); hisi_qm_debug_init(qm);
if (ret)
goto failed_to_create;
if (qm->fun_type == QM_HW_PF) { if (qm->fun_type == QM_HW_PF) {
ret = hisi_zip_ctrl_debug_init(qm); ret = hisi_zip_ctrl_debug_init(qm);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment