[PATCH] usb: musb: debugfs: fix error check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



debugfs will return NULL on failure if
debugfs is enabled or -ENODEV if debugfs
isn't enabled.

Need to handle both cases.

Signed-off-by: Felipe Balbi <balbi@xxxxxx>
---

Will be send on v3.4 merge window

 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 219d0fb..8810e79 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)
 	int			ret;
 
 	root = debugfs_create_dir("musb", NULL);
-	if (IS_ERR(root)) {
-		ret = PTR_ERR(root);
+	if (IS_ERR_OR_NULL(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 (IS_ERR_OR_NULL(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 (IS_ERR_OR_NULL(file)) {
+		ret = -ENOMEM;
 		goto err1;
 	}
 
-- 
1.7.9

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux