aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/misc/legousbtower.c
diff options
context:
space:
mode:
authorHarvey Harrison <harvey.harrison@gmail.com>2008-03-03 19:08:34 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2008-04-25 00:16:55 -0400
commit441b62c1edb986827154768d89bbac0ba779984f (patch)
tree13724c22d1b190a36f0ddbba38554e6c66bea6af /drivers/usb/misc/legousbtower.c
parent14722ef4acedc643f0b78b7165ceff2d300dae4d (diff)
USB: replace remaining __FUNCTION__ occurrences
__FUNCTION__ is gcc-specific, use __func__ Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/misc/legousbtower.c')
-rw-r--r--drivers/usb/misc/legousbtower.c88
1 files changed, 44 insertions, 44 deletions
diff --git a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c
index 6664043f4645..fae5b1730ba2 100644
--- a/drivers/usb/misc/legousbtower.c
+++ b/drivers/usb/misc/legousbtower.c
@@ -31,7 +31,7 @@
31 * - imported into lejos project 31 * - imported into lejos project
32 * - changed wake_up to wake_up_interruptible 32 * - changed wake_up to wake_up_interruptible
33 * - changed to use lego0 rather than tower0 33 * - changed to use lego0 rather than tower0
34 * - changed dbg() to use __func__ rather than deprecated __FUNCTION__ 34 * - changed dbg() to use __func__ rather than deprecated __func__
35 * 2003-01-12 - 0.53 david (david@csse.uwa.edu.au) 35 * 2003-01-12 - 0.53 david (david@csse.uwa.edu.au)
36 * - changed read and write to write everything or 36 * - changed read and write to write everything or
37 * timeout (from a patch by Chris Riesen and Brett Thaeler driver) 37 * timeout (from a patch by Chris Riesen and Brett Thaeler driver)
@@ -49,7 +49,7 @@
49 * - added poll 49 * - added poll
50 * - forbid seeking 50 * - forbid seeking
51 * - added nonblocking I/O 51 * - added nonblocking I/O
52 * - changed back __func__ to __FUNCTION__ 52 * - changed back __func__ to __func__
53 * - read and log tower firmware version 53 * - read and log tower firmware version
54 * - reset tower on probe, avoids failure of first write 54 * - reset tower on probe, avoids failure of first write
55 * 2004-03-09 - 0.7 Juergen Stuber <starblue@users.sourceforge.net> 55 * 2004-03-09 - 0.7 Juergen Stuber <starblue@users.sourceforge.net>
@@ -309,7 +309,7 @@ static inline void lego_usb_tower_debug_data (int level, const char *function, i
309 */ 309 */
310static inline void tower_delete (struct lego_usb_tower *dev) 310static inline void tower_delete (struct lego_usb_tower *dev)
311{ 311{
312 dbg(2, "%s: enter", __FUNCTION__); 312 dbg(2, "%s: enter", __func__);
313 313
314 tower_abort_transfers (dev); 314 tower_abort_transfers (dev);
315 315
@@ -321,7 +321,7 @@ static inline void tower_delete (struct lego_usb_tower *dev)
321 kfree (dev->interrupt_out_buffer); 321 kfree (dev->interrupt_out_buffer);
322 kfree (dev); 322 kfree (dev);
323 323
324 dbg(2, "%s: leave", __FUNCTION__); 324 dbg(2, "%s: leave", __func__);
325} 325}
326 326
327 327
@@ -337,7 +337,7 @@ static int tower_open (struct inode *inode, struct file *file)
337 struct tower_reset_reply reset_reply; 337 struct tower_reset_reply reset_reply;
338 int result; 338 int result;
339 339
340 dbg(2, "%s: enter", __FUNCTION__); 340 dbg(2, "%s: enter", __func__);
341 341
342 nonseekable_open(inode, file); 342 nonseekable_open(inode, file);
343 subminor = iminor(inode); 343 subminor = iminor(inode);
@@ -346,7 +346,7 @@ static int tower_open (struct inode *inode, struct file *file)
346 346
347 if (!interface) { 347 if (!interface) {
348 err ("%s - error, can't find device for minor %d", 348 err ("%s - error, can't find device for minor %d",
349 __FUNCTION__, subminor); 349 __func__, subminor);
350 retval = -ENODEV; 350 retval = -ENODEV;
351 goto exit; 351 goto exit;
352 } 352 }
@@ -424,7 +424,7 @@ unlock_exit:
424 mutex_unlock(&dev->lock); 424 mutex_unlock(&dev->lock);
425 425
426exit: 426exit:
427 dbg(2, "%s: leave, return value %d ", __FUNCTION__, retval); 427 dbg(2, "%s: leave, return value %d ", __func__, retval);
428 428
429 return retval; 429 return retval;
430} 430}
@@ -437,12 +437,12 @@ static int tower_release (struct inode *inode, struct file *file)
437 struct lego_usb_tower *dev; 437 struct lego_usb_tower *dev;
438 int retval = 0; 438 int retval = 0;
439 439
440 dbg(2, "%s: enter", __FUNCTION__); 440 dbg(2, "%s: enter", __func__);
441 441
442 dev = (struct lego_usb_tower *)file->private_data; 442 dev = (struct lego_usb_tower *)file->private_data;
443 443
444 if (dev == NULL) { 444 if (dev == NULL) {
445 dbg(1, "%s: object is NULL", __FUNCTION__); 445 dbg(1, "%s: object is NULL", __func__);
446 retval = -ENODEV; 446 retval = -ENODEV;
447 goto exit_nolock; 447 goto exit_nolock;
448 } 448 }
@@ -454,7 +454,7 @@ static int tower_release (struct inode *inode, struct file *file)
454 } 454 }
455 455
456 if (dev->open_count != 1) { 456 if (dev->open_count != 1) {
457 dbg(1, "%s: device not opened exactly once", __FUNCTION__); 457 dbg(1, "%s: device not opened exactly once", __func__);
458 retval = -ENODEV; 458 retval = -ENODEV;
459 goto unlock_exit; 459 goto unlock_exit;
460 } 460 }
@@ -480,7 +480,7 @@ unlock_exit:
480exit: 480exit:
481 mutex_unlock(&open_disc_mutex); 481 mutex_unlock(&open_disc_mutex);
482exit_nolock: 482exit_nolock:
483 dbg(2, "%s: leave, return value %d", __FUNCTION__, retval); 483 dbg(2, "%s: leave, return value %d", __func__, retval);
484 return retval; 484 return retval;
485} 485}
486 486
@@ -491,10 +491,10 @@ exit_nolock:
491 */ 491 */
492static void tower_abort_transfers (struct lego_usb_tower *dev) 492static void tower_abort_transfers (struct lego_usb_tower *dev)
493{ 493{
494 dbg(2, "%s: enter", __FUNCTION__); 494 dbg(2, "%s: enter", __func__);
495 495
496 if (dev == NULL) { 496 if (dev == NULL) {
497 dbg(1, "%s: dev is null", __FUNCTION__); 497 dbg(1, "%s: dev is null", __func__);
498 goto exit; 498 goto exit;
499 } 499 }
500 500
@@ -509,7 +509,7 @@ static void tower_abort_transfers (struct lego_usb_tower *dev)
509 usb_kill_urb(dev->interrupt_out_urb); 509 usb_kill_urb(dev->interrupt_out_urb);
510 510
511exit: 511exit:
512 dbg(2, "%s: leave", __FUNCTION__); 512 dbg(2, "%s: leave", __func__);
513} 513}
514 514
515 515
@@ -542,7 +542,7 @@ static unsigned int tower_poll (struct file *file, poll_table *wait)
542 struct lego_usb_tower *dev; 542 struct lego_usb_tower *dev;
543 unsigned int mask = 0; 543 unsigned int mask = 0;
544 544
545 dbg(2, "%s: enter", __FUNCTION__); 545 dbg(2, "%s: enter", __func__);
546 546
547 dev = file->private_data; 547 dev = file->private_data;
548 548
@@ -557,7 +557,7 @@ static unsigned int tower_poll (struct file *file, poll_table *wait)
557 mask |= POLLOUT | POLLWRNORM; 557 mask |= POLLOUT | POLLWRNORM;
558 } 558 }
559 559
560 dbg(2, "%s: leave, mask = %d", __FUNCTION__, mask); 560 dbg(2, "%s: leave, mask = %d", __func__, mask);
561 561
562 return mask; 562 return mask;
563} 563}
@@ -583,7 +583,7 @@ static ssize_t tower_read (struct file *file, char __user *buffer, size_t count,
583 int retval = 0; 583 int retval = 0;
584 unsigned long timeout = 0; 584 unsigned long timeout = 0;
585 585
586 dbg(2, "%s: enter, count = %Zd", __FUNCTION__, count); 586 dbg(2, "%s: enter, count = %Zd", __func__, count);
587 587
588 dev = (struct lego_usb_tower *)file->private_data; 588 dev = (struct lego_usb_tower *)file->private_data;
589 589
@@ -602,7 +602,7 @@ static ssize_t tower_read (struct file *file, char __user *buffer, size_t count,
602 602
603 /* verify that we actually have some data to read */ 603 /* verify that we actually have some data to read */
604 if (count == 0) { 604 if (count == 0) {
605 dbg(1, "%s: read request of 0 bytes", __FUNCTION__); 605 dbg(1, "%s: read request of 0 bytes", __func__);
606 goto unlock_exit; 606 goto unlock_exit;
607 } 607 }
608 608
@@ -658,7 +658,7 @@ unlock_exit:
658 mutex_unlock(&dev->lock); 658 mutex_unlock(&dev->lock);
659 659
660exit: 660exit:
661 dbg(2, "%s: leave, return value %d", __FUNCTION__, retval); 661 dbg(2, "%s: leave, return value %d", __func__, retval);
662 return retval; 662 return retval;
663} 663}
664 664
@@ -672,7 +672,7 @@ static ssize_t tower_write (struct file *file, const char __user *buffer, size_t
672 size_t bytes_to_write; 672 size_t bytes_to_write;
673 int retval = 0; 673 int retval = 0;
674 674
675 dbg(2, "%s: enter, count = %Zd", __FUNCTION__, count); 675 dbg(2, "%s: enter, count = %Zd", __func__, count);
676 676
677 dev = (struct lego_usb_tower *)file->private_data; 677 dev = (struct lego_usb_tower *)file->private_data;
678 678
@@ -691,7 +691,7 @@ static ssize_t tower_write (struct file *file, const char __user *buffer, size_t
691 691
692 /* verify that we actually have some data to write */ 692 /* verify that we actually have some data to write */
693 if (count == 0) { 693 if (count == 0) {
694 dbg(1, "%s: write request of 0 bytes", __FUNCTION__); 694 dbg(1, "%s: write request of 0 bytes", __func__);
695 goto unlock_exit; 695 goto unlock_exit;
696 } 696 }
697 697
@@ -709,7 +709,7 @@ static ssize_t tower_write (struct file *file, const char __user *buffer, size_t
709 709
710 /* write the data into interrupt_out_buffer from userspace */ 710 /* write the data into interrupt_out_buffer from userspace */
711 bytes_to_write = min_t(int, count, write_buffer_size); 711 bytes_to_write = min_t(int, count, write_buffer_size);
712 dbg(4, "%s: count = %Zd, bytes_to_write = %Zd", __FUNCTION__, count, bytes_to_write); 712 dbg(4, "%s: count = %Zd, bytes_to_write = %Zd", __func__, count, bytes_to_write);
713 713
714 if (copy_from_user (dev->interrupt_out_buffer, buffer, bytes_to_write)) { 714 if (copy_from_user (dev->interrupt_out_buffer, buffer, bytes_to_write)) {
715 retval = -EFAULT; 715 retval = -EFAULT;
@@ -742,7 +742,7 @@ unlock_exit:
742 mutex_unlock(&dev->lock); 742 mutex_unlock(&dev->lock);
743 743
744exit: 744exit:
745 dbg(2, "%s: leave, return value %d", __FUNCTION__, retval); 745 dbg(2, "%s: leave, return value %d", __func__, retval);
746 746
747 return retval; 747 return retval;
748} 748}
@@ -757,9 +757,9 @@ static void tower_interrupt_in_callback (struct urb *urb)
757 int status = urb->status; 757 int status = urb->status;
758 int retval; 758 int retval;
759 759
760 dbg(4, "%s: enter, status %d", __FUNCTION__, status); 760 dbg(4, "%s: enter, status %d", __func__, status);
761 761
762 lego_usb_tower_debug_data(5, __FUNCTION__, urb->actual_length, urb->transfer_buffer); 762 lego_usb_tower_debug_data(5, __func__, urb->actual_length, urb->transfer_buffer);
763 763
764 if (status) { 764 if (status) {
765 if (status == -ENOENT || 765 if (status == -ENOENT ||
@@ -767,7 +767,7 @@ static void tower_interrupt_in_callback (struct urb *urb)
767 status == -ESHUTDOWN) { 767 status == -ESHUTDOWN) {
768 goto exit; 768 goto exit;
769 } else { 769 } else {
770 dbg(1, "%s: nonzero status received: %d", __FUNCTION__, status); 770 dbg(1, "%s: nonzero status received: %d", __func__, status);
771 goto resubmit; /* maybe we can recover */ 771 goto resubmit; /* maybe we can recover */
772 } 772 }
773 } 773 }
@@ -780,9 +780,9 @@ static void tower_interrupt_in_callback (struct urb *urb)
780 urb->actual_length); 780 urb->actual_length);
781 dev->read_buffer_length += urb->actual_length; 781 dev->read_buffer_length += urb->actual_length;
782 dev->read_last_arrival = jiffies; 782 dev->read_last_arrival = jiffies;
783 dbg(3, "%s: received %d bytes", __FUNCTION__, urb->actual_length); 783 dbg(3, "%s: received %d bytes", __func__, urb->actual_length);
784 } else { 784 } else {
785 printk(KERN_WARNING "%s: read_buffer overflow, %d bytes dropped", __FUNCTION__, urb->actual_length); 785 printk(KERN_WARNING "%s: read_buffer overflow, %d bytes dropped", __func__, urb->actual_length);
786 } 786 }
787 spin_unlock (&dev->read_buffer_lock); 787 spin_unlock (&dev->read_buffer_lock);
788 } 788 }
@@ -792,7 +792,7 @@ resubmit:
792 if (dev->interrupt_in_running && dev->udev) { 792 if (dev->interrupt_in_running && dev->udev) {
793 retval = usb_submit_urb (dev->interrupt_in_urb, GFP_ATOMIC); 793 retval = usb_submit_urb (dev->interrupt_in_urb, GFP_ATOMIC);
794 if (retval) { 794 if (retval) {
795 err("%s: usb_submit_urb failed (%d)", __FUNCTION__, retval); 795 err("%s: usb_submit_urb failed (%d)", __func__, retval);
796 } 796 }
797 } 797 }
798 798
@@ -800,8 +800,8 @@ exit:
800 dev->interrupt_in_done = 1; 800 dev->interrupt_in_done = 1;
801 wake_up_interruptible (&dev->read_wait); 801 wake_up_interruptible (&dev->read_wait);
802 802
803 lego_usb_tower_debug_data(5, __FUNCTION__, urb->actual_length, urb->transfer_buffer); 803 lego_usb_tower_debug_data(5, __func__, urb->actual_length, urb->transfer_buffer);
804 dbg(4, "%s: leave, status %d", __FUNCTION__, status); 804 dbg(4, "%s: leave, status %d", __func__, status);
805} 805}
806 806
807 807
@@ -813,22 +813,22 @@ static void tower_interrupt_out_callback (struct urb *urb)
813 struct lego_usb_tower *dev = (struct lego_usb_tower *)urb->context; 813 struct lego_usb_tower *dev = (struct lego_usb_tower *)urb->context;
814 int status = urb->status; 814 int status = urb->status;
815 815
816 dbg(4, "%s: enter, status %d", __FUNCTION__, status); 816 dbg(4, "%s: enter, status %d", __func__, status);
817 lego_usb_tower_debug_data(5, __FUNCTION__, urb->actual_length, urb->transfer_buffer); 817 lego_usb_tower_debug_data(5, __func__, urb->actual_length, urb->transfer_buffer);
818 818
819 /* sync/async unlink faults aren't errors */ 819 /* sync/async unlink faults aren't errors */
820 if (status && !(status == -ENOENT || 820 if (status && !(status == -ENOENT ||
821 status == -ECONNRESET || 821 status == -ECONNRESET ||
822 status == -ESHUTDOWN)) { 822 status == -ESHUTDOWN)) {
823 dbg(1, "%s - nonzero write bulk status received: %d", 823 dbg(1, "%s - nonzero write bulk status received: %d",
824 __FUNCTION__, status); 824 __func__, status);
825 } 825 }
826 826
827 dev->interrupt_out_busy = 0; 827 dev->interrupt_out_busy = 0;
828 wake_up_interruptible(&dev->write_wait); 828 wake_up_interruptible(&dev->write_wait);
829 829
830 lego_usb_tower_debug_data(5, __FUNCTION__, urb->actual_length, urb->transfer_buffer); 830 lego_usb_tower_debug_data(5, __func__, urb->actual_length, urb->transfer_buffer);
831 dbg(4, "%s: leave, status %d", __FUNCTION__, status); 831 dbg(4, "%s: leave, status %d", __func__, status);
832} 832}
833 833
834 834
@@ -849,7 +849,7 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device
849 int retval = -ENOMEM; 849 int retval = -ENOMEM;
850 int result; 850 int result;
851 851
852 dbg(2, "%s: enter", __FUNCTION__); 852 dbg(2, "%s: enter", __func__);
853 853
854 if (udev == NULL) { 854 if (udev == NULL) {
855 info ("udev is NULL."); 855 info ("udev is NULL.");
@@ -978,7 +978,7 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device
978 978
979 979
980exit: 980exit:
981 dbg(2, "%s: leave, return value 0x%.8lx (dev)", __FUNCTION__, (long) dev); 981 dbg(2, "%s: leave, return value 0x%.8lx (dev)", __func__, (long) dev);
982 982
983 return retval; 983 return retval;
984 984
@@ -998,7 +998,7 @@ static void tower_disconnect (struct usb_interface *interface)
998 struct lego_usb_tower *dev; 998 struct lego_usb_tower *dev;
999 int minor; 999 int minor;
1000 1000
1001 dbg(2, "%s: enter", __FUNCTION__); 1001 dbg(2, "%s: enter", __func__);
1002 1002
1003 dev = usb_get_intfdata (interface); 1003 dev = usb_get_intfdata (interface);
1004 mutex_lock(&open_disc_mutex); 1004 mutex_lock(&open_disc_mutex);
@@ -1023,7 +1023,7 @@ static void tower_disconnect (struct usb_interface *interface)
1023 1023
1024 info("LEGO USB Tower #%d now disconnected", (minor - LEGO_USB_TOWER_MINOR_BASE)); 1024 info("LEGO USB Tower #%d now disconnected", (minor - LEGO_USB_TOWER_MINOR_BASE));
1025 1025
1026 dbg(2, "%s: leave", __FUNCTION__); 1026 dbg(2, "%s: leave", __func__);
1027} 1027}
1028 1028
1029 1029
@@ -1036,7 +1036,7 @@ static int __init lego_usb_tower_init(void)
1036 int result; 1036 int result;
1037 int retval = 0; 1037 int retval = 0;
1038 1038
1039 dbg(2, "%s: enter", __FUNCTION__); 1039 dbg(2, "%s: enter", __func__);
1040 1040
1041 /* register this driver with the USB subsystem */ 1041 /* register this driver with the USB subsystem */
1042 result = usb_register(&tower_driver); 1042 result = usb_register(&tower_driver);
@@ -1049,7 +1049,7 @@ static int __init lego_usb_tower_init(void)
1049 info(DRIVER_DESC " " DRIVER_VERSION); 1049 info(DRIVER_DESC " " DRIVER_VERSION);
1050 1050
1051exit: 1051exit:
1052 dbg(2, "%s: leave, return value %d", __FUNCTION__, retval); 1052 dbg(2, "%s: leave, return value %d", __func__, retval);
1053 1053
1054 return retval; 1054 return retval;
1055} 1055}
@@ -1060,12 +1060,12 @@ exit:
1060 */ 1060 */
1061static void __exit lego_usb_tower_exit(void) 1061static void __exit lego_usb_tower_exit(void)
1062{ 1062{
1063 dbg(2, "%s: enter", __FUNCTION__); 1063 dbg(2, "%s: enter", __func__);
1064 1064
1065 /* deregister this driver with the USB subsystem */ 1065 /* deregister this driver with the USB subsystem */
1066 usb_deregister (&tower_driver); 1066 usb_deregister (&tower_driver);
1067 1067
1068 dbg(2, "%s: leave", __FUNCTION__); 1068 dbg(2, "%s: leave", __func__);
1069} 1069}
1070 1070
1071module_init (lego_usb_tower_init); 1071module_init (lego_usb_tower_init);