Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1374111
| From | changbin.du@intel.com |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v3 1/2] usb: dwc3: make dwc3_debugfs_init return value be void |
| Date | 2016-04-08 11:50 +0200 |
| Message-ID | <rlBd9-1LF-31@gated-at.bofh.it> (permalink) |
| References | <rlBd8-1LF-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: "Du, Changbin" <changbin.du@intel.com>
Debugfs init failure is not so important. We can continue our job on
this failure. Also no need to check debugfs_create_file call results.
Signed-off-by: Du, Changbin <changbin.du@intel.com>
---
changes from v2:
no changes
---
drivers/usb/dwc3/core.c | 10 +---------
drivers/usb/dwc3/debug.h | 6 +++---
drivers/usb/dwc3/debugfs.c | 50 ++++++++++------------------------------------
3 files changed, 14 insertions(+), 52 deletions(-)
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 17fd814..30f825c 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -1062,19 +1062,11 @@ static int dwc3_probe(struct platform_device *pdev)
if (ret)
goto err5;
- ret = dwc3_debugfs_init(dwc);
- if (ret) {
- dev_err(dev, "failed to initialize debugfs\n");
- goto err6;
- }
-
+ dwc3_debugfs_init(dwc);
pm_runtime_allow(dev);
return 0;
-err6:
- dwc3_core_exit_mode(dwc);
-
err5:
dwc3_event_buffers_cleanup(dwc);
diff --git a/drivers/usb/dwc3/debug.h b/drivers/usb/dwc3/debug.h
index 07fbc2d..71e3180 100644
--- a/drivers/usb/dwc3/debug.h
+++ b/drivers/usb/dwc3/debug.h
@@ -217,11 +217,11 @@ static inline const char *dwc3_gadget_event_type_string(u8 event)
void dwc3_trace(void (*trace)(struct va_format *), const char *fmt, ...);
#ifdef CONFIG_DEBUG_FS
-extern int dwc3_debugfs_init(struct dwc3 *);
+extern void dwc3_debugfs_init(struct dwc3 *);
extern void dwc3_debugfs_exit(struct dwc3 *);
#else
-static inline int dwc3_debugfs_init(struct dwc3 *d)
-{ return 0; }
+static inline void dwc3_debugfs_init(struct dwc3 *d)
+{ }
static inline void dwc3_debugfs_exit(struct dwc3 *d)
{ }
#endif
diff --git a/drivers/usb/dwc3/debugfs.c b/drivers/usb/dwc3/debugfs.c
index 9ac37fe..071b286 100644
--- a/drivers/usb/dwc3/debugfs.c
+++ b/drivers/usb/dwc3/debugfs.c
@@ -618,69 +618,39 @@ static const struct file_operations dwc3_link_state_fops = {
.release = single_release,
};
-int dwc3_debugfs_init(struct dwc3 *dwc)
+void dwc3_debugfs_init(struct dwc3 *dwc)
{
struct dentry *root;
- struct dentry *file;
- int ret;
root = debugfs_create_dir(dev_name(dwc->dev), NULL);
- if (!root) {
- ret = -ENOMEM;
- goto err0;
- }
+ if (IS_ERR_OR_NULL(root))
+ return;
dwc->root = root;
dwc->regset = kzalloc(sizeof(*dwc->regset), GFP_KERNEL);
if (!dwc->regset) {
- ret = -ENOMEM;
- goto err1;
+ debugfs_remove_recursive(root);
+ return;
}
dwc->regset->regs = dwc3_regs;
dwc->regset->nregs = ARRAY_SIZE(dwc3_regs);
dwc->regset->base = dwc->regs;
- file = debugfs_create_regset32("regdump", S_IRUGO, root, dwc->regset);
- if (!file) {
- ret = -ENOMEM;
- goto err1;
- }
+ debugfs_create_regset32("regdump", S_IRUGO, root, dwc->regset);
- if (IS_ENABLED(CONFIG_USB_DWC3_DUAL_ROLE)) {
- file = debugfs_create_file("mode", S_IRUGO | S_IWUSR, root,
+ if (IS_ENABLED(CONFIG_USB_DWC3_DUAL_ROLE))
+ debugfs_create_file("mode", S_IRUGO | S_IWUSR, root,
dwc, &dwc3_mode_fops);
- if (!file) {
- ret = -ENOMEM;
- goto err1;
- }
- }
if (IS_ENABLED(CONFIG_USB_DWC3_DUAL_ROLE) ||
IS_ENABLED(CONFIG_USB_DWC3_GADGET)) {
- file = debugfs_create_file("testmode", S_IRUGO | S_IWUSR, root,
+ debugfs_create_file("testmode", S_IRUGO | S_IWUSR, root,
dwc, &dwc3_testmode_fops);
- if (!file) {
- ret = -ENOMEM;
- goto err1;
- }
-
- file = debugfs_create_file("link_state", S_IRUGO | S_IWUSR, root,
+ debugfs_create_file("link_state", S_IRUGO | S_IWUSR, root,
dwc, &dwc3_link_state_fops);
- if (!file) {
- ret = -ENOMEM;
- goto err1;
- }
}
-
- return 0;
-
-err1:
- debugfs_remove_recursive(root);
-
-err0:
- return ret;
}
void dwc3_debugfs_exit(struct dwc3 *dwc)
--
2.5.0
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] usb: dwc3: add debugfs node to dump FIFO/Queue available space changbin.du@intel.com - 2016-04-06 10:40 +0200
Re: [PATCH] usb: dwc3: add debugfs node to dump FIFO/Queue available space Greg KH <gregkh@linuxfoundation.org> - 2016-04-06 11:30 +0200
RE: [PATCH] usb: dwc3: add debugfs node to dump FIFO/Queue available space "Du, Changbin" <changbin.du@intel.com> - 2016-04-06 13:40 +0200
RE: [PATCH] usb: dwc3: add debugfs node to dump FIFO/Queue available space Felipe Balbi <balbi@kernel.org> - 2016-04-06 14:30 +0200
[PATCH v2 0/3] Improvement, fix and new entry for dwc3 debugfs changbin.du@intel.com - 2016-04-06 18:00 +0200
[PATCH v2 3/3] usb: dwc3: add debugfs node to dump FIFO/Queue available space changbin.du@intel.com - 2016-04-06 18:00 +0200
Re: [PATCH v2 0/3] Improvement, fix and new entry for dwc3 debugfs Felipe Balbi <balbi@kernel.org> - 2016-04-07 07:10 +0200
RE: [PATCH v2 0/3] Improvement, fix and new entry for dwc3 debugfs "Du, Changbin" <changbin.du@intel.com> - 2016-04-07 07:30 +0200
RE: [PATCH v2 0/3] Improvement, fix and new entry for dwc3 debugfs Felipe Balbi <balbi@kernel.org> - 2016-04-07 07:30 +0200
[PATCH v3 0/2] Add a new debugfs entry to dump FIFO/Queue available space changbin.du@intel.com - 2016-04-08 11:50 +0200
[PATCH v3 1/2] usb: dwc3: make dwc3_debugfs_init return value be void changbin.du@intel.com - 2016-04-08 11:50 +0200
Re: [PATCH v3 1/2] usb: dwc3: make dwc3_debugfs_init return value be void Felipe Balbi <balbi@kernel.org> - 2016-04-11 10:20 +0200
RE: [PATCH v3 1/2] usb: dwc3: make dwc3_debugfs_init return value be void "Du, Changbin" <changbin.du@intel.com> - 2016-04-11 13:20 +0200
RE: [PATCH v3 1/2] usb: dwc3: make dwc3_debugfs_init return value be void Felipe Balbi <balbi@kernel.org> - 2016-04-11 13:30 +0200
[PATCH v4 0/2] Add a new debugfs entry to dump FIFO/Queue available space changbin.du@intel.com - 2016-04-12 13:30 +0200
[PATCH v4 2/2] usb: dwc3: add debugfs node to dump FIFO/Queue available space changbin.du@intel.com - 2016-04-12 13:30 +0200
Re: [PATCH v4 2/2] usb: dwc3: add debugfs node to dump FIFO/Queue available space Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2016-04-12 15:00 +0200
RE: [PATCH v4 2/2] usb: dwc3: add debugfs node to dump FIFO/Queue available space "Du, Changbin" <changbin.du@intel.com> - 2016-04-14 05:30 +0200
Re: [PATCH v4 2/2] usb: dwc3: add debugfs node to dump FIFO/Queue available space Felipe Balbi <balbi@kernel.org> - 2016-04-14 10:10 +0200
RE: [PATCH v4 2/2] usb: dwc3: add debugfs node to dump FIFO/Queue available space "Du, Changbin" <changbin.du@intel.com> - 2016-04-14 13:20 +0200
RE: [PATCH v4 2/2] usb: dwc3: add debugfs node to dump FIFO/Queue available space Felipe Balbi <balbi@kernel.org> - 2016-04-14 13:30 +0200
RE: [PATCH v4 2/2] usb: dwc3: add debugfs node to dump FIFO/Queue available space "Du, Changbin" <changbin.du@intel.com> - 2016-04-14 13:40 +0200
RE: [PATCH v4 2/2] usb: dwc3: add debugfs node to dump FIFO/Queue available space Felipe Balbi <balbi@kernel.org> - 2016-04-14 13:50 +0200
RE: [PATCH v4 2/2] usb: dwc3: add debugfs node to dump FIFO/Queue available space "Du, Changbin" <changbin.du@intel.com> - 2016-04-14 14:00 +0200
[PATCH v4 1/2] usb: dwc3: make dwc3_debugfs_init return value be void changbin.du@intel.com - 2016-04-12 13:30 +0200
[PATCH v3 2/2] usb: dwc3: add debugfs node to dump FIFO/Queue available space changbin.du@intel.com - 2016-04-08 11:50 +0200
csiph-web