Message ID | 20190903175308.5819-1-anju@linux.vnet.ibm.com (mailing list archive) |
---|---|
State | Changes Requested |
Headers | show |
Series | [v2] platform/powernv: Avoid re-registration of imc debugfs directory | expand |
Context | Check | Description |
---|---|---|
snowpatch_ozlabs/apply_patch | warning | Failed to apply on branch next (c317052c95bef1f977b023158e5aa929215f443d) |
snowpatch_ozlabs/apply_patch | fail | Failed to apply to any branch |
diff --git a/arch/powerpc/platforms/powernv/opal-imc.c b/arch/powerpc/platforms/powernv/opal-imc.c index e04b20625cb9..fc2f0e60a44d 100644 --- a/arch/powerpc/platforms/powernv/opal-imc.c +++ b/arch/powerpc/platforms/powernv/opal-imc.c @@ -55,14 +55,19 @@ static void export_imc_mode_and_cmd(struct device_node *node, static u64 loc, *imc_mode_addr, *imc_cmd_addr; char mode[16], cmd[16]; u32 cb_offset; + struct dentry *dir = NULL; struct imc_mem_info *ptr = pmu_ptr->mem_info; + + /* Return, if 'imc' interface already exists */ + dir = debugfs_lookup("imc", powerpc_debugfs_root); + if (dir) { + dput(dir); + return; + } imc_debugfs_parent = debugfs_create_dir("imc", powerpc_debugfs_root); - /* - * Return here, either because 'imc' directory already exists, - * Or failed to create a new one. - */ + /* Return here, if failed to create the directory */ if (!imc_debugfs_parent) return;