diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-24 14:45:58 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-24 14:45:58 -0700 |
| commit | 6866d52ad99a8c2c5301c7371fce365d25b2d0be (patch) | |
| tree | f39adaa4087fd91ed21e7fd81c09ace7b2d9228d /applied/usb-sl811-move-debug-files-from-proc-to-debugfs.patch | |
| parent | e275d064f56be8b9dec6fc2e33d6b075dcc2ac62 (diff) | |
| download | patches-6866d52ad99a8c2c5301c7371fce365d25b2d0be.tar.gz | |
move applied patches to applied/ and add a pwm patch
Diffstat (limited to 'applied/usb-sl811-move-debug-files-from-proc-to-debugfs.patch')
| -rw-r--r-- | applied/usb-sl811-move-debug-files-from-proc-to-debugfs.patch | 120 |
1 files changed, 120 insertions, 0 deletions
diff --git a/applied/usb-sl811-move-debug-files-from-proc-to-debugfs.patch b/applied/usb-sl811-move-debug-files-from-proc-to-debugfs.patch new file mode 100644 index 00000000000000..a18f57fd2a479f --- /dev/null +++ b/applied/usb-sl811-move-debug-files-from-proc-to-debugfs.patch @@ -0,0 +1,120 @@ +From foo@baz Tue Jul 2 12:18:43 PDT 2013 +Date: Tue, 02 Jul 2013 12:18:43 -0700 +To: Greg KH <gregkh@linuxfoundation.org> +From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Subject: USB: sl811: move debug files from proc to debugfs + +Drivers should not be putting debug files in /proc/ that is what debugfs +is for, so move the sl811 driver's debug file to debugfs. + +Cc: Felipe Balbi <balbi@ti.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> + +--- + drivers/usb/host/sl811-hcd.c | 38 +++++++++++--------------------------- + drivers/usb/host/sl811.h | 2 +- + 2 files changed, 12 insertions(+), 28 deletions(-) + +--- a/drivers/usb/host/sl811-hcd.c ++++ b/drivers/usb/host/sl811-hcd.c +@@ -48,6 +48,8 @@ + #include <linux/usb/hcd.h> + #include <linux/platform_device.h> + #include <linux/prefetch.h> ++#include <linux/debugfs.h> ++#include <linux/seq_file.h> + + #include <asm/io.h> + #include <asm/irq.h> +@@ -63,11 +65,6 @@ MODULE_ALIAS("platform:sl811-hcd"); + + #define DRIVER_VERSION "19 May 2005" + +- +-#ifndef DEBUG +-# define STUB_DEBUG_FILE +-#endif +- + /* for now, use only one transfer register bank */ + #undef USE_B + +@@ -1373,16 +1370,6 @@ sl811h_bus_resume(struct usb_hcd *hcd) + + /*-------------------------------------------------------------------------*/ + +-#ifdef STUB_DEBUG_FILE +- +-static inline void create_debug_file(struct sl811 *sl811) { } +-static inline void remove_debug_file(struct sl811 *sl811) { } +- +-#else +- +-#include <linux/proc_fs.h> +-#include <linux/seq_file.h> +- + static void dump_irq(struct seq_file *s, char *label, u8 mask) + { + seq_printf(s, "%s %02x%s%s%s%s%s%s\n", label, mask, +@@ -1394,7 +1381,7 @@ static void dump_irq(struct seq_file *s, + (mask & SL11H_INTMASK_DP) ? " dp" : ""); + } + +-static int proc_sl811h_show(struct seq_file *s, void *unused) ++static int sl811h_show(struct seq_file *s, void *unused) + { + struct sl811 *sl811 = s->private; + struct sl811h_ep *ep; +@@ -1505,34 +1492,31 @@ static int proc_sl811h_show(struct seq_f + return 0; + } + +-static int proc_sl811h_open(struct inode *inode, struct file *file) ++static int sl811h_open(struct inode *inode, struct file *file) + { +- return single_open(file, proc_sl811h_show, PDE_DATA(inode)); ++ return single_open(file, sl811h_show, inode->i_private); + } + +-static const struct file_operations proc_ops = { +- .open = proc_sl811h_open, ++static const struct file_operations debug_ops = { ++ .open = sl811h_open, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, + }; + + /* expect just one sl811 per system */ +-static const char proc_filename[] = "driver/sl811h"; +- + static void create_debug_file(struct sl811 *sl811) + { +- sl811->pde = proc_create_data(proc_filename, 0, NULL, &proc_ops, sl811); ++ sl811->debug_file = debugfs_create_file("sl811h", S_IRUGO, ++ usb_debug_root, sl811, ++ &debug_ops); + } + + static void remove_debug_file(struct sl811 *sl811) + { +- if (sl811->pde) +- remove_proc_entry(proc_filename, NULL); ++ debugfs_remove(sl811->debug_file); + } + +-#endif +- + /*-------------------------------------------------------------------------*/ + + static void +--- a/drivers/usb/host/sl811.h ++++ b/drivers/usb/host/sl811.h +@@ -122,7 +122,7 @@ struct sl811 { + void __iomem *addr_reg; + void __iomem *data_reg; + struct sl811_platform_data *board; +- struct proc_dir_entry *pde; ++ struct dentry *debug_file; + + unsigned long stat_insrmv; + unsigned long stat_wake; |
