diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-02 15:22:06 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-24 17:43:05 -0400 |
commit | 0511b36399434d49d3a6b58cf49be90d96e66848 (patch) | |
tree | 608c1ee810f2e46fb34ccd82120b57864e69367c /drivers | |
parent | 2e6a9e8428d2c391b94d3bcd01c3a3319a1f90b3 (diff) |
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.
Reviewed-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/host/sl811-hcd.c | 38 | ||||
-rw-r--r-- | drivers/usb/host/sl811.h | 2 |
2 files changed, 12 insertions, 28 deletions
diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c index c11c5d8f94e0..d8938630e092 100644 --- a/drivers/usb/host/sl811-hcd.c +++ b/drivers/usb/host/sl811-hcd.c | |||
@@ -48,6 +48,8 @@ | |||
48 | #include <linux/usb/hcd.h> | 48 | #include <linux/usb/hcd.h> |
49 | #include <linux/platform_device.h> | 49 | #include <linux/platform_device.h> |
50 | #include <linux/prefetch.h> | 50 | #include <linux/prefetch.h> |
51 | #include <linux/debugfs.h> | ||
52 | #include <linux/seq_file.h> | ||
51 | 53 | ||
52 | #include <asm/io.h> | 54 | #include <asm/io.h> |
53 | #include <asm/irq.h> | 55 | #include <asm/irq.h> |
@@ -63,11 +65,6 @@ MODULE_ALIAS("platform:sl811-hcd"); | |||
63 | 65 | ||
64 | #define DRIVER_VERSION "19 May 2005" | 66 | #define DRIVER_VERSION "19 May 2005" |
65 | 67 | ||
66 | |||
67 | #ifndef DEBUG | ||
68 | # define STUB_DEBUG_FILE | ||
69 | #endif | ||
70 | |||
71 | /* for now, use only one transfer register bank */ | 68 | /* for now, use only one transfer register bank */ |
72 | #undef USE_B | 69 | #undef USE_B |
73 | 70 | ||
@@ -1373,16 +1370,6 @@ sl811h_bus_resume(struct usb_hcd *hcd) | |||
1373 | 1370 | ||
1374 | /*-------------------------------------------------------------------------*/ | 1371 | /*-------------------------------------------------------------------------*/ |
1375 | 1372 | ||
1376 | #ifdef STUB_DEBUG_FILE | ||
1377 | |||
1378 | static inline void create_debug_file(struct sl811 *sl811) { } | ||
1379 | static inline void remove_debug_file(struct sl811 *sl811) { } | ||
1380 | |||
1381 | #else | ||
1382 | |||
1383 | #include <linux/proc_fs.h> | ||
1384 | #include <linux/seq_file.h> | ||
1385 | |||
1386 | static void dump_irq(struct seq_file *s, char *label, u8 mask) | 1373 | static void dump_irq(struct seq_file *s, char *label, u8 mask) |
1387 | { | 1374 | { |
1388 | seq_printf(s, "%s %02x%s%s%s%s%s%s\n", label, mask, | 1375 | 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, char *label, u8 mask) | |||
1394 | (mask & SL11H_INTMASK_DP) ? " dp" : ""); | 1381 | (mask & SL11H_INTMASK_DP) ? " dp" : ""); |
1395 | } | 1382 | } |
1396 | 1383 | ||
1397 | static int proc_sl811h_show(struct seq_file *s, void *unused) | 1384 | static int sl811h_show(struct seq_file *s, void *unused) |
1398 | { | 1385 | { |
1399 | struct sl811 *sl811 = s->private; | 1386 | struct sl811 *sl811 = s->private; |
1400 | struct sl811h_ep *ep; | 1387 | struct sl811h_ep *ep; |
@@ -1505,34 +1492,31 @@ static int proc_sl811h_show(struct seq_file *s, void *unused) | |||
1505 | return 0; | 1492 | return 0; |
1506 | } | 1493 | } |
1507 | 1494 | ||
1508 | static int proc_sl811h_open(struct inode *inode, struct file *file) | 1495 | static int sl811h_open(struct inode *inode, struct file *file) |
1509 | { | 1496 | { |
1510 | return single_open(file, proc_sl811h_show, PDE_DATA(inode)); | 1497 | return single_open(file, sl811h_show, inode->i_private); |
1511 | } | 1498 | } |
1512 | 1499 | ||
1513 | static const struct file_operations proc_ops = { | 1500 | static const struct file_operations debug_ops = { |
1514 | .open = proc_sl811h_open, | 1501 | .open = sl811h_open, |
1515 | .read = seq_read, | 1502 | .read = seq_read, |
1516 | .llseek = seq_lseek, | 1503 | .llseek = seq_lseek, |
1517 | .release = single_release, | 1504 | .release = single_release, |
1518 | }; | 1505 | }; |
1519 | 1506 | ||
1520 | /* expect just one sl811 per system */ | 1507 | /* expect just one sl811 per system */ |
1521 | static const char proc_filename[] = "driver/sl811h"; | ||
1522 | |||
1523 | static void create_debug_file(struct sl811 *sl811) | 1508 | static void create_debug_file(struct sl811 *sl811) |
1524 | { | 1509 | { |
1525 | sl811->pde = proc_create_data(proc_filename, 0, NULL, &proc_ops, sl811); | 1510 | sl811->debug_file = debugfs_create_file("sl811h", S_IRUGO, |
1511 | usb_debug_root, sl811, | ||
1512 | &debug_ops); | ||
1526 | } | 1513 | } |
1527 | 1514 | ||
1528 | static void remove_debug_file(struct sl811 *sl811) | 1515 | static void remove_debug_file(struct sl811 *sl811) |
1529 | { | 1516 | { |
1530 | if (sl811->pde) | 1517 | debugfs_remove(sl811->debug_file); |
1531 | remove_proc_entry(proc_filename, NULL); | ||
1532 | } | 1518 | } |
1533 | 1519 | ||
1534 | #endif | ||
1535 | |||
1536 | /*-------------------------------------------------------------------------*/ | 1520 | /*-------------------------------------------------------------------------*/ |
1537 | 1521 | ||
1538 | static void | 1522 | static void |
diff --git a/drivers/usb/host/sl811.h b/drivers/usb/host/sl811.h index 7ac5c5ee4a3e..1e23ef49bec1 100644 --- a/drivers/usb/host/sl811.h +++ b/drivers/usb/host/sl811.h | |||
@@ -122,7 +122,7 @@ struct sl811 { | |||
122 | void __iomem *addr_reg; | 122 | void __iomem *addr_reg; |
123 | void __iomem *data_reg; | 123 | void __iomem *data_reg; |
124 | struct sl811_platform_data *board; | 124 | struct sl811_platform_data *board; |
125 | struct proc_dir_entry *pde; | 125 | struct dentry *debug_file; |
126 | 126 | ||
127 | unsigned long stat_insrmv; | 127 | unsigned long stat_insrmv; |
128 | unsigned long stat_wake; | 128 | unsigned long stat_wake; |