diff options
author | Felipe Balbi <balbi@ti.com> | 2012-01-31 07:19:00 -0500 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-02-01 04:02:46 -0500 |
commit | 6c2abcdd4f8e21ce686a26697de0ce198a16eaed (patch) | |
tree | 5bbe1b04be09d81bc2188dd69f605101c06c9008 /drivers/usb/musb/musb_debugfs.c | |
parent | e9e8c85e69310141d78daaecd6a56138700ac317 (diff) |
usb: musb: debugfs: fix error check
debugfs will return NULL on failure, so
we must check for !ptr instead of IS_ERR(ptr).
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/musb/musb_debugfs.c')
-rw-r--r-- | drivers/usb/musb/musb_debugfs.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/usb/musb/musb_debugfs.c b/drivers/usb/musb/musb_debugfs.c index 219d0fba584e..40a37c91cc10 100644 --- a/drivers/usb/musb/musb_debugfs.c +++ b/drivers/usb/musb/musb_debugfs.c | |||
@@ -242,22 +242,22 @@ int __devinit musb_init_debugfs(struct musb *musb) | |||
242 | int ret; | 242 | int ret; |
243 | 243 | ||
244 | root = debugfs_create_dir("musb", NULL); | 244 | root = debugfs_create_dir("musb", NULL); |
245 | if (IS_ERR(root)) { | 245 | if (!root) { |
246 | ret = PTR_ERR(root); | 246 | ret = -ENOMEM; |
247 | goto err0; | 247 | goto err0; |
248 | } | 248 | } |
249 | 249 | ||
250 | file = debugfs_create_file("regdump", S_IRUGO, root, musb, | 250 | file = debugfs_create_file("regdump", S_IRUGO, root, musb, |
251 | &musb_regdump_fops); | 251 | &musb_regdump_fops); |
252 | if (IS_ERR(file)) { | 252 | if (!file) { |
253 | ret = PTR_ERR(file); | 253 | ret = -ENOMEM; |
254 | goto err1; | 254 | goto err1; |
255 | } | 255 | } |
256 | 256 | ||
257 | file = debugfs_create_file("testmode", S_IRUGO | S_IWUSR, | 257 | file = debugfs_create_file("testmode", S_IRUGO | S_IWUSR, |
258 | root, musb, &musb_test_mode_fops); | 258 | root, musb, &musb_test_mode_fops); |
259 | if (IS_ERR(file)) { | 259 | if (!file) { |
260 | ret = PTR_ERR(file); | 260 | ret = -ENOMEM; |
261 | goto err1; | 261 | goto err1; |
262 | } | 262 | } |
263 | 263 | ||