Use IS_ERR_OR_NULL() rather than open coding it and ignore errors from
failure to create the supply map.
Signed-off-by: Mark Brown<broonie@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
@@ -3231,14 +3231,13 @@ static int __init regulator_init(void)
#ifdef CONFIG_DEBUG_FS
debugfs_root = debugfs_create_dir("regulator", NULL);
- if (IS_ERR(debugfs_root) || !debugfs_root) {
+ if (IS_ERR_OR_NULL(debugfs_root)) {
pr_warn("regulator: Failed to create debugfs directory\n");
debugfs_root = NULL;
}
- if (IS_ERR(debugfs_create_file("supply_map", 0444, debugfs_root,
- NULL,&supply_map_fops)))
- pr_warn("regulator: Failed to create supplies debugfs\n");
+ debugfs_create_file("supply_map", 0444, debugfs_root, NULL,
+ &supply_map_fops);