Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6c2abcdd authored by Felipe Balbi's avatar Felipe Balbi
Browse files

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: default avatarFelipe Balbi <balbi@ti.com>
parent e9e8c85e
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -242,22 +242,22 @@ int __devinit musb_init_debugfs(struct musb *musb)
	int			ret;

	root = debugfs_create_dir("musb", NULL);
	if (IS_ERR(root)) {
		ret = PTR_ERR(root);
	if (!root) {
		ret = -ENOMEM;
		goto err0;
	}

	file = debugfs_create_file("regdump", S_IRUGO, root, musb,
			&musb_regdump_fops);
	if (IS_ERR(file)) {
		ret = PTR_ERR(file);
	if (!file) {
		ret = -ENOMEM;
		goto err1;
	}

	file = debugfs_create_file("testmode", S_IRUGO | S_IWUSR,
			root, musb, &musb_test_mode_fops);
	if (IS_ERR(file)) {
		ret = PTR_ERR(file);
	if (!file) {
		ret = -ENOMEM;
		goto err1;
	}