aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2012-01-31 06:33:32 -0500
committerFelipe Balbi <balbi@ti.com>2012-02-06 04:48:41 -0500
commit3d4c0d4ffb418800b2d1af111f9e1d5b204ee55c (patch)
treec4249599f33d1c402c0689272e9074a884846c6d /drivers/usb/dwc3
parent45b3cd4ad79b31289aa7da7a6448ec5afb7780a4 (diff)
usb: dwc3: debugfs: fix error check
debugfs APIs will return NULL if it fails to create the file/directory we ask it to create. Instead of checking for IS_ERR(ptr) we must check for !ptr. Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc3')
-rw-r--r--drivers/usb/dwc3/debugfs.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/usb/dwc3/debugfs.c b/drivers/usb/dwc3/debugfs.c
index a2c1cc64b48d..78ec092db5eb 100644
--- a/drivers/usb/dwc3/debugfs.c
+++ b/drivers/usb/dwc3/debugfs.c
@@ -659,8 +659,8 @@ int __devinit dwc3_debugfs_init(struct dwc3 *dwc)
659 int ret; 659 int ret;
660 660
661 root = debugfs_create_dir(dev_name(dwc->dev), NULL); 661 root = debugfs_create_dir(dev_name(dwc->dev), NULL);
662 if (IS_ERR(root)) { 662 if (!root) {
663 ret = PTR_ERR(root); 663 ret = -ENOMEM;
664 goto err0; 664 goto err0;
665 } 665 }
666 666
@@ -668,29 +668,29 @@ int __devinit dwc3_debugfs_init(struct dwc3 *dwc)
668 668
669 file = debugfs_create_file("regdump", S_IRUGO, root, dwc, 669 file = debugfs_create_file("regdump", S_IRUGO, root, dwc,
670 &dwc3_regdump_fops); 670 &dwc3_regdump_fops);
671 if (IS_ERR(file)) { 671 if (!file) {
672 ret = PTR_ERR(file); 672 ret = -ENOMEM;
673 goto err1; 673 goto err1;
674 } 674 }
675 675
676 file = debugfs_create_file("mode", S_IRUGO | S_IWUSR, root, 676 file = debugfs_create_file("mode", S_IRUGO | S_IWUSR, root,
677 dwc, &dwc3_mode_fops); 677 dwc, &dwc3_mode_fops);
678 if (IS_ERR(file)) { 678 if (!file) {
679 ret = PTR_ERR(file); 679 ret = -ENOMEM;
680 goto err1; 680 goto err1;
681 } 681 }
682 682
683 file = debugfs_create_file("testmode", S_IRUGO | S_IWUSR, root, 683 file = debugfs_create_file("testmode", S_IRUGO | S_IWUSR, root,
684 dwc, &dwc3_testmode_fops); 684 dwc, &dwc3_testmode_fops);
685 if (IS_ERR(file)) { 685 if (!file) {
686 ret = PTR_ERR(file); 686 ret = -ENOMEM;
687 goto err1; 687 goto err1;
688 } 688 }
689 689
690 file = debugfs_create_file("link_state", S_IRUGO | S_IWUSR, root, 690 file = debugfs_create_file("link_state", S_IRUGO | S_IWUSR, root,
691 dwc, &dwc3_link_state_fops); 691 dwc, &dwc3_link_state_fops);
692 if (IS_ERR(file)) { 692 if (!file) {
693 ret = PTR_ERR(file); 693 ret = -ENOMEM;
694 goto err1; 694 goto err1;
695 } 695 }
696 696