diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-10 18:05:02 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-10 18:05:02 -0400 |
commit | 9895850b23886e030cd1e7241d5529a57e969c3d (patch) | |
tree | 1061626db450aeb72dcfcd247c24b33e5238c8c4 /drivers/usb/host/uhci-debug.c | |
parent | fc385c313275b114bc6ad36e60c5177d63250548 (diff) | |
parent | b58af4066d240b18b43f202e07b9ec7461d90b17 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (148 commits)
USB: serial: fix stalled writes
USB: remove fake "address-of" expressions
USB: fix thread-unsafe anchor utiliy routines
USB: usbtest: support test device with only one iso-in or iso-out endpoint
USB: usbtest: avoid to free coherent buffer in atomic context
USB: xhci: Set DMA mask for host.
USB: xhci: Don't flush doorbell writes.
USB: xhci: Reduce reads and writes of interrupter registers.
USB: xhci: Make xhci_set_hc_event_deq() static.
USB: xhci: Minimize HW event ring dequeue pointer writes.
USB: xhci: Make xhci_handle_event() static.
USB: xhci: Remove unnecessary reads of IRQ_PENDING register.
USB: xhci: Performance - move xhci_work() into xhci_irq()
USB: xhci: Performance - move interrupt handlers into xhci-ring.c
USB: xhci: Performance - move functions that find ep ring.
USB:: fix linux/usb.h kernel-doc warnings
USB: add USB serial ssu100 driver
USB: usb-storage: implement autosuspend
USB: ehci: fix remove of ehci debugfs dir
USB: Add USB 2.0 to ssb ohci driver
...
Diffstat (limited to 'drivers/usb/host/uhci-debug.c')
-rw-r--r-- | drivers/usb/host/uhci-debug.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/drivers/usb/host/uhci-debug.c b/drivers/usb/host/uhci-debug.c index 98cf0b26b968..6e7fb5f38db6 100644 --- a/drivers/usb/host/uhci-debug.c +++ b/drivers/usb/host/uhci-debug.c | |||
@@ -17,7 +17,6 @@ | |||
17 | 17 | ||
18 | #include "uhci-hcd.h" | 18 | #include "uhci-hcd.h" |
19 | 19 | ||
20 | #define uhci_debug_operations (* (const struct file_operations *) NULL) | ||
21 | static struct dentry *uhci_debugfs_root; | 20 | static struct dentry *uhci_debugfs_root; |
22 | 21 | ||
23 | #ifdef DEBUG | 22 | #ifdef DEBUG |
@@ -495,18 +494,16 @@ static int uhci_debug_open(struct inode *inode, struct file *file) | |||
495 | { | 494 | { |
496 | struct uhci_hcd *uhci = inode->i_private; | 495 | struct uhci_hcd *uhci = inode->i_private; |
497 | struct uhci_debug *up; | 496 | struct uhci_debug *up; |
498 | int ret = -ENOMEM; | ||
499 | unsigned long flags; | 497 | unsigned long flags; |
500 | 498 | ||
501 | lock_kernel(); | ||
502 | up = kmalloc(sizeof(*up), GFP_KERNEL); | 499 | up = kmalloc(sizeof(*up), GFP_KERNEL); |
503 | if (!up) | 500 | if (!up) |
504 | goto out; | 501 | return -ENOMEM; |
505 | 502 | ||
506 | up->data = kmalloc(MAX_OUTPUT, GFP_KERNEL); | 503 | up->data = kmalloc(MAX_OUTPUT, GFP_KERNEL); |
507 | if (!up->data) { | 504 | if (!up->data) { |
508 | kfree(up); | 505 | kfree(up); |
509 | goto out; | 506 | return -ENOMEM; |
510 | } | 507 | } |
511 | 508 | ||
512 | up->size = 0; | 509 | up->size = 0; |
@@ -517,10 +514,7 @@ static int uhci_debug_open(struct inode *inode, struct file *file) | |||
517 | 514 | ||
518 | file->private_data = up; | 515 | file->private_data = up; |
519 | 516 | ||
520 | ret = 0; | 517 | return 0; |
521 | out: | ||
522 | unlock_kernel(); | ||
523 | return ret; | ||
524 | } | 518 | } |
525 | 519 | ||
526 | static loff_t uhci_debug_lseek(struct file *file, loff_t off, int whence) | 520 | static loff_t uhci_debug_lseek(struct file *file, loff_t off, int whence) |
@@ -528,9 +522,9 @@ static loff_t uhci_debug_lseek(struct file *file, loff_t off, int whence) | |||
528 | struct uhci_debug *up; | 522 | struct uhci_debug *up; |
529 | loff_t new = -1; | 523 | loff_t new = -1; |
530 | 524 | ||
531 | lock_kernel(); | ||
532 | up = file->private_data; | 525 | up = file->private_data; |
533 | 526 | ||
527 | /* XXX: atomic 64bit seek access, but that needs to be fixed in the VFS */ | ||
534 | switch (whence) { | 528 | switch (whence) { |
535 | case 0: | 529 | case 0: |
536 | new = off; | 530 | new = off; |
@@ -539,11 +533,10 @@ static loff_t uhci_debug_lseek(struct file *file, loff_t off, int whence) | |||
539 | new = file->f_pos + off; | 533 | new = file->f_pos + off; |
540 | break; | 534 | break; |
541 | } | 535 | } |
542 | if (new < 0 || new > up->size) { | 536 | |
543 | unlock_kernel(); | 537 | if (new < 0 || new > up->size) |
544 | return -EINVAL; | 538 | return -EINVAL; |
545 | } | 539 | |
546 | unlock_kernel(); | ||
547 | return (file->f_pos = new); | 540 | return (file->f_pos = new); |
548 | } | 541 | } |
549 | 542 | ||
@@ -564,7 +557,6 @@ static int uhci_debug_release(struct inode *inode, struct file *file) | |||
564 | return 0; | 557 | return 0; |
565 | } | 558 | } |
566 | 559 | ||
567 | #undef uhci_debug_operations | ||
568 | static const struct file_operations uhci_debug_operations = { | 560 | static const struct file_operations uhci_debug_operations = { |
569 | .owner = THIS_MODULE, | 561 | .owner = THIS_MODULE, |
570 | .open = uhci_debug_open, | 562 | .open = uhci_debug_open, |
@@ -572,6 +564,7 @@ static const struct file_operations uhci_debug_operations = { | |||
572 | .read = uhci_debug_read, | 564 | .read = uhci_debug_read, |
573 | .release = uhci_debug_release, | 565 | .release = uhci_debug_release, |
574 | }; | 566 | }; |
567 | #define UHCI_DEBUG_OPS | ||
575 | 568 | ||
576 | #endif /* CONFIG_DEBUG_FS */ | 569 | #endif /* CONFIG_DEBUG_FS */ |
577 | 570 | ||