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>
This commit is contained in:
Родитель
e9e8c85e69
Коммит
6c2abcdd4f
|
@ -242,22 +242,22 @@ int __devinit musb_init_debugfs(struct musb *musb)
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
root = debugfs_create_dir("musb", NULL);
|
root = debugfs_create_dir("musb", NULL);
|
||||||
if (IS_ERR(root)) {
|
if (!root) {
|
||||||
ret = PTR_ERR(root);
|
ret = -ENOMEM;
|
||||||
goto err0;
|
goto err0;
|
||||||
}
|
}
|
||||||
|
|
||||||
file = debugfs_create_file("regdump", S_IRUGO, root, musb,
|
file = debugfs_create_file("regdump", S_IRUGO, root, musb,
|
||||||
&musb_regdump_fops);
|
&musb_regdump_fops);
|
||||||
if (IS_ERR(file)) {
|
if (!file) {
|
||||||
ret = PTR_ERR(file);
|
ret = -ENOMEM;
|
||||||
goto err1;
|
goto err1;
|
||||||
}
|
}
|
||||||
|
|
||||||
file = debugfs_create_file("testmode", S_IRUGO | S_IWUSR,
|
file = debugfs_create_file("testmode", S_IRUGO | S_IWUSR,
|
||||||
root, musb, &musb_test_mode_fops);
|
root, musb, &musb_test_mode_fops);
|
||||||
if (IS_ERR(file)) {
|
if (!file) {
|
||||||
ret = PTR_ERR(file);
|
ret = -ENOMEM;
|
||||||
goto err1;
|
goto err1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче