Commit 3fd276e9 authored by Wei Yongjun's avatar Wei Yongjun Committed by Sebastian Reichel

HSI: omap_ssi: Fix return value check in ssi_debug_add_ctrl()

In case of error, the function debugfs_create_*() returns NULL
pointer not ERR_PTR() if debugfs is enabled. The IS_ERR() test
in the return value check should be replaced with NULL test.
Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
parent c2acb7c4
...@@ -148,14 +148,14 @@ static int __init ssi_debug_add_ctrl(struct hsi_controller *ssi) ...@@ -148,14 +148,14 @@ static int __init ssi_debug_add_ctrl(struct hsi_controller *ssi)
/* SSI controller */ /* SSI controller */
omap_ssi->dir = debugfs_create_dir(dev_name(&ssi->device), NULL); omap_ssi->dir = debugfs_create_dir(dev_name(&ssi->device), NULL);
if (IS_ERR(omap_ssi->dir)) if (!omap_ssi->dir)
return PTR_ERR(omap_ssi->dir); return -ENOMEM;
debugfs_create_file("regs", S_IRUGO, omap_ssi->dir, ssi, debugfs_create_file("regs", S_IRUGO, omap_ssi->dir, ssi,
&ssi_regs_fops); &ssi_regs_fops);
/* SSI GDD (DMA) */ /* SSI GDD (DMA) */
dir = debugfs_create_dir("gdd", omap_ssi->dir); dir = debugfs_create_dir("gdd", omap_ssi->dir);
if (IS_ERR(dir)) if (!dir)
goto rback; goto rback;
debugfs_create_file("regs", S_IRUGO, dir, ssi, &ssi_gdd_regs_fops); debugfs_create_file("regs", S_IRUGO, dir, ssi, &ssi_gdd_regs_fops);
...@@ -163,7 +163,7 @@ static int __init ssi_debug_add_ctrl(struct hsi_controller *ssi) ...@@ -163,7 +163,7 @@ static int __init ssi_debug_add_ctrl(struct hsi_controller *ssi)
rback: rback:
debugfs_remove_recursive(omap_ssi->dir); debugfs_remove_recursive(omap_ssi->dir);
return PTR_ERR(dir); return -ENOMEM;
} }
static void ssi_debug_remove_ctrl(struct hsi_controller *ssi) static void ssi_debug_remove_ctrl(struct hsi_controller *ssi)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment