diff options
Diffstat (limited to 'drivers/usb/dwc3/debugfs.c')
-rw-r--r-- | drivers/usb/dwc3/debugfs.c | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/drivers/usb/dwc3/debugfs.c b/drivers/usb/dwc3/debugfs.c index a1bac9a07837..8b23d0455b1c 100644 --- a/drivers/usb/dwc3/debugfs.c +++ b/drivers/usb/dwc3/debugfs.c | |||
@@ -667,28 +667,31 @@ int dwc3_debugfs_init(struct dwc3 *dwc) | |||
667 | goto err1; | 667 | goto err1; |
668 | } | 668 | } |
669 | 669 | ||
670 | #if IS_ENABLED(CONFIG_USB_DWC3_GADGET) | 670 | if (IS_ENABLED(CONFIG_USB_DWC3_DUAL_ROLE)) { |
671 | file = debugfs_create_file("mode", S_IRUGO | S_IWUSR, root, | 671 | file = debugfs_create_file("mode", S_IRUGO | S_IWUSR, root, |
672 | dwc, &dwc3_mode_fops); | 672 | dwc, &dwc3_mode_fops); |
673 | if (!file) { | 673 | if (!file) { |
674 | ret = -ENOMEM; | 674 | ret = -ENOMEM; |
675 | goto err1; | 675 | goto err1; |
676 | } | ||
676 | } | 677 | } |
677 | 678 | ||
678 | file = debugfs_create_file("testmode", S_IRUGO | S_IWUSR, root, | 679 | if (IS_ENABLED(CONFIG_USB_DWC3_DUAL_ROLE) || |
679 | dwc, &dwc3_testmode_fops); | 680 | IS_ENABLED(CONFIG_USB_DWC3_GADGET)) { |
680 | if (!file) { | 681 | file = debugfs_create_file("testmode", S_IRUGO | S_IWUSR, root, |
681 | ret = -ENOMEM; | 682 | dwc, &dwc3_testmode_fops); |
682 | goto err1; | 683 | if (!file) { |
683 | } | 684 | ret = -ENOMEM; |
684 | 685 | goto err1; | |
685 | file = debugfs_create_file("link_state", S_IRUGO | S_IWUSR, root, | 686 | } |
686 | dwc, &dwc3_link_state_fops); | 687 | |
687 | if (!file) { | 688 | file = debugfs_create_file("link_state", S_IRUGO | S_IWUSR, root, |
688 | ret = -ENOMEM; | 689 | dwc, &dwc3_link_state_fops); |
689 | goto err1; | 690 | if (!file) { |
691 | ret = -ENOMEM; | ||
692 | goto err1; | ||
693 | } | ||
690 | } | 694 | } |
691 | #endif | ||
692 | 695 | ||
693 | return 0; | 696 | return 0; |
694 | 697 | ||