Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 151347
b: refs/heads/master
c: 1098334
h: refs/heads/master
i:
  151345: 08f6a02
  151343: ddfd022
v: v3
  • Loading branch information
Greg Kroah-Hartman committed Jun 16, 2009
1 parent bf0a032 commit e9f1aa2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 74675a58507e769beee7d949dbed788af3c4139d
refs/heads/master: 109833417cd0bf27089fcca5b0d6a44c8d592452
31 changes: 10 additions & 21 deletions trunk/drivers/usb/host/ohci-dbg.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ static struct dentry *ohci_debug_root;

struct debug_buffer {
ssize_t (*fill_func)(struct debug_buffer *); /* fill method */
struct device *dev;
struct ohci_hcd *ohci;
struct mutex mutex; /* protect filling of buffer */
size_t count; /* number of characters filled into buffer */
char *page;
Expand Down Expand Up @@ -505,15 +505,11 @@ show_list (struct ohci_hcd *ohci, char *buf, size_t count, struct ed *ed)

static ssize_t fill_async_buffer(struct debug_buffer *buf)
{
struct usb_bus *bus;
struct usb_hcd *hcd;
struct ohci_hcd *ohci;
size_t temp;
unsigned long flags;

bus = dev_get_drvdata(buf->dev);
hcd = bus_to_hcd(bus);
ohci = hcd_to_ohci(hcd);
ohci = buf->ohci;

/* display control and bulk lists together, for simplicity */
spin_lock_irqsave (&ohci->lock, flags);
Expand All @@ -529,8 +525,6 @@ static ssize_t fill_async_buffer(struct debug_buffer *buf)

static ssize_t fill_periodic_buffer(struct debug_buffer *buf)
{
struct usb_bus *bus;
struct usb_hcd *hcd;
struct ohci_hcd *ohci;
struct ed **seen, *ed;
unsigned long flags;
Expand All @@ -542,9 +536,7 @@ static ssize_t fill_periodic_buffer(struct debug_buffer *buf)
return 0;
seen_count = 0;

bus = (struct usb_bus *)dev_get_drvdata(buf->dev);
hcd = bus_to_hcd(bus);
ohci = hcd_to_ohci(hcd);
ohci = buf->ohci;
next = buf->page;
size = PAGE_SIZE;

Expand Down Expand Up @@ -626,7 +618,6 @@ static ssize_t fill_periodic_buffer(struct debug_buffer *buf)

static ssize_t fill_registers_buffer(struct debug_buffer *buf)
{
struct usb_bus *bus;
struct usb_hcd *hcd;
struct ohci_hcd *ohci;
struct ohci_regs __iomem *regs;
Expand All @@ -635,9 +626,8 @@ static ssize_t fill_registers_buffer(struct debug_buffer *buf)
char *next;
u32 rdata;

bus = (struct usb_bus *)dev_get_drvdata(buf->dev);
hcd = bus_to_hcd(bus);
ohci = hcd_to_ohci(hcd);
ohci = buf->ohci;
hcd = ohci_to_hcd(ohci);
regs = ohci->regs;
next = buf->page;
size = PAGE_SIZE;
Expand Down Expand Up @@ -710,15 +700,15 @@ static ssize_t fill_registers_buffer(struct debug_buffer *buf)
return PAGE_SIZE - size;
}

static struct debug_buffer *alloc_buffer(struct device *dev,
static struct debug_buffer *alloc_buffer(struct ohci_hcd *ohci,
ssize_t (*fill_func)(struct debug_buffer *))
{
struct debug_buffer *buf;

buf = kzalloc(sizeof(struct debug_buffer), GFP_KERNEL);

if (buf) {
buf->dev = dev;
buf->ohci = ohci;
buf->fill_func = fill_func;
mutex_init(&buf->mutex);
}
Expand Down Expand Up @@ -810,26 +800,25 @@ static int debug_registers_open(struct inode *inode, struct file *file)
static inline void create_debug_files (struct ohci_hcd *ohci)
{
struct usb_bus *bus = &ohci_to_hcd(ohci)->self;
struct device *dev = bus->dev;

ohci->debug_dir = debugfs_create_dir(bus->bus_name, ohci_debug_root);
if (!ohci->debug_dir)
goto dir_error;

ohci->debug_async = debugfs_create_file("async", S_IRUGO,
ohci->debug_dir, dev,
ohci->debug_dir, ohci,
&debug_async_fops);
if (!ohci->debug_async)
goto async_error;

ohci->debug_periodic = debugfs_create_file("periodic", S_IRUGO,
ohci->debug_dir, dev,
ohci->debug_dir, ohci,
&debug_periodic_fops);
if (!ohci->debug_periodic)
goto periodic_error;

ohci->debug_registers = debugfs_create_file("registers", S_IRUGO,
ohci->debug_dir, dev,
ohci->debug_dir, ohci,
&debug_registers_fops);
if (!ohci->debug_registers)
goto registers_error;
Expand Down

0 comments on commit e9f1aa2

Please sign in to comment.