2 * OHCI HCD (Host Controller Driver) for USB.
4 * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at>
5 * (C) Copyright 2000-2002 David Brownell <dbrownell@users.sourceforge.net>
7 * This file is licenced under the GPL.
10 /*-------------------------------------------------------------------------*/
12 #define edstring(ed_type) ({ char *temp; \
14 case PIPE_CONTROL: temp = "ctrl"; break; \
15 case PIPE_BULK: temp = "bulk"; break; \
16 case PIPE_INTERRUPT: temp = "intr"; break; \
17 default: temp = "isoc"; break; \
19 #define pipestring(pipe) edstring(usb_pipetype(pipe))
22 #define ohci_dbg_sw(ohci, next, size, format, arg...) \
26 s_len = scnprintf (*next, *size, format, ## arg ); \
27 *size -= s_len; *next += s_len; \
29 ohci_dbg(ohci,format, ## arg ); \
32 /* Version for use where "next" is the address of a local variable */
33 #define ohci_dbg_nosw(ohci, next, size, format, arg...) \
36 s_len = scnprintf(*next, *size, format, ## arg); \
37 *size -= s_len; *next += s_len; \
41 static void ohci_dump_intr_mask (
42 struct ohci_hcd
*ohci
,
48 ohci_dbg_sw (ohci
, next
, size
, "%s 0x%08x%s%s%s%s%s%s%s%s%s\n",
51 (mask
& OHCI_INTR_MIE
) ? " MIE" : "",
52 (mask
& OHCI_INTR_OC
) ? " OC" : "",
53 (mask
& OHCI_INTR_RHSC
) ? " RHSC" : "",
54 (mask
& OHCI_INTR_FNO
) ? " FNO" : "",
55 (mask
& OHCI_INTR_UE
) ? " UE" : "",
56 (mask
& OHCI_INTR_RD
) ? " RD" : "",
57 (mask
& OHCI_INTR_SF
) ? " SF" : "",
58 (mask
& OHCI_INTR_WDH
) ? " WDH" : "",
59 (mask
& OHCI_INTR_SO
) ? " SO" : ""
63 static void maybe_print_eds (
64 struct ohci_hcd
*ohci
,
71 ohci_dbg_sw (ohci
, next
, size
, "%s %08x\n", label
, value
);
74 static char *hcfs2string (int state
)
77 case OHCI_USB_RESET
: return "reset";
78 case OHCI_USB_RESUME
: return "resume";
79 case OHCI_USB_OPER
: return "operational";
80 case OHCI_USB_SUSPEND
: return "suspend";
85 static const char *rh_state_string(struct ohci_hcd
*ohci
)
87 switch (ohci
->rh_state
) {
90 case OHCI_RH_SUSPENDED
:
98 // dump control and status registers
100 ohci_dump_status (struct ohci_hcd
*controller
, char **next
, unsigned *size
)
102 struct ohci_regs __iomem
*regs
= controller
->regs
;
105 temp
= ohci_readl (controller
, ®s
->revision
) & 0xff;
106 ohci_dbg_sw (controller
, next
, size
,
107 "OHCI %d.%d, %s legacy support registers, rh state %s\n",
108 0x03 & (temp
>> 4), (temp
& 0x0f),
109 (temp
& 0x0100) ? "with" : "NO",
110 rh_state_string(controller
));
112 temp
= ohci_readl (controller
, ®s
->control
);
113 ohci_dbg_sw (controller
, next
, size
,
114 "control 0x%03x%s%s%s HCFS=%s%s%s%s%s CBSR=%d\n",
116 (temp
& OHCI_CTRL_RWE
) ? " RWE" : "",
117 (temp
& OHCI_CTRL_RWC
) ? " RWC" : "",
118 (temp
& OHCI_CTRL_IR
) ? " IR" : "",
119 hcfs2string (temp
& OHCI_CTRL_HCFS
),
120 (temp
& OHCI_CTRL_BLE
) ? " BLE" : "",
121 (temp
& OHCI_CTRL_CLE
) ? " CLE" : "",
122 (temp
& OHCI_CTRL_IE
) ? " IE" : "",
123 (temp
& OHCI_CTRL_PLE
) ? " PLE" : "",
124 temp
& OHCI_CTRL_CBSR
127 temp
= ohci_readl (controller
, ®s
->cmdstatus
);
128 ohci_dbg_sw (controller
, next
, size
,
129 "cmdstatus 0x%05x SOC=%d%s%s%s%s\n", temp
,
130 (temp
& OHCI_SOC
) >> 16,
131 (temp
& OHCI_OCR
) ? " OCR" : "",
132 (temp
& OHCI_BLF
) ? " BLF" : "",
133 (temp
& OHCI_CLF
) ? " CLF" : "",
134 (temp
& OHCI_HCR
) ? " HCR" : ""
137 ohci_dump_intr_mask (controller
, "intrstatus",
138 ohci_readl (controller
, ®s
->intrstatus
),
140 ohci_dump_intr_mask (controller
, "intrenable",
141 ohci_readl (controller
, ®s
->intrenable
),
143 // intrdisable always same as intrenable
145 maybe_print_eds (controller
, "ed_periodcurrent",
146 ohci_readl (controller
, ®s
->ed_periodcurrent
),
149 maybe_print_eds (controller
, "ed_controlhead",
150 ohci_readl (controller
, ®s
->ed_controlhead
),
152 maybe_print_eds (controller
, "ed_controlcurrent",
153 ohci_readl (controller
, ®s
->ed_controlcurrent
),
156 maybe_print_eds (controller
, "ed_bulkhead",
157 ohci_readl (controller
, ®s
->ed_bulkhead
),
159 maybe_print_eds (controller
, "ed_bulkcurrent",
160 ohci_readl (controller
, ®s
->ed_bulkcurrent
),
163 maybe_print_eds (controller
, "donehead",
164 ohci_readl (controller
, ®s
->donehead
), next
, size
);
167 #define dbg_port_sw(hc,num,value,next,size) \
168 ohci_dbg_sw (hc, next, size, \
169 "roothub.portstatus [%d] " \
170 "0x%08x%s%s%s%s%s%s%s%s%s%s%s%s\n", \
172 (temp & RH_PS_PRSC) ? " PRSC" : "", \
173 (temp & RH_PS_OCIC) ? " OCIC" : "", \
174 (temp & RH_PS_PSSC) ? " PSSC" : "", \
175 (temp & RH_PS_PESC) ? " PESC" : "", \
176 (temp & RH_PS_CSC) ? " CSC" : "", \
178 (temp & RH_PS_LSDA) ? " LSDA" : "", \
179 (temp & RH_PS_PPS) ? " PPS" : "", \
180 (temp & RH_PS_PRS) ? " PRS" : "", \
181 (temp & RH_PS_POCI) ? " POCI" : "", \
182 (temp & RH_PS_PSS) ? " PSS" : "", \
184 (temp & RH_PS_PES) ? " PES" : "", \
185 (temp & RH_PS_CCS) ? " CCS" : "" \
191 struct ohci_hcd
*controller
,
198 temp
= roothub_a (controller
);
203 ohci_dbg_sw (controller
, next
, size
,
204 "roothub.a %08x POTPGT=%d%s%s%s%s%s NDP=%d(%d)\n", temp
,
205 ((temp
& RH_A_POTPGT
) >> 24) & 0xff,
206 (temp
& RH_A_NOCP
) ? " NOCP" : "",
207 (temp
& RH_A_OCPM
) ? " OCPM" : "",
208 (temp
& RH_A_DT
) ? " DT" : "",
209 (temp
& RH_A_NPS
) ? " NPS" : "",
210 (temp
& RH_A_PSM
) ? " PSM" : "",
211 (temp
& RH_A_NDP
), controller
->num_ports
213 temp
= roothub_b (controller
);
214 ohci_dbg_sw (controller
, next
, size
,
215 "roothub.b %08x PPCM=%04x DR=%04x\n",
217 (temp
& RH_B_PPCM
) >> 16,
220 temp
= roothub_status (controller
);
221 ohci_dbg_sw (controller
, next
, size
,
222 "roothub.status %08x%s%s%s%s%s%s\n",
224 (temp
& RH_HS_CRWE
) ? " CRWE" : "",
225 (temp
& RH_HS_OCIC
) ? " OCIC" : "",
226 (temp
& RH_HS_LPSC
) ? " LPSC" : "",
227 (temp
& RH_HS_DRWE
) ? " DRWE" : "",
228 (temp
& RH_HS_OCI
) ? " OCI" : "",
229 (temp
& RH_HS_LPS
) ? " LPS" : ""
233 for (i
= 0; i
< controller
->num_ports
; i
++) {
234 temp
= roothub_portstatus (controller
, i
);
235 dbg_port_sw (controller
, i
, temp
, next
, size
);
239 static void ohci_dump (struct ohci_hcd
*controller
, int verbose
)
241 ohci_dbg (controller
, "OHCI controller state\n");
243 // dumps some of the state we know about
244 ohci_dump_status (controller
, NULL
, NULL
);
245 if (controller
->hcca
)
246 ohci_dbg (controller
,
247 "hcca frame #%04x\n", ohci_frame_no(controller
));
248 ohci_dump_roothub (controller
, 1, NULL
, NULL
);
251 static const char data0
[] = "DATA0";
252 static const char data1
[] = "DATA1";
254 static void ohci_dump_td (const struct ohci_hcd
*ohci
, const char *label
,
257 u32 tmp
= hc32_to_cpup (ohci
, &td
->hwINFO
);
259 ohci_dbg (ohci
, "%s td %p%s; urb %p index %d; hw next td %08x\n",
261 (tmp
& TD_DONE
) ? " (DONE)" : "",
263 hc32_to_cpup (ohci
, &td
->hwNextTD
));
264 if ((tmp
& TD_ISO
) == 0) {
265 const char *toggle
, *pid
;
268 switch (tmp
& TD_T
) {
269 case TD_T_DATA0
: toggle
= data0
; break;
270 case TD_T_DATA1
: toggle
= data1
; break;
271 case TD_T_TOGGLE
: toggle
= "(CARRY)"; break;
272 default: toggle
= "(?)"; break;
274 switch (tmp
& TD_DP
) {
275 case TD_DP_SETUP
: pid
= "SETUP"; break;
276 case TD_DP_IN
: pid
= "IN"; break;
277 case TD_DP_OUT
: pid
= "OUT"; break;
278 default: pid
= "(bad pid)"; break;
280 ohci_dbg (ohci
, " info %08x CC=%x %s DI=%d %s %s\n", tmp
,
281 TD_CC_GET(tmp
), /* EC, */ toggle
,
282 (tmp
& TD_DI
) >> 21, pid
,
283 (tmp
& TD_R
) ? "R" : "");
284 cbp
= hc32_to_cpup (ohci
, &td
->hwCBP
);
285 be
= hc32_to_cpup (ohci
, &td
->hwBE
);
286 ohci_dbg (ohci
, " cbp %08x be %08x (len %d)\n", cbp
, be
,
287 cbp
? (be
+ 1 - cbp
) : 0);
290 ohci_dbg (ohci
, " info %08x CC=%x FC=%d DI=%d SF=%04x\n", tmp
,
295 ohci_dbg (ohci
, " bp0 %08x be %08x\n",
296 hc32_to_cpup (ohci
, &td
->hwCBP
) & ~0x0fff,
297 hc32_to_cpup (ohci
, &td
->hwBE
));
298 for (i
= 0; i
< MAXPSW
; i
++) {
299 u16 psw
= ohci_hwPSW (ohci
, td
, i
);
300 int cc
= (psw
>> 12) & 0x0f;
301 ohci_dbg (ohci
, " psw [%d] = %2x, CC=%x %s=%d\n", i
,
303 (cc
>= 0x0e) ? "OFFSET" : "SIZE",
309 /* caller MUST own hcd spinlock if verbose is set! */
310 static void __maybe_unused
311 ohci_dump_ed (const struct ohci_hcd
*ohci
, const char *label
,
312 const struct ed
*ed
, int verbose
)
314 u32 tmp
= hc32_to_cpu (ohci
, ed
->hwINFO
);
317 ohci_dbg (ohci
, "%s, ed %p state 0x%x type %s; next ed %08x\n",
319 ed
, ed
->state
, edstring (ed
->type
),
320 hc32_to_cpup (ohci
, &ed
->hwNextED
));
321 switch (tmp
& (ED_IN
|ED_OUT
)) {
322 case ED_OUT
: type
= "-OUT"; break;
323 case ED_IN
: type
= "-IN"; break;
324 /* else from TDs ... control */
327 " info %08x MAX=%d%s%s%s%s EP=%d%s DEV=%d\n", tmp
,
328 0x03ff & (tmp
>> 16),
329 (tmp
& ED_DEQUEUE
) ? " DQ" : "",
330 (tmp
& ED_ISO
) ? " ISO" : "",
331 (tmp
& ED_SKIP
) ? " SKIP" : "",
332 (tmp
& ED_LOWSPEED
) ? " LOW" : "",
336 tmp
= hc32_to_cpup (ohci
, &ed
->hwHeadP
);
337 ohci_dbg (ohci
, " tds: head %08x %s%s tail %08x%s\n",
339 (tmp
& ED_C
) ? data1
: data0
,
340 (tmp
& ED_H
) ? " HALT" : "",
341 hc32_to_cpup (ohci
, &ed
->hwTailP
),
342 verbose
? "" : " (not listing)");
344 struct list_head
*tmp
;
346 /* use ed->td_list because HC concurrently modifies
347 * hwNextTD as it accumulates ed_donelist.
349 list_for_each (tmp
, &ed
->td_list
) {
351 td
= list_entry (tmp
, struct td
, td_list
);
352 ohci_dump_td (ohci
, " ->", td
);
357 /*-------------------------------------------------------------------------*/
359 static int debug_async_open(struct inode
*, struct file
*);
360 static int debug_periodic_open(struct inode
*, struct file
*);
361 static int debug_registers_open(struct inode
*, struct file
*);
362 static int debug_async_open(struct inode
*, struct file
*);
363 static ssize_t
debug_output(struct file
*, char __user
*, size_t, loff_t
*);
364 static int debug_close(struct inode
*, struct file
*);
366 static const struct file_operations debug_async_fops
= {
367 .owner
= THIS_MODULE
,
368 .open
= debug_async_open
,
369 .read
= debug_output
,
370 .release
= debug_close
,
371 .llseek
= default_llseek
,
373 static const struct file_operations debug_periodic_fops
= {
374 .owner
= THIS_MODULE
,
375 .open
= debug_periodic_open
,
376 .read
= debug_output
,
377 .release
= debug_close
,
378 .llseek
= default_llseek
,
380 static const struct file_operations debug_registers_fops
= {
381 .owner
= THIS_MODULE
,
382 .open
= debug_registers_open
,
383 .read
= debug_output
,
384 .release
= debug_close
,
385 .llseek
= default_llseek
,
388 static struct dentry
*ohci_debug_root
;
390 struct debug_buffer
{
391 ssize_t (*fill_func
)(struct debug_buffer
*); /* fill method */
392 struct ohci_hcd
*ohci
;
393 struct mutex mutex
; /* protect filling of buffer */
394 size_t count
; /* number of characters filled into buffer */
399 show_list (struct ohci_hcd
*ohci
, char *buf
, size_t count
, struct ed
*ed
)
401 unsigned temp
, size
= count
;
406 /* print first --> last */
410 /* dump a snapshot of the bulk or control schedule */
412 u32 info
= hc32_to_cpu (ohci
, ed
->hwINFO
);
413 u32 headp
= hc32_to_cpu (ohci
, ed
->hwHeadP
);
414 struct list_head
*entry
;
417 temp
= scnprintf (buf
, size
,
418 "ed/%p %cs dev%d ep%d%s max %d %08x%s%s %s",
420 (info
& ED_LOWSPEED
) ? 'l' : 'f',
423 (info
& ED_IN
) ? "in" : "out",
424 0x03ff & (info
>> 16),
426 (info
& ED_SKIP
) ? " s" : "",
427 (headp
& ED_H
) ? " H" : "",
428 (headp
& ED_C
) ? data1
: data0
);
432 list_for_each (entry
, &ed
->td_list
) {
435 td
= list_entry (entry
, struct td
, td_list
);
436 info
= hc32_to_cpup (ohci
, &td
->hwINFO
);
437 cbp
= hc32_to_cpup (ohci
, &td
->hwCBP
);
438 be
= hc32_to_cpup (ohci
, &td
->hwBE
);
439 temp
= scnprintf (buf
, size
,
440 "\n\ttd %p %s %d cc=%x urb %p (%08x)",
443 switch (info
& TD_DP
) {
444 case TD_DP_SETUP
: pid
= "setup"; break;
445 case TD_DP_IN
: pid
= "in"; break;
446 case TD_DP_OUT
: pid
= "out"; break;
447 default: pid
= "(?)"; break;
449 cbp
? (be
+ 1 - cbp
) : 0,
450 TD_CC_GET (info
), td
->urb
, info
);
455 temp
= scnprintf (buf
, size
, "\n");
464 static ssize_t
fill_async_buffer(struct debug_buffer
*buf
)
466 struct ohci_hcd
*ohci
;
472 /* display control and bulk lists together, for simplicity */
473 spin_lock_irqsave (&ohci
->lock
, flags
);
474 temp
= show_list(ohci
, buf
->page
, buf
->count
, ohci
->ed_controltail
);
475 temp
+= show_list(ohci
, buf
->page
+ temp
, buf
->count
- temp
,
477 spin_unlock_irqrestore (&ohci
->lock
, flags
);
482 #define DBG_SCHED_LIMIT 64
484 static ssize_t
fill_periodic_buffer(struct debug_buffer
*buf
)
486 struct ohci_hcd
*ohci
;
487 struct ed
**seen
, *ed
;
489 unsigned temp
, size
, seen_count
;
493 if (!(seen
= kmalloc (DBG_SCHED_LIMIT
* sizeof *seen
, GFP_ATOMIC
)))
501 temp
= scnprintf (next
, size
, "size = %d\n", NUM_INTS
);
505 /* dump a snapshot of the periodic schedule (and load) */
506 spin_lock_irqsave (&ohci
->lock
, flags
);
507 for (i
= 0; i
< NUM_INTS
; i
++) {
508 if (!(ed
= ohci
->periodic
[i
]))
511 temp
= scnprintf (next
, size
, "%2d [%3d]:", i
, ohci
->load
[i
]);
516 temp
= scnprintf (next
, size
, " ed%d/%p",
520 for (temp
= 0; temp
< seen_count
; temp
++) {
521 if (seen
[temp
] == ed
)
525 /* show more info the first time around */
526 if (temp
== seen_count
) {
527 u32 info
= hc32_to_cpu (ohci
, ed
->hwINFO
);
528 struct list_head
*entry
;
531 /* qlen measured here in TDs, not urbs */
532 list_for_each (entry
, &ed
->td_list
)
535 temp
= scnprintf (next
, size
,
536 " (%cs dev%d ep%d%s-%s qlen %u"
538 (info
& ED_LOWSPEED
) ? 'l' : 'f',
541 (info
& ED_IN
) ? "in" : "out",
542 (info
& ED_ISO
) ? "iso" : "int",
544 0x03ff & (info
>> 16),
546 (info
& ED_SKIP
) ? " K" : "",
548 cpu_to_hc32(ohci
, ED_H
)) ?
553 if (seen_count
< DBG_SCHED_LIMIT
)
554 seen
[seen_count
++] = ed
;
559 /* we've seen it and what's after */
566 temp
= scnprintf (next
, size
, "\n");
570 spin_unlock_irqrestore (&ohci
->lock
, flags
);
573 return PAGE_SIZE
- size
;
575 #undef DBG_SCHED_LIMIT
577 static ssize_t
fill_registers_buffer(struct debug_buffer
*buf
)
580 struct ohci_hcd
*ohci
;
581 struct ohci_regs __iomem
*regs
;
588 hcd
= ohci_to_hcd(ohci
);
593 spin_lock_irqsave (&ohci
->lock
, flags
);
595 /* dump driver info, then registers in spec order */
597 ohci_dbg_nosw(ohci
, &next
, &size
,
598 "bus %s, device %s\n"
601 hcd
->self
.controller
->bus
->name
,
602 dev_name(hcd
->self
.controller
),
606 if (!HCD_HW_ACCESSIBLE(hcd
)) {
607 size
-= scnprintf (next
, size
,
608 "SUSPENDED (no register access)\n");
612 ohci_dump_status(ohci
, &next
, &size
);
616 ohci_dbg_nosw(ohci
, &next
, &size
,
617 "hcca frame 0x%04x\n", ohci_frame_no(ohci
));
619 /* other registers mostly affect frame timings */
620 rdata
= ohci_readl (ohci
, ®s
->fminterval
);
621 temp
= scnprintf (next
, size
,
622 "fmintvl 0x%08x %sFSMPS=0x%04x FI=0x%04x\n",
623 rdata
, (rdata
>> 31) ? "FIT " : "",
624 (rdata
>> 16) & 0xefff, rdata
& 0xffff);
628 rdata
= ohci_readl (ohci
, ®s
->fmremaining
);
629 temp
= scnprintf (next
, size
, "fmremaining 0x%08x %sFR=0x%04x\n",
630 rdata
, (rdata
>> 31) ? "FRT " : "",
635 rdata
= ohci_readl (ohci
, ®s
->periodicstart
);
636 temp
= scnprintf (next
, size
, "periodicstart 0x%04x\n",
641 rdata
= ohci_readl (ohci
, ®s
->lsthresh
);
642 temp
= scnprintf (next
, size
, "lsthresh 0x%04x\n",
647 temp
= scnprintf (next
, size
, "hub poll timer %s\n",
648 HCD_POLL_RH(ohci_to_hcd(ohci
)) ? "ON" : "off");
653 ohci_dump_roothub (ohci
, 1, &next
, &size
);
656 spin_unlock_irqrestore (&ohci
->lock
, flags
);
658 return PAGE_SIZE
- size
;
661 static struct debug_buffer
*alloc_buffer(struct ohci_hcd
*ohci
,
662 ssize_t (*fill_func
)(struct debug_buffer
*))
664 struct debug_buffer
*buf
;
666 buf
= kzalloc(sizeof(struct debug_buffer
), GFP_KERNEL
);
670 buf
->fill_func
= fill_func
;
671 mutex_init(&buf
->mutex
);
677 static int fill_buffer(struct debug_buffer
*buf
)
682 buf
->page
= (char *)get_zeroed_page(GFP_KERNEL
);
689 ret
= buf
->fill_func(buf
);
700 static ssize_t
debug_output(struct file
*file
, char __user
*user_buf
,
701 size_t len
, loff_t
*offset
)
703 struct debug_buffer
*buf
= file
->private_data
;
706 mutex_lock(&buf
->mutex
);
707 if (buf
->count
== 0) {
708 ret
= fill_buffer(buf
);
710 mutex_unlock(&buf
->mutex
);
714 mutex_unlock(&buf
->mutex
);
716 ret
= simple_read_from_buffer(user_buf
, len
, offset
,
717 buf
->page
, buf
->count
);
724 static int debug_close(struct inode
*inode
, struct file
*file
)
726 struct debug_buffer
*buf
= file
->private_data
;
730 free_page((unsigned long)buf
->page
);
736 static int debug_async_open(struct inode
*inode
, struct file
*file
)
738 file
->private_data
= alloc_buffer(inode
->i_private
, fill_async_buffer
);
740 return file
->private_data
? 0 : -ENOMEM
;
743 static int debug_periodic_open(struct inode
*inode
, struct file
*file
)
745 file
->private_data
= alloc_buffer(inode
->i_private
,
746 fill_periodic_buffer
);
748 return file
->private_data
? 0 : -ENOMEM
;
751 static int debug_registers_open(struct inode
*inode
, struct file
*file
)
753 file
->private_data
= alloc_buffer(inode
->i_private
,
754 fill_registers_buffer
);
756 return file
->private_data
? 0 : -ENOMEM
;
758 static inline void create_debug_files (struct ohci_hcd
*ohci
)
760 struct usb_bus
*bus
= &ohci_to_hcd(ohci
)->self
;
762 ohci
->debug_dir
= debugfs_create_dir(bus
->bus_name
, ohci_debug_root
);
763 if (!ohci
->debug_dir
)
766 ohci
->debug_async
= debugfs_create_file("async", S_IRUGO
,
767 ohci
->debug_dir
, ohci
,
769 if (!ohci
->debug_async
)
772 ohci
->debug_periodic
= debugfs_create_file("periodic", S_IRUGO
,
773 ohci
->debug_dir
, ohci
,
774 &debug_periodic_fops
);
775 if (!ohci
->debug_periodic
)
778 ohci
->debug_registers
= debugfs_create_file("registers", S_IRUGO
,
779 ohci
->debug_dir
, ohci
,
780 &debug_registers_fops
);
781 if (!ohci
->debug_registers
)
782 goto registers_error
;
784 ohci_dbg (ohci
, "created debug files\n");
788 debugfs_remove(ohci
->debug_periodic
);
790 debugfs_remove(ohci
->debug_async
);
792 debugfs_remove(ohci
->debug_dir
);
794 ohci
->debug_periodic
= NULL
;
795 ohci
->debug_async
= NULL
;
796 ohci
->debug_dir
= NULL
;
799 static inline void remove_debug_files (struct ohci_hcd
*ohci
)
801 debugfs_remove(ohci
->debug_registers
);
802 debugfs_remove(ohci
->debug_periodic
);
803 debugfs_remove(ohci
->debug_async
);
804 debugfs_remove(ohci
->debug_dir
);
807 /*-------------------------------------------------------------------------*/