diff options
| author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2014-07-29 20:53:20 -0400 |
|---|---|---|
| committer | Sebastian Reichel <sre@kernel.org> | 2014-07-30 18:20:21 -0400 |
| commit | c2acb7c4d566a1735e255acc7260e1dec6b9a7c8 (patch) | |
| tree | e71cd8ac77f44295e2ae5c49d814e26b0072111d | |
| parent | 0a0ea07d3dff0918484f01c576f098dd4911b1af (diff) | |
HSI: omap_ssi_port: Fix return value check in ssi_debug_add_port()
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>
| -rw-r--r-- | drivers/hsi/controllers/omap_ssi_port.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/hsi/controllers/omap_ssi_port.c b/drivers/hsi/controllers/omap_ssi_port.c index 001b86820616..4c0b5820581e 100644 --- a/drivers/hsi/controllers/omap_ssi_port.c +++ b/drivers/hsi/controllers/omap_ssi_port.c | |||
| @@ -177,13 +177,13 @@ static int __init ssi_debug_add_port(struct omap_ssi_port *omap_port, | |||
| 177 | struct hsi_port *port = to_hsi_port(omap_port->dev); | 177 | struct hsi_port *port = to_hsi_port(omap_port->dev); |
| 178 | 178 | ||
| 179 | dir = debugfs_create_dir(dev_name(omap_port->dev), dir); | 179 | dir = debugfs_create_dir(dev_name(omap_port->dev), dir); |
| 180 | if (IS_ERR(dir)) | 180 | if (!dir) |
| 181 | return PTR_ERR(dir); | 181 | return -ENOMEM; |
| 182 | omap_port->dir = dir; | 182 | omap_port->dir = dir; |
| 183 | debugfs_create_file("regs", S_IRUGO, dir, port, &ssi_port_regs_fops); | 183 | debugfs_create_file("regs", S_IRUGO, dir, port, &ssi_port_regs_fops); |
| 184 | dir = debugfs_create_dir("sst", dir); | 184 | dir = debugfs_create_dir("sst", dir); |
| 185 | if (IS_ERR(dir)) | 185 | if (!dir) |
| 186 | return PTR_ERR(dir); | 186 | return -ENOMEM; |
| 187 | debugfs_create_file("divisor", S_IRUGO | S_IWUSR, dir, port, | 187 | debugfs_create_file("divisor", S_IRUGO | S_IWUSR, dir, port, |
| 188 | &ssi_sst_div_fops); | 188 | &ssi_sst_div_fops); |
| 189 | 189 | ||
