summaryrefslogtreecommitdiff
path: root/drivers/platform
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2018-11-27 11:09:38 +0800
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>2018-12-03 21:40:03 +0200
commit9a92ed29ca961f118b45a2893416df753c287845 (patch)
treeddfb930b0eb5c31c972099d855717df43e0d2896 /drivers/platform
parente278558a1f4b91ed381d5b0168e2f6743a03ae20 (diff)
platform/x86: intel_ips: remove unnecessary checks in ips_debugfs_init
As Greg KH explained in: https://lkml.org/lkml/2015/8/15/114 There no need to check the return value of debugfs_create_file() and debugfs_create_dir(). This also fix static code checker warnings: drivers/platform/x86/intel_ips.c:1314 ips_debugfs_init() warn: passing zero to 'PTR_ERR' drivers/platform/x86/intel_ips.c:1328 ips_debugfs_init() warn: passing zero to 'PTR_ERR' Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/intel_ips.c23
1 files changed, 3 insertions, 20 deletions
diff --git a/drivers/platform/x86/intel_ips.c b/drivers/platform/x86/intel_ips.c
index 225638a1b09e..f37c07c6ad8e 100644
--- a/drivers/platform/x86/intel_ips.c
+++ b/drivers/platform/x86/intel_ips.c
@@ -1310,32 +1310,15 @@ static void ips_debugfs_init(struct ips_driver *ips)
int i;
ips->debug_root = debugfs_create_dir("ips", NULL);
- if (!ips->debug_root) {
- dev_err(ips->dev, "failed to create debugfs entries: %ld\n",
- PTR_ERR(ips->debug_root));
- return;
- }
for (i = 0; i < ARRAY_SIZE(ips_debug_files); i++) {
- struct dentry *ent;
struct ips_debugfs_node *node = &ips_debug_files[i];
node->ips = ips;
- ent = debugfs_create_file(node->name, S_IFREG | S_IRUGO,
- ips->debug_root, node,
- &ips_debugfs_ops);
- if (!ent) {
- dev_err(ips->dev, "failed to create debug file: %ld\n",
- PTR_ERR(ent));
- goto err_cleanup;
- }
+ debugfs_create_file(node->name, S_IFREG | S_IRUGO,
+ ips->debug_root, node,
+ &ips_debugfs_ops);
}
-
- return;
-
-err_cleanup:
- ips_debugfs_cleanup(ips);
- return;
}
#endif /* CONFIG_DEBUG_FS */