diff options
Diffstat (limited to 'drivers/misc/genwqe')
-rw-r--r-- | drivers/misc/genwqe/card_base.c | 5 | ||||
-rw-r--r-- | drivers/misc/genwqe/card_base.h | 2 | ||||
-rw-r--r-- | drivers/misc/genwqe/card_debugfs.c | 165 | ||||
-rw-r--r-- | drivers/misc/genwqe/card_dev.c | 6 |
4 files changed, 32 insertions, 146 deletions
diff --git a/drivers/misc/genwqe/card_base.c b/drivers/misc/genwqe/card_base.c index ab7f2cd21c93..1dc6c7c5cbce 100644 --- a/drivers/misc/genwqe/card_base.c +++ b/drivers/misc/genwqe/card_base.c @@ -1369,10 +1369,6 @@ static int __init genwqe_init_module(void) class_genwqe->devnode = genwqe_devnode; debugfs_genwqe = debugfs_create_dir(GENWQE_DEVNAME, NULL); - if (!debugfs_genwqe) { - rc = -ENOMEM; - goto err_out; - } rc = pci_register_driver(&genwqe_driver); if (rc != 0) { @@ -1384,7 +1380,6 @@ static int __init genwqe_init_module(void) err_out0: debugfs_remove(debugfs_genwqe); - err_out: class_destroy(class_genwqe); return rc; } diff --git a/drivers/misc/genwqe/card_base.h b/drivers/misc/genwqe/card_base.h index 2f6dd2f37942..0e902977d35f 100644 --- a/drivers/misc/genwqe/card_base.h +++ b/drivers/misc/genwqe/card_base.h @@ -437,7 +437,7 @@ int genwqe_device_create(struct genwqe_dev *cd); int genwqe_device_remove(struct genwqe_dev *cd); /* debugfs */ -int genwqe_init_debugfs(struct genwqe_dev *cd); +void genwqe_init_debugfs(struct genwqe_dev *cd); void genqwe_exit_debugfs(struct genwqe_dev *cd); int genwqe_read_softreset(struct genwqe_dev *cd); diff --git a/drivers/misc/genwqe/card_debugfs.c b/drivers/misc/genwqe/card_debugfs.c index 49c945d0c488..1b5b82e65268 100644 --- a/drivers/misc/genwqe/card_debugfs.c +++ b/drivers/misc/genwqe/card_debugfs.c @@ -316,11 +316,9 @@ static int info_show(struct seq_file *s, void *unused) DEFINE_SHOW_ATTRIBUTE(info); -int genwqe_init_debugfs(struct genwqe_dev *cd) +void genwqe_init_debugfs(struct genwqe_dev *cd) { struct dentry *root; - struct dentry *file; - int ret; char card_name[64]; char name[64]; unsigned int i; @@ -328,153 +326,50 @@ int genwqe_init_debugfs(struct genwqe_dev *cd) sprintf(card_name, "%s%d_card", GENWQE_DEVNAME, cd->card_idx); root = debugfs_create_dir(card_name, cd->debugfs_genwqe); - if (!root) { - ret = -ENOMEM; - goto err0; - } /* non privileged interfaces are done here */ - file = debugfs_create_file("ddcb_info", S_IRUGO, root, cd, - &ddcb_info_fops); - if (!file) { - ret = -ENOMEM; - goto err1; - } - - file = debugfs_create_file("info", S_IRUGO, root, cd, - &info_fops); - if (!file) { - ret = -ENOMEM; - goto err1; - } - - file = debugfs_create_x64("err_inject", 0666, root, &cd->err_inject); - if (!file) { - ret = -ENOMEM; - goto err1; - } - - file = debugfs_create_u32("ddcb_software_timeout", 0666, root, - &cd->ddcb_software_timeout); - if (!file) { - ret = -ENOMEM; - goto err1; - } - - file = debugfs_create_u32("kill_timeout", 0666, root, - &cd->kill_timeout); - if (!file) { - ret = -ENOMEM; - goto err1; - } + debugfs_create_file("ddcb_info", S_IRUGO, root, cd, &ddcb_info_fops); + debugfs_create_file("info", S_IRUGO, root, cd, &info_fops); + debugfs_create_x64("err_inject", 0666, root, &cd->err_inject); + debugfs_create_u32("ddcb_software_timeout", 0666, root, + &cd->ddcb_software_timeout); + debugfs_create_u32("kill_timeout", 0666, root, &cd->kill_timeout); /* privileged interfaces follow here */ if (!genwqe_is_privileged(cd)) { cd->debugfs_root = root; - return 0; + return; } - file = debugfs_create_file("curr_regs", S_IRUGO, root, cd, - &curr_regs_fops); - if (!file) { - ret = -ENOMEM; - goto err1; - } - - file = debugfs_create_file("curr_dbg_uid0", S_IRUGO, root, cd, - &curr_dbg_uid0_fops); - if (!file) { - ret = -ENOMEM; - goto err1; - } - - file = debugfs_create_file("curr_dbg_uid1", S_IRUGO, root, cd, - &curr_dbg_uid1_fops); - if (!file) { - ret = -ENOMEM; - goto err1; - } - - file = debugfs_create_file("curr_dbg_uid2", S_IRUGO, root, cd, - &curr_dbg_uid2_fops); - if (!file) { - ret = -ENOMEM; - goto err1; - } - - file = debugfs_create_file("prev_regs", S_IRUGO, root, cd, - &prev_regs_fops); - if (!file) { - ret = -ENOMEM; - goto err1; - } - - file = debugfs_create_file("prev_dbg_uid0", S_IRUGO, root, cd, - &prev_dbg_uid0_fops); - if (!file) { - ret = -ENOMEM; - goto err1; - } - - file = debugfs_create_file("prev_dbg_uid1", S_IRUGO, root, cd, - &prev_dbg_uid1_fops); - if (!file) { - ret = -ENOMEM; - goto err1; - } - - file = debugfs_create_file("prev_dbg_uid2", S_IRUGO, root, cd, - &prev_dbg_uid2_fops); - if (!file) { - ret = -ENOMEM; - goto err1; - } + debugfs_create_file("curr_regs", S_IRUGO, root, cd, &curr_regs_fops); + debugfs_create_file("curr_dbg_uid0", S_IRUGO, root, cd, + &curr_dbg_uid0_fops); + debugfs_create_file("curr_dbg_uid1", S_IRUGO, root, cd, + &curr_dbg_uid1_fops); + debugfs_create_file("curr_dbg_uid2", S_IRUGO, root, cd, + &curr_dbg_uid2_fops); + debugfs_create_file("prev_regs", S_IRUGO, root, cd, &prev_regs_fops); + debugfs_create_file("prev_dbg_uid0", S_IRUGO, root, cd, + &prev_dbg_uid0_fops); + debugfs_create_file("prev_dbg_uid1", S_IRUGO, root, cd, + &prev_dbg_uid1_fops); + debugfs_create_file("prev_dbg_uid2", S_IRUGO, root, cd, + &prev_dbg_uid2_fops); for (i = 0; i < GENWQE_MAX_VFS; i++) { sprintf(name, "vf%u_jobtimeout_msec", i); - - file = debugfs_create_u32(name, 0666, root, - &cd->vf_jobtimeout_msec[i]); - if (!file) { - ret = -ENOMEM; - goto err1; - } + debugfs_create_u32(name, 0666, root, + &cd->vf_jobtimeout_msec[i]); } - file = debugfs_create_file("jobtimer", S_IRUGO, root, cd, - &jtimer_fops); - if (!file) { - ret = -ENOMEM; - goto err1; - } - - file = debugfs_create_file("queue_working_time", S_IRUGO, root, cd, - &queue_working_time_fops); - if (!file) { - ret = -ENOMEM; - goto err1; - } - - file = debugfs_create_u32("skip_recovery", 0666, root, - &cd->skip_recovery); - if (!file) { - ret = -ENOMEM; - goto err1; - } - - file = debugfs_create_u32("use_platform_recovery", 0666, root, - &cd->use_platform_recovery); - if (!file) { - ret = -ENOMEM; - goto err1; - } + debugfs_create_file("jobtimer", S_IRUGO, root, cd, &jtimer_fops); + debugfs_create_file("queue_working_time", S_IRUGO, root, cd, + &queue_working_time_fops); + debugfs_create_u32("skip_recovery", 0666, root, &cd->skip_recovery); + debugfs_create_u32("use_platform_recovery", 0666, root, + &cd->use_platform_recovery); cd->debugfs_root = root; - return 0; -err1: - debugfs_remove_recursive(root); -err0: - return ret; } void genqwe_exit_debugfs(struct genwqe_dev *cd) diff --git a/drivers/misc/genwqe/card_dev.c b/drivers/misc/genwqe/card_dev.c index 3bc51f19c734..0e34c0568fed 100644 --- a/drivers/misc/genwqe/card_dev.c +++ b/drivers/misc/genwqe/card_dev.c @@ -1301,14 +1301,10 @@ int genwqe_device_create(struct genwqe_dev *cd) goto err_cdev; } - rc = genwqe_init_debugfs(cd); - if (rc != 0) - goto err_debugfs; + genwqe_init_debugfs(cd); return 0; - err_debugfs: - device_destroy(cd->class_genwqe, cd->devnum_genwqe); err_cdev: cdev_del(&cd->cdev_genwqe); err_add: |