Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9a92ed29 authored by YueHaibing's avatar YueHaibing Committed by Andy Shevchenko
Browse files

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: default avatarYueHaibing <yuehaibing@huawei.com>
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
parent e278558a
Loading
Loading
Loading
Loading
+3 −20
Original line number Diff line number Diff line
@@ -1310,33 +1310,16 @@ 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,
		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;
	}
}

	return;

err_cleanup:
	ips_debugfs_cleanup(ips);
	return;
}
#endif /* CONFIG_DEBUG_FS */

/**