Skip to content

Commit

Permalink
HSI: omap_ssi_port: Fix return value check in ssi_debug_add_port()
Browse files Browse the repository at this point in the history
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: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
  • Loading branch information
Wei Yongjun authored and Sebastian Reichel committed Jul 30, 2014
1 parent 0a0ea07 commit c2acb7c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/hsi/controllers/omap_ssi_port.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,13 @@ static int __init ssi_debug_add_port(struct omap_ssi_port *omap_port,
struct hsi_port *port = to_hsi_port(omap_port->dev);

dir = debugfs_create_dir(dev_name(omap_port->dev), dir);
if (IS_ERR(dir))
return PTR_ERR(dir);
if (!dir)
return -ENOMEM;
omap_port->dir = dir;
debugfs_create_file("regs", S_IRUGO, dir, port, &ssi_port_regs_fops);
dir = debugfs_create_dir("sst", dir);
if (IS_ERR(dir))
return PTR_ERR(dir);
if (!dir)
return -ENOMEM;
debugfs_create_file("divisor", S_IRUGO | S_IWUSR, dir, port,
&ssi_sst_div_fops);

Expand Down

0 comments on commit c2acb7c

Please sign in to comment.