Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: gadget: dummy_hcd: clean up checkpatch

This patch converts checkpatch output of
|./scripts/checkpatch.pl drivers/usb/gadget/dummy_hcd.c -file

from
|total: 22 errors, 174 warnings, 2642 lines checked

to
|total: 0 errors, 0 warnings, 2632 lines checked

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>

authored by

Sebastian Andrzej Siewior and committed by
Felipe Balbi
18f2cbaa 59f08e6d

+211 -221
+211 -221
drivers/usb/gadget/dummy_hcd.c
··· 42 42 #include <linux/scatterlist.h> 43 43 44 44 #include <asm/byteorder.h> 45 - #include <asm/io.h> 45 + #include <linux/io.h> 46 46 #include <asm/irq.h> 47 47 #include <asm/system.h> 48 48 #include <asm/unaligned.h> 49 - 50 49 51 50 #define DRIVER_DESC "USB Host+Gadget Emulator" 52 51 #define DRIVER_VERSION "02 May 2005" 53 52 54 53 #define POWER_BUDGET 500 /* in mA; use 8 for low-power port testing */ 55 54 56 - static const char driver_name [] = "dummy_hcd"; 57 - static const char driver_desc [] = "USB Host+Gadget Emulator"; 55 + static const char driver_name[] = "dummy_hcd"; 56 + static const char driver_desc[] = "USB Host+Gadget Emulator"; 58 57 59 - static const char gadget_name [] = "dummy_udc"; 58 + static const char gadget_name[] = "dummy_udc"; 60 59 61 - MODULE_DESCRIPTION (DRIVER_DESC); 62 - MODULE_AUTHOR ("David Brownell"); 63 - MODULE_LICENSE ("GPL"); 60 + MODULE_DESCRIPTION(DRIVER_DESC); 61 + MODULE_AUTHOR("David Brownell"); 62 + MODULE_LICENSE("GPL"); 64 63 65 64 struct dummy_hcd_module_parameters { 66 65 bool is_super_speed; ··· 83 84 struct usb_gadget *gadget; 84 85 const struct usb_endpoint_descriptor *desc; 85 86 struct usb_ep ep; 86 - unsigned halted : 1; 87 - unsigned wedged : 1; 88 - unsigned already_seen : 1; 89 - unsigned setup_stage : 1; 87 + unsigned halted:1; 88 + unsigned wedged:1; 89 + unsigned already_seen:1; 90 + unsigned setup_stage:1; 90 91 unsigned stream_en:1; 91 92 }; 92 93 ··· 95 96 struct usb_request req; 96 97 }; 97 98 98 - static inline struct dummy_ep *usb_ep_to_dummy_ep (struct usb_ep *_ep) 99 + static inline struct dummy_ep *usb_ep_to_dummy_ep(struct usb_ep *_ep) 99 100 { 100 - return container_of (_ep, struct dummy_ep, ep); 101 + return container_of(_ep, struct dummy_ep, ep); 101 102 } 102 103 103 104 static inline struct dummy_request *usb_request_to_dummy_request 104 105 (struct usb_request *_req) 105 106 { 106 - return container_of (_req, struct dummy_request, req); 107 + return container_of(_req, struct dummy_request, req); 107 108 } 108 109 109 110 /*-------------------------------------------------------------------------*/ ··· 122 123 * configurations, illegal or unsupported packet lengths, and so on. 123 124 */ 124 125 125 - static const char ep0name [] = "ep0"; 126 + static const char ep0name[] = "ep0"; 126 127 127 - static const char *const ep_name [] = { 128 + static const char *const ep_name[] = { 128 129 ep0name, /* everyone has ep0 */ 129 130 130 131 /* act like a net2280: high speed, six configurable endpoints */ ··· 183 184 /* 184 185 * SLAVE/GADGET side support 185 186 */ 186 - struct dummy_ep ep [DUMMY_ENDPOINTS]; 187 + struct dummy_ep ep[DUMMY_ENDPOINTS]; 187 188 int address; 188 189 struct usb_gadget gadget; 189 190 struct usb_gadget_driver *driver; 190 191 struct dummy_request fifo_req; 191 - u8 fifo_buf [FIFO_SIZE]; 192 + u8 fifo_buf[FIFO_SIZE]; 192 193 u16 devstatus; 193 194 unsigned udc_suspended:1; 194 195 unsigned pullup:1; ··· 215 216 return dummy_hcd_to_hcd(dum)->self.controller; 216 217 } 217 218 218 - static inline struct device *udc_dev (struct dummy *dum) 219 + static inline struct device *udc_dev(struct dummy *dum) 219 220 { 220 221 return dum->gadget.dev.parent; 221 222 } 222 223 223 - static inline struct dummy *ep_to_dummy (struct dummy_ep *ep) 224 + static inline struct dummy *ep_to_dummy(struct dummy_ep *ep) 224 225 { 225 - return container_of (ep->gadget, struct dummy, gadget); 226 + return container_of(ep->gadget, struct dummy, gadget); 226 227 } 227 228 228 229 static inline struct dummy_hcd *gadget_to_dummy_hcd(struct usb_gadget *gadget) ··· 234 235 return dum->hs_hcd; 235 236 } 236 237 237 - static inline struct dummy *gadget_dev_to_dummy (struct device *dev) 238 + static inline struct dummy *gadget_dev_to_dummy(struct device *dev) 238 239 { 239 - return container_of (dev, struct dummy, gadget.dev); 240 + return container_of(dev, struct dummy, gadget.dev); 240 241 } 241 242 242 243 static struct dummy the_controller; ··· 246 247 /* SLAVE/GADGET SIDE UTILITY ROUTINES */ 247 248 248 249 /* called with spinlock held */ 249 - static void nuke (struct dummy *dum, struct dummy_ep *ep) 250 + static void nuke(struct dummy *dum, struct dummy_ep *ep) 250 251 { 251 - while (!list_empty (&ep->queue)) { 252 + while (!list_empty(&ep->queue)) { 252 253 struct dummy_request *req; 253 254 254 - req = list_entry (ep->queue.next, struct dummy_request, queue); 255 - list_del_init (&req->queue); 255 + req = list_entry(ep->queue.next, struct dummy_request, queue); 256 + list_del_init(&req->queue); 256 257 req->req.status = -ESHUTDOWN; 257 258 258 - spin_unlock (&dum->lock); 259 - req->req.complete (&ep->ep, &req->req); 260 - spin_lock (&dum->lock); 259 + spin_unlock(&dum->lock); 260 + req->req.complete(&ep->ep, &req->req); 261 + spin_lock(&dum->lock); 261 262 } 262 263 } 263 264 264 265 /* caller must hold lock */ 265 - static void 266 - stop_activity (struct dummy *dum) 266 + static void stop_activity(struct dummy *dum) 267 267 { 268 268 struct dummy_ep *ep; 269 269 ··· 272 274 /* The timer is left running so that outstanding URBs can fail */ 273 275 274 276 /* nuke any pending requests first, so driver i/o is quiesced */ 275 - list_for_each_entry (ep, &dum->gadget.ep_list, ep.ep_list) 276 - nuke (dum, ep); 277 + list_for_each_entry(ep, &dum->gadget.ep_list, ep.ep_list) 278 + nuke(dum, ep); 277 279 278 280 /* driver now does any non-usb quiescing necessary */ 279 281 } ··· 408 410 #define is_enabled(dum) \ 409 411 (dum->port_status & USB_PORT_STAT_ENABLE) 410 412 411 - static int 412 - dummy_enable (struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc) 413 + static int dummy_enable(struct usb_ep *_ep, 414 + const struct usb_endpoint_descriptor *desc) 413 415 { 414 416 struct dummy *dum; 415 417 struct dummy_hcd *dum_hcd; ··· 417 419 unsigned max; 418 420 int retval; 419 421 420 - ep = usb_ep_to_dummy_ep (_ep); 422 + ep = usb_ep_to_dummy_ep(_ep); 421 423 if (!_ep || !desc || ep->desc || _ep->name == ep0name 422 424 || desc->bDescriptorType != USB_DT_ENDPOINT) 423 425 return -EINVAL; 424 - dum = ep_to_dummy (ep); 426 + dum = ep_to_dummy(ep); 425 427 if (!dum->driver) 426 428 return -ESHUTDOWN; 427 429 ··· 447 449 retval = -EINVAL; 448 450 switch (usb_endpoint_type(desc)) { 449 451 case USB_ENDPOINT_XFER_BULK: 450 - if (strstr (ep->ep.name, "-iso") 451 - || strstr (ep->ep.name, "-int")) { 452 + if (strstr(ep->ep.name, "-iso") 453 + || strstr(ep->ep.name, "-int")) { 452 454 goto done; 453 455 } 454 456 switch (dum->gadget.speed) { ··· 470 472 } 471 473 break; 472 474 case USB_ENDPOINT_XFER_INT: 473 - if (strstr (ep->ep.name, "-iso")) /* bulk is ok */ 475 + if (strstr(ep->ep.name, "-iso")) /* bulk is ok */ 474 476 goto done; 475 477 /* real hardware might not handle all packet sizes */ 476 478 switch (dum->gadget.speed) { ··· 490 492 } 491 493 break; 492 494 case USB_ENDPOINT_XFER_ISOC: 493 - if (strstr (ep->ep.name, "-bulk") 494 - || strstr (ep->ep.name, "-int")) 495 + if (strstr(ep->ep.name, "-bulk") 496 + || strstr(ep->ep.name, "-int")) 495 497 goto done; 496 498 /* real hardware might not handle all packet sizes */ 497 499 switch (dum->gadget.speed) { ··· 554 556 return retval; 555 557 } 556 558 557 - static int dummy_disable (struct usb_ep *_ep) 559 + static int dummy_disable(struct usb_ep *_ep) 558 560 { 559 561 struct dummy_ep *ep; 560 562 struct dummy *dum; 561 563 unsigned long flags; 562 564 int retval; 563 565 564 - ep = usb_ep_to_dummy_ep (_ep); 566 + ep = usb_ep_to_dummy_ep(_ep); 565 567 if (!_ep || !ep->desc || _ep->name == ep0name) 566 568 return -EINVAL; 567 - dum = ep_to_dummy (ep); 569 + dum = ep_to_dummy(ep); 568 570 569 - spin_lock_irqsave (&dum->lock, flags); 571 + spin_lock_irqsave(&dum->lock, flags); 570 572 ep->desc = NULL; 571 573 ep->stream_en = 0; 572 574 retval = 0; 573 - nuke (dum, ep); 574 - spin_unlock_irqrestore (&dum->lock, flags); 575 + nuke(dum, ep); 576 + spin_unlock_irqrestore(&dum->lock, flags); 575 577 576 - dev_dbg (udc_dev(dum), "disabled %s\n", _ep->name); 578 + dev_dbg(udc_dev(dum), "disabled %s\n", _ep->name); 577 579 return retval; 578 580 } 579 581 580 - static struct usb_request * 581 - dummy_alloc_request (struct usb_ep *_ep, gfp_t mem_flags) 582 + static struct usb_request *dummy_alloc_request(struct usb_ep *_ep, 583 + gfp_t mem_flags) 582 584 { 583 585 struct dummy_ep *ep; 584 586 struct dummy_request *req; 585 587 586 588 if (!_ep) 587 589 return NULL; 588 - ep = usb_ep_to_dummy_ep (_ep); 590 + ep = usb_ep_to_dummy_ep(_ep); 589 591 590 592 req = kzalloc(sizeof(*req), mem_flags); 591 593 if (!req) 592 594 return NULL; 593 - INIT_LIST_HEAD (&req->queue); 595 + INIT_LIST_HEAD(&req->queue); 594 596 return &req->req; 595 597 } 596 598 597 - static void 598 - dummy_free_request (struct usb_ep *_ep, struct usb_request *_req) 599 + static void dummy_free_request(struct usb_ep *_ep, struct usb_request *_req) 599 600 { 600 601 struct dummy_ep *ep; 601 602 struct dummy_request *req; 602 603 603 - ep = usb_ep_to_dummy_ep (_ep); 604 + ep = usb_ep_to_dummy_ep(_ep); 604 605 if (!ep || !_req || (!ep->desc && _ep->name != ep0name)) 605 606 return; 606 607 607 - req = usb_request_to_dummy_request (_req); 608 - WARN_ON (!list_empty (&req->queue)); 609 - kfree (req); 608 + req = usb_request_to_dummy_request(_req); 609 + WARN_ON(!list_empty(&req->queue)); 610 + kfree(req); 610 611 } 611 612 612 - static void 613 - fifo_complete (struct usb_ep *ep, struct usb_request *req) 613 + static void fifo_complete(struct usb_ep *ep, struct usb_request *req) 614 614 { 615 615 } 616 616 617 - static int 618 - dummy_queue (struct usb_ep *_ep, struct usb_request *_req, 617 + static int dummy_queue(struct usb_ep *_ep, struct usb_request *_req, 619 618 gfp_t mem_flags) 620 619 { 621 620 struct dummy_ep *ep; ··· 621 626 struct dummy_hcd *dum_hcd; 622 627 unsigned long flags; 623 628 624 - req = usb_request_to_dummy_request (_req); 625 - if (!_req || !list_empty (&req->queue) || !_req->complete) 629 + req = usb_request_to_dummy_request(_req); 630 + if (!_req || !list_empty(&req->queue) || !_req->complete) 626 631 return -EINVAL; 627 632 628 - ep = usb_ep_to_dummy_ep (_ep); 633 + ep = usb_ep_to_dummy_ep(_ep); 629 634 if (!_ep || (!ep->desc && _ep->name != ep0name)) 630 635 return -EINVAL; 631 636 632 - dum = ep_to_dummy (ep); 637 + dum = ep_to_dummy(ep); 633 638 dum_hcd = gadget_to_dummy_hcd(&dum->gadget); 634 639 if (!dum->driver || !is_enabled(dum_hcd)) 635 640 return -ESHUTDOWN; 636 641 637 642 #if 0 638 - dev_dbg (udc_dev(dum), "ep %p queue req %p to %s, len %d buf %p\n", 643 + dev_dbg(udc_dev(dum), "ep %p queue req %p to %s, len %d buf %p\n", 639 644 ep, _req, _ep->name, _req->length, _req->buf); 640 645 #endif 641 - 642 646 _req->status = -EINPROGRESS; 643 647 _req->actual = 0; 644 - spin_lock_irqsave (&dum->lock, flags); 648 + spin_lock_irqsave(&dum->lock, flags); 645 649 646 650 /* implement an emulated single-request FIFO */ 647 651 if (ep->desc && (ep->desc->bEndpointAddress & USB_DIR_IN) && 648 - list_empty (&dum->fifo_req.queue) && 649 - list_empty (&ep->queue) && 652 + list_empty(&dum->fifo_req.queue) && 653 + list_empty(&ep->queue) && 650 654 _req->length <= FIFO_SIZE) { 651 655 req = &dum->fifo_req; 652 656 req->req = *_req; 653 657 req->req.buf = dum->fifo_buf; 654 - memcpy (dum->fifo_buf, _req->buf, _req->length); 658 + memcpy(dum->fifo_buf, _req->buf, _req->length); 655 659 req->req.context = dum; 656 660 req->req.complete = fifo_complete; 657 661 658 662 list_add_tail(&req->queue, &ep->queue); 659 - spin_unlock (&dum->lock); 663 + spin_unlock(&dum->lock); 660 664 _req->actual = _req->length; 661 665 _req->status = 0; 662 - _req->complete (_ep, _req); 663 - spin_lock (&dum->lock); 666 + _req->complete(_ep, _req); 667 + spin_lock(&dum->lock); 664 668 } else 665 669 list_add_tail(&req->queue, &ep->queue); 666 - spin_unlock_irqrestore (&dum->lock, flags); 670 + spin_unlock_irqrestore(&dum->lock, flags); 667 671 668 672 /* real hardware would likely enable transfers here, in case 669 673 * it'd been left NAKing. ··· 670 676 return 0; 671 677 } 672 678 673 - static int dummy_dequeue (struct usb_ep *_ep, struct usb_request *_req) 679 + static int dummy_dequeue(struct usb_ep *_ep, struct usb_request *_req) 674 680 { 675 681 struct dummy_ep *ep; 676 682 struct dummy *dum; ··· 680 686 681 687 if (!_ep || !_req) 682 688 return retval; 683 - ep = usb_ep_to_dummy_ep (_ep); 684 - dum = ep_to_dummy (ep); 689 + ep = usb_ep_to_dummy_ep(_ep); 690 + dum = ep_to_dummy(ep); 685 691 686 692 if (!dum->driver) 687 693 return -ESHUTDOWN; 688 694 689 - local_irq_save (flags); 690 - spin_lock (&dum->lock); 691 - list_for_each_entry (req, &ep->queue, queue) { 695 + local_irq_save(flags); 696 + spin_lock(&dum->lock); 697 + list_for_each_entry(req, &ep->queue, queue) { 692 698 if (&req->req == _req) { 693 - list_del_init (&req->queue); 699 + list_del_init(&req->queue); 694 700 _req->status = -ECONNRESET; 695 701 retval = 0; 696 702 break; 697 703 } 698 704 } 699 - spin_unlock (&dum->lock); 705 + spin_unlock(&dum->lock); 700 706 701 707 if (retval == 0) { 702 - dev_dbg (udc_dev(dum), 708 + dev_dbg(udc_dev(dum), 703 709 "dequeued req %p from %s, len %d buf %p\n", 704 710 req, _ep->name, _req->length, _req->buf); 705 - _req->complete (_ep, _req); 711 + _req->complete(_ep, _req); 706 712 } 707 - local_irq_restore (flags); 713 + local_irq_restore(flags); 708 714 return retval; 709 715 } 710 716 ··· 716 722 717 723 if (!_ep) 718 724 return -EINVAL; 719 - ep = usb_ep_to_dummy_ep (_ep); 720 - dum = ep_to_dummy (ep); 725 + ep = usb_ep_to_dummy_ep(_ep); 726 + dum = ep_to_dummy(ep); 721 727 if (!dum->driver) 722 728 return -ESHUTDOWN; 723 729 if (!value) 724 730 ep->halted = ep->wedged = 0; 725 731 else if (ep->desc && (ep->desc->bEndpointAddress & USB_DIR_IN) && 726 - !list_empty (&ep->queue)) 732 + !list_empty(&ep->queue)) 727 733 return -EAGAIN; 728 734 else { 729 735 ep->halted = 1; ··· 764 770 /*-------------------------------------------------------------------------*/ 765 771 766 772 /* there are both host and device side versions of this call ... */ 767 - static int dummy_g_get_frame (struct usb_gadget *_gadget) 773 + static int dummy_g_get_frame(struct usb_gadget *_gadget) 768 774 { 769 775 struct timeval tv; 770 776 771 - do_gettimeofday (&tv); 777 + do_gettimeofday(&tv); 772 778 return tv.tv_usec / 1000; 773 779 } 774 780 775 - static int dummy_wakeup (struct usb_gadget *_gadget) 781 + static int dummy_wakeup(struct usb_gadget *_gadget) 776 782 { 777 783 struct dummy_hcd *dum_hcd; 778 784 ··· 795 801 return 0; 796 802 } 797 803 798 - static int dummy_set_selfpowered (struct usb_gadget *_gadget, int value) 804 + static int dummy_set_selfpowered(struct usb_gadget *_gadget, int value) 799 805 { 800 806 struct dummy *dum; 801 807 802 - dum = (gadget_to_dummy_hcd(_gadget))->dum; 808 + dum = gadget_to_dummy_hcd(_gadget)->dum; 803 809 if (value) 804 810 dum->devstatus |= (1 << USB_DEVICE_SELF_POWERED); 805 811 else ··· 815 821 dum->ep[0].ep.maxpacket = 64; 816 822 } 817 823 818 - static int dummy_pullup (struct usb_gadget *_gadget, int value) 824 + static int dummy_pullup(struct usb_gadget *_gadget, int value) 819 825 { 820 826 struct dummy_hcd *dum_hcd; 821 827 struct dummy *dum; ··· 840 846 } 841 847 dum_hcd = gadget_to_dummy_hcd(_gadget); 842 848 843 - spin_lock_irqsave (&dum->lock, flags); 849 + spin_lock_irqsave(&dum->lock, flags); 844 850 dum->pullup = (value != 0); 845 851 set_link_state(dum_hcd); 846 - spin_unlock_irqrestore (&dum->lock, flags); 852 + spin_unlock_irqrestore(&dum->lock, flags); 847 853 848 854 usb_hcd_poll_rh_status(dummy_hcd_to_hcd(dum_hcd)); 849 855 return 0; ··· 866 872 /*-------------------------------------------------------------------------*/ 867 873 868 874 /* "function" sysfs attribute */ 869 - static ssize_t 870 - show_function (struct device *dev, struct device_attribute *attr, char *buf) 875 + static ssize_t show_function(struct device *dev, struct device_attribute *attr, 876 + char *buf) 871 877 { 872 - struct dummy *dum = gadget_dev_to_dummy (dev); 878 + struct dummy *dum = gadget_dev_to_dummy(dev); 873 879 874 880 if (!dum->driver || !dum->driver->function) 875 881 return 0; 876 - return scnprintf (buf, PAGE_SIZE, "%s\n", dum->driver->function); 882 + return scnprintf(buf, PAGE_SIZE, "%s\n", dum->driver->function); 877 883 } 878 - static DEVICE_ATTR (function, S_IRUGO, show_function, NULL); 884 + static DEVICE_ATTR(function, S_IRUGO, show_function, NULL); 879 885 880 886 /*-------------------------------------------------------------------------*/ 881 887 ··· 910 916 dum->devstatus = 0; 911 917 912 918 dum->driver = driver; 913 - dev_dbg (udc_dev(dum), "binding gadget driver '%s'\n", 919 + dev_dbg(udc_dev(dum), "binding gadget driver '%s'\n", 914 920 driver->driver.name); 915 921 return 0; 916 922 } ··· 921 927 struct dummy_hcd *dum_hcd = gadget_to_dummy_hcd(g); 922 928 struct dummy *dum = dum_hcd->dum; 923 929 924 - dev_dbg (udc_dev(dum), "unregister gadget driver '%s'\n", 930 + dev_dbg(udc_dev(dum), "unregister gadget driver '%s'\n", 925 931 driver->driver.name); 926 932 927 933 dum->driver = NULL; ··· 934 940 935 941 /* The gadget structure is stored inside the hcd structure and will be 936 942 * released along with it. */ 937 - static void 938 - dummy_gadget_release (struct device *dev) 943 + static void dummy_gadget_release(struct device *dev) 939 944 { 940 945 return; 941 946 } ··· 971 978 #endif 972 979 } 973 980 974 - static int dummy_udc_probe (struct platform_device *pdev) 981 + static int dummy_udc_probe(struct platform_device *pdev) 975 982 { 976 983 struct dummy *dum = &the_controller; 977 984 int rc; ··· 983 990 dev_set_name(&dum->gadget.dev, "gadget"); 984 991 dum->gadget.dev.parent = &pdev->dev; 985 992 dum->gadget.dev.release = dummy_gadget_release; 986 - rc = device_register (&dum->gadget.dev); 993 + rc = device_register(&dum->gadget.dev); 987 994 if (rc < 0) { 988 995 put_device(&dum->gadget.dev); 989 996 return rc; ··· 995 1002 if (rc < 0) 996 1003 goto err_udc; 997 1004 998 - rc = device_create_file (&dum->gadget.dev, &dev_attr_function); 1005 + rc = device_create_file(&dum->gadget.dev, &dev_attr_function); 999 1006 if (rc < 0) 1000 1007 goto err_dev; 1001 1008 platform_set_drvdata(pdev, dum); ··· 1008 1015 return rc; 1009 1016 } 1010 1017 1011 - static int dummy_udc_remove (struct platform_device *pdev) 1018 + static int dummy_udc_remove(struct platform_device *pdev) 1012 1019 { 1013 - struct dummy *dum = platform_get_drvdata (pdev); 1020 + struct dummy *dum = platform_get_drvdata(pdev); 1014 1021 1015 1022 usb_del_gadget_udc(&dum->gadget); 1016 - platform_set_drvdata (pdev, NULL); 1017 - device_remove_file (&dum->gadget.dev, &dev_attr_function); 1018 - device_unregister (&dum->gadget.dev); 1023 + platform_set_drvdata(pdev, NULL); 1024 + device_remove_file(&dum->gadget.dev, &dev_attr_function); 1025 + device_unregister(&dum->gadget.dev); 1019 1026 return 0; 1020 1027 } 1021 1028 ··· 1160 1167 return 0; 1161 1168 } 1162 1169 1163 - static int dummy_urb_enqueue ( 1170 + static int dummy_urb_enqueue( 1164 1171 struct usb_hcd *hcd, 1165 1172 struct urb *urb, 1166 1173 gfp_t mem_flags ··· 1170 1177 unsigned long flags; 1171 1178 int rc; 1172 1179 1173 - urbp = kmalloc (sizeof *urbp, mem_flags); 1180 + urbp = kmalloc(sizeof *urbp, mem_flags); 1174 1181 if (!urbp) 1175 1182 return -ENOMEM; 1176 1183 urbp->urb = urb; ··· 1199 1206 1200 1207 list_add_tail(&urbp->urbp_list, &dum_hcd->urbp_list); 1201 1208 urb->hcpriv = urbp; 1202 - if (usb_pipetype (urb->pipe) == PIPE_CONTROL) 1209 + if (usb_pipetype(urb->pipe) == PIPE_CONTROL) 1203 1210 urb->error_count = 1; /* mark as a new urb */ 1204 1211 1205 1212 /* kick the scheduler, it'll do the rest */ ··· 1306 1313 1307 1314 top: 1308 1315 /* if there's no request queued, the device is NAKing; return */ 1309 - list_for_each_entry (req, &ep->queue, queue) { 1316 + list_for_each_entry(req, &ep->queue, queue) { 1310 1317 unsigned host_len, dev_len, len; 1311 1318 int is_short, to_host; 1312 1319 int rescan = 0; ··· 1325 1332 */ 1326 1333 host_len = urb->transfer_buffer_length - urb->actual_length; 1327 1334 dev_len = req->req.length - req->req.actual; 1328 - len = min (host_len, dev_len); 1335 + len = min(host_len, dev_len); 1329 1336 1330 1337 /* FIXME update emulated data toggle too */ 1331 1338 1332 - to_host = usb_pipein (urb->pipe); 1333 - if (unlikely (len == 0)) 1339 + to_host = usb_pipein(urb->pipe); 1340 + if (unlikely(len == 0)) 1334 1341 is_short = 1; 1335 1342 else { 1336 1343 /* not enough bandwidth left? */ 1337 1344 if (limit < ep->ep.maxpacket && limit < len) 1338 1345 break; 1339 - len = min (len, (unsigned) limit); 1346 + len = min_t(unsigned, len, limit); 1340 1347 if (len == 0) 1341 1348 break; 1342 1349 ··· 1397 1404 1398 1405 /* device side completion --> continuable */ 1399 1406 if (req->req.status != -EINPROGRESS) { 1400 - list_del_init (&req->queue); 1407 + list_del_init(&req->queue); 1401 1408 1402 - spin_unlock (&dum->lock); 1403 - req->req.complete (&ep->ep, &req->req); 1404 - spin_lock (&dum->lock); 1409 + spin_unlock(&dum->lock); 1410 + req->req.complete(&ep->ep, &req->req); 1411 + spin_lock(&dum->lock); 1405 1412 1406 1413 /* requests might have been unlinked... */ 1407 1414 rescan = 1; ··· 1418 1425 return limit; 1419 1426 } 1420 1427 1421 - static int periodic_bytes (struct dummy *dum, struct dummy_ep *ep) 1428 + static int periodic_bytes(struct dummy *dum, struct dummy_ep *ep) 1422 1429 { 1423 1430 int limit = ep->ep.maxpacket; 1424 1431 ··· 1454 1461 USB_PORT_STAT_SUSPEND)) \ 1455 1462 == (USB_PORT_STAT_CONNECTION | USB_PORT_STAT_ENABLE)) 1456 1463 1457 - static struct dummy_ep *find_endpoint (struct dummy *dum, u8 address) 1464 + static struct dummy_ep *find_endpoint(struct dummy *dum, u8 address) 1458 1465 { 1459 1466 int i; 1460 1467 ··· 1462 1469 dum->ss_hcd : dum->hs_hcd))) 1463 1470 return NULL; 1464 1471 if ((address & ~USB_DIR_IN) == 0) 1465 - return &dum->ep [0]; 1472 + return &dum->ep[0]; 1466 1473 for (i = 1; i < DUMMY_ENDPOINTS; i++) { 1467 - struct dummy_ep *ep = &dum->ep [i]; 1474 + struct dummy_ep *ep = &dum->ep[i]; 1468 1475 1469 1476 if (!ep->desc) 1470 1477 continue; ··· 1694 1701 /* FIXME if HZ != 1000 this will probably misbehave ... */ 1695 1702 1696 1703 /* look at each urb queued by the host side driver */ 1697 - spin_lock_irqsave (&dum->lock, flags); 1704 + spin_lock_irqsave(&dum->lock, flags); 1698 1705 1699 1706 if (!dum_hcd->udev) { 1700 1707 dev_err(dummy_dev(dum_hcd), 1701 1708 "timer fired with no URBs pending?\n"); 1702 - spin_unlock_irqrestore (&dum->lock, flags); 1709 + spin_unlock_irqrestore(&dum->lock, flags); 1703 1710 return; 1704 1711 } 1705 1712 1706 1713 for (i = 0; i < DUMMY_ENDPOINTS; i++) { 1707 - if (!ep_name [i]) 1714 + if (!ep_name[i]) 1708 1715 break; 1709 - dum->ep [i].already_seen = 0; 1716 + dum->ep[i].already_seen = 0; 1710 1717 } 1711 1718 1712 1719 restart: ··· 1723 1730 goto return_urb; 1724 1731 else if (dum_hcd->rh_state != DUMMY_RH_RUNNING) 1725 1732 continue; 1726 - type = usb_pipetype (urb->pipe); 1733 + type = usb_pipetype(urb->pipe); 1727 1734 1728 1735 /* used up this frame's non-periodic bandwidth? 1729 1736 * FIXME there's infinite bandwidth for control and ··· 1734 1741 1735 1742 /* find the gadget's ep for this request (if configured) */ 1736 1743 address = usb_pipeendpoint (urb->pipe); 1737 - if (usb_pipein (urb->pipe)) 1744 + if (usb_pipein(urb->pipe)) 1738 1745 address |= USB_DIR_IN; 1739 1746 ep = find_endpoint(dum, address); 1740 1747 if (!ep) { ··· 1749 1756 if (ep->already_seen) 1750 1757 continue; 1751 1758 ep->already_seen = 1; 1752 - if (ep == &dum->ep [0] && urb->error_count) { 1759 + if (ep == &dum->ep[0] && urb->error_count) { 1753 1760 ep->setup_stage = 1; /* a new urb */ 1754 1761 urb->error_count = 0; 1755 1762 } ··· 1763 1770 /* FIXME make sure both ends agree on maxpacket */ 1764 1771 1765 1772 /* handle control requests */ 1766 - if (ep == &dum->ep [0] && ep->setup_stage) { 1773 + if (ep == &dum->ep[0] && ep->setup_stage) { 1767 1774 struct usb_ctrlrequest setup; 1768 1775 int value = 1; 1769 1776 1770 - setup = *(struct usb_ctrlrequest*) urb->setup_packet; 1777 + setup = *(struct usb_ctrlrequest *) urb->setup_packet; 1771 1778 /* paranoia, in case of stale queued data */ 1772 - list_for_each_entry (req, &ep->queue, queue) { 1773 - list_del_init (&req->queue); 1779 + list_for_each_entry(req, &ep->queue, queue) { 1780 + list_del_init(&req->queue); 1774 1781 req->req.status = -EOVERFLOW; 1775 - dev_dbg (udc_dev(dum), "stale req = %p\n", 1782 + dev_dbg(udc_dev(dum), "stale req = %p\n", 1776 1783 req); 1777 1784 1778 - spin_unlock (&dum->lock); 1779 - req->req.complete (&ep->ep, &req->req); 1780 - spin_lock (&dum->lock); 1785 + spin_unlock(&dum->lock); 1786 + req->req.complete(&ep->ep, &req->req); 1787 + spin_lock(&dum->lock); 1781 1788 ep->already_seen = 0; 1782 1789 goto restart; 1783 1790 } ··· 1797 1804 * until setup() returns; no reentrancy issues etc. 1798 1805 */ 1799 1806 if (value > 0) { 1800 - spin_unlock (&dum->lock); 1801 - value = dum->driver->setup (&dum->gadget, 1807 + spin_unlock(&dum->lock); 1808 + value = dum->driver->setup(&dum->gadget, 1802 1809 &setup); 1803 - spin_lock (&dum->lock); 1810 + spin_lock(&dum->lock); 1804 1811 1805 1812 if (value >= 0) { 1806 1813 /* no delays (max 64KB data stage) */ ··· 1812 1819 1813 1820 if (value < 0) { 1814 1821 if (value != -EOPNOTSUPP) 1815 - dev_dbg (udc_dev(dum), 1822 + dev_dbg(udc_dev(dum), 1816 1823 "setup --> %d\n", 1817 1824 value); 1818 1825 status = -EPIPE; ··· 1824 1831 1825 1832 /* non-control requests */ 1826 1833 limit = total; 1827 - switch (usb_pipetype (urb->pipe)) { 1834 + switch (usb_pipetype(urb->pipe)) { 1828 1835 case PIPE_ISOCHRONOUS: 1829 1836 /* FIXME is it urb->interval since the last xfer? 1830 1837 * use urb->iso_frame_desc[i]. 1831 1838 * complete whether or not ep has requests queued. 1832 1839 * report random errors, to debug drivers. 1833 1840 */ 1834 - limit = max (limit, periodic_bytes (dum, ep)); 1841 + limit = max(limit, periodic_bytes(dum, ep)); 1835 1842 status = -ENOSYS; 1836 1843 break; 1837 1844 ··· 1839 1846 /* FIXME is it urb->interval since the last xfer? 1840 1847 * this almost certainly polls too fast. 1841 1848 */ 1842 - limit = max (limit, periodic_bytes (dum, ep)); 1849 + limit = max(limit, periodic_bytes(dum, ep)); 1843 1850 /* FALLTHROUGH */ 1844 1851 1845 - // case PIPE_BULK: case PIPE_CONTROL: 1846 1852 default: 1847 - treat_control_like_bulk: 1853 + treat_control_like_bulk: 1848 1854 ep->last_io = jiffies; 1849 1855 total = transfer(dum_hcd, urb, ep, limit, &status); 1850 1856 break; ··· 1854 1862 continue; 1855 1863 1856 1864 return_urb: 1857 - list_del (&urbp->urbp_list); 1858 - kfree (urbp); 1865 + list_del(&urbp->urbp_list); 1866 + kfree(urbp); 1859 1867 if (ep) 1860 1868 ep->already_seen = ep->setup_stage = 0; 1861 1869 1862 1870 usb_hcd_unlink_urb_from_ep(dummy_hcd_to_hcd(dum_hcd), urb); 1863 - spin_unlock (&dum->lock); 1871 + spin_unlock(&dum->lock); 1864 1872 usb_hcd_giveback_urb(dummy_hcd_to_hcd(dum_hcd), urb, status); 1865 - spin_lock (&dum->lock); 1873 + spin_lock(&dum->lock); 1866 1874 1867 1875 goto restart; 1868 1876 } ··· 1875 1883 mod_timer(&dum_hcd->timer, jiffies + msecs_to_jiffies(1)); 1876 1884 } 1877 1885 1878 - spin_unlock_irqrestore (&dum->lock, flags); 1886 + spin_unlock_irqrestore(&dum->lock, flags); 1879 1887 } 1880 1888 1881 1889 /*-------------------------------------------------------------------------*/ ··· 1887 1895 | USB_PORT_STAT_C_OVERCURRENT \ 1888 1896 | USB_PORT_STAT_C_RESET) << 16) 1889 1897 1890 - static int dummy_hub_status (struct usb_hcd *hcd, char *buf) 1898 + static int dummy_hub_status(struct usb_hcd *hcd, char *buf) 1891 1899 { 1892 1900 struct dummy_hcd *dum_hcd; 1893 1901 unsigned long flags; ··· 1911 1919 dum_hcd->port_status); 1912 1920 retval = 1; 1913 1921 if (dum_hcd->rh_state == DUMMY_RH_SUSPENDED) 1914 - usb_hcd_resume_root_hub (hcd); 1922 + usb_hcd_resume_root_hub(hcd); 1915 1923 } 1916 1924 done: 1917 1925 spin_unlock_irqrestore(&dum_hcd->dum->lock, flags); ··· 1930 1938 desc->u.ss.DeviceRemovable = 0xffff; 1931 1939 } 1932 1940 1933 - static inline void 1934 - hub_descriptor (struct usb_hub_descriptor *desc) 1941 + static inline void hub_descriptor(struct usb_hub_descriptor *desc) 1935 1942 { 1936 - memset (desc, 0, sizeof *desc); 1943 + memset(desc, 0, sizeof *desc); 1937 1944 desc->bDescriptorType = 0x29; 1938 1945 desc->bDescLength = 9; 1939 1946 desc->wHubCharacteristics = cpu_to_le16(0x0001); ··· 1941 1950 desc->u.hs.DeviceRemovable[1] = 0xff; 1942 1951 } 1943 1952 1944 - static int dummy_hub_control ( 1953 + static int dummy_hub_control( 1945 1954 struct usb_hcd *hcd, 1946 1955 u16 typeReq, 1947 1956 u16 wValue, ··· 2009 2018 hub_descriptor((struct usb_hub_descriptor *) buf); 2010 2019 break; 2011 2020 case GetHubStatus: 2012 - *(__le32 *) buf = cpu_to_le32 (0); 2021 + *(__le32 *) buf = cpu_to_le32(0); 2013 2022 break; 2014 2023 case GetPortStatus: 2015 2024 if (wIndex != 1) ··· 2051 2060 } 2052 2061 } 2053 2062 set_link_state(dum_hcd); 2054 - ((__le16 *) buf)[0] = cpu_to_le16 (dum_hcd->port_status); 2055 - ((__le16 *) buf)[1] = cpu_to_le16 (dum_hcd->port_status >> 16); 2063 + ((__le16 *) buf)[0] = cpu_to_le16(dum_hcd->port_status); 2064 + ((__le16 *) buf)[1] = cpu_to_le16(dum_hcd->port_status >> 16); 2056 2065 break; 2057 2066 case SetHubFeature: 2058 2067 retval = -EPIPE; ··· 2186 2195 spin_unlock_irqrestore(&dum_hcd->dum->lock, flags); 2187 2196 2188 2197 if ((dum_hcd->port_status & PORT_C_MASK) != 0) 2189 - usb_hcd_poll_rh_status (hcd); 2198 + usb_hcd_poll_rh_status(hcd); 2190 2199 return retval; 2191 2200 } 2192 2201 2193 - static int dummy_bus_suspend (struct usb_hcd *hcd) 2202 + static int dummy_bus_suspend(struct usb_hcd *hcd) 2194 2203 { 2195 2204 struct dummy_hcd *dum_hcd = hcd_to_dummy_hcd(hcd); 2196 2205 2197 - dev_dbg (&hcd->self.root_hub->dev, "%s\n", __func__); 2206 + dev_dbg(&hcd->self.root_hub->dev, "%s\n", __func__); 2198 2207 2199 2208 spin_lock_irq(&dum_hcd->dum->lock); 2200 2209 dum_hcd->rh_state = DUMMY_RH_SUSPENDED; ··· 2204 2213 return 0; 2205 2214 } 2206 2215 2207 - static int dummy_bus_resume (struct usb_hcd *hcd) 2216 + static int dummy_bus_resume(struct usb_hcd *hcd) 2208 2217 { 2209 2218 struct dummy_hcd *dum_hcd = hcd_to_dummy_hcd(hcd); 2210 2219 int rc = 0; 2211 2220 2212 - dev_dbg (&hcd->self.root_hub->dev, "%s\n", __func__); 2221 + dev_dbg(&hcd->self.root_hub->dev, "%s\n", __func__); 2213 2222 2214 2223 spin_lock_irq(&dum_hcd->dum->lock); 2215 2224 if (!HCD_HW_ACCESSIBLE(hcd)) { ··· 2227 2236 2228 2237 /*-------------------------------------------------------------------------*/ 2229 2238 2230 - static inline ssize_t 2231 - show_urb (char *buf, size_t size, struct urb *urb) 2239 + static inline ssize_t show_urb(char *buf, size_t size, struct urb *urb) 2232 2240 { 2233 - int ep = usb_pipeendpoint (urb->pipe); 2241 + int ep = usb_pipeendpoint(urb->pipe); 2234 2242 2235 - return snprintf (buf, size, 2243 + return snprintf(buf, size, 2236 2244 "urb/%p %s ep%d%s%s len %d/%d\n", 2237 2245 urb, 2238 2246 ({ char *s; 2239 - switch (urb->dev->speed) { 2240 - case USB_SPEED_LOW: 2247 + switch (urb->dev->speed) { 2248 + case USB_SPEED_LOW: 2241 2249 s = "ls"; 2242 2250 break; 2243 - case USB_SPEED_FULL: 2251 + case USB_SPEED_FULL: 2244 2252 s = "fs"; 2245 2253 break; 2246 - case USB_SPEED_HIGH: 2254 + case USB_SPEED_HIGH: 2247 2255 s = "hs"; 2248 2256 break; 2249 - case USB_SPEED_SUPER: 2257 + case USB_SPEED_SUPER: 2250 2258 s = "ss"; 2251 2259 break; 2252 - default: 2260 + default: 2253 2261 s = "?"; 2254 2262 break; 2255 2263 }; s; }), 2256 - ep, ep ? (usb_pipein (urb->pipe) ? "in" : "out") : "", 2264 + ep, ep ? (usb_pipein(urb->pipe) ? "in" : "out") : "", 2257 2265 ({ char *s; \ 2258 - switch (usb_pipetype (urb->pipe)) { \ 2259 - case PIPE_CONTROL: \ 2266 + switch (usb_pipetype(urb->pipe)) { \ 2267 + case PIPE_CONTROL: \ 2260 2268 s = ""; \ 2261 2269 break; \ 2262 - case PIPE_BULK: \ 2270 + case PIPE_BULK: \ 2263 2271 s = "-bulk"; \ 2264 2272 break; \ 2265 - case PIPE_INTERRUPT: \ 2273 + case PIPE_INTERRUPT: \ 2266 2274 s = "-int"; \ 2267 2275 break; \ 2268 - default: \ 2276 + default: \ 2269 2277 s = "-iso"; \ 2270 2278 break; \ 2271 - }; s;}), 2279 + }; s; }), 2272 2280 urb->actual_length, urb->transfer_buffer_length); 2273 2281 } 2274 2282 2275 - static ssize_t 2276 - show_urbs (struct device *dev, struct device_attribute *attr, char *buf) 2283 + static ssize_t show_urbs(struct device *dev, struct device_attribute *attr, 2284 + char *buf) 2277 2285 { 2278 - struct usb_hcd *hcd = dev_get_drvdata (dev); 2286 + struct usb_hcd *hcd = dev_get_drvdata(dev); 2279 2287 struct dummy_hcd *dum_hcd = hcd_to_dummy_hcd(hcd); 2280 2288 struct urbp *urbp; 2281 2289 size_t size = 0; ··· 2284 2294 list_for_each_entry(urbp, &dum_hcd->urbp_list, urbp_list) { 2285 2295 size_t temp; 2286 2296 2287 - temp = show_urb (buf, PAGE_SIZE - size, urbp->urb); 2297 + temp = show_urb(buf, PAGE_SIZE - size, urbp->urb); 2288 2298 buf += temp; 2289 2299 size += temp; 2290 2300 } ··· 2292 2302 2293 2303 return size; 2294 2304 } 2295 - static DEVICE_ATTR (urbs, S_IRUGO, show_urbs, NULL); 2305 + static DEVICE_ATTR(urbs, S_IRUGO, show_urbs, NULL); 2296 2306 2297 2307 static int dummy_start_ss(struct dummy_hcd *dum_hcd) 2298 2308 { ··· 2346 2356 return device_create_file(dummy_dev(dum_hcd), &dev_attr_urbs); 2347 2357 } 2348 2358 2349 - static void dummy_stop (struct usb_hcd *hcd) 2359 + static void dummy_stop(struct usb_hcd *hcd) 2350 2360 { 2351 2361 struct dummy *dum; 2352 2362 2353 - dum = (hcd_to_dummy_hcd(hcd))->dum; 2363 + dum = hcd_to_dummy_hcd(hcd)->dum; 2354 2364 device_remove_file(dummy_dev(hcd_to_dummy_hcd(hcd)), &dev_attr_urbs); 2355 2365 usb_gadget_unregister_driver(dum->driver); 2356 2366 dev_info(dummy_dev(hcd_to_dummy_hcd(hcd)), "stopped\n"); ··· 2358 2368 2359 2369 /*-------------------------------------------------------------------------*/ 2360 2370 2361 - static int dummy_h_get_frame (struct usb_hcd *hcd) 2371 + static int dummy_h_get_frame(struct usb_hcd *hcd) 2362 2372 { 2363 - return dummy_g_get_frame (NULL); 2373 + return dummy_g_get_frame(NULL); 2364 2374 } 2365 2375 2366 2376 static int dummy_setup(struct usb_hcd *hcd) ··· 2475 2485 .start = dummy_start, 2476 2486 .stop = dummy_stop, 2477 2487 2478 - .urb_enqueue = dummy_urb_enqueue, 2479 - .urb_dequeue = dummy_urb_dequeue, 2488 + .urb_enqueue = dummy_urb_enqueue, 2489 + .urb_dequeue = dummy_urb_dequeue, 2480 2490 2481 - .get_frame_number = dummy_h_get_frame, 2491 + .get_frame_number = dummy_h_get_frame, 2482 2492 2483 - .hub_status_data = dummy_hub_status, 2484 - .hub_control = dummy_hub_control, 2493 + .hub_status_data = dummy_hub_status, 2494 + .hub_control = dummy_hub_control, 2485 2495 .bus_suspend = dummy_bus_suspend, 2486 2496 .bus_resume = dummy_bus_resume, 2487 2497 ··· 2536 2546 { 2537 2547 struct dummy *dum; 2538 2548 2539 - dum = (hcd_to_dummy_hcd(platform_get_drvdata(pdev)))->dum; 2549 + dum = hcd_to_dummy_hcd(platform_get_drvdata(pdev))->dum; 2540 2550 2541 2551 if (dum->ss_hcd) { 2542 2552 usb_remove_hcd(dummy_hcd_to_hcd(dum->ss_hcd)); ··· 2552 2562 return 0; 2553 2563 } 2554 2564 2555 - static int dummy_hcd_suspend (struct platform_device *pdev, pm_message_t state) 2565 + static int dummy_hcd_suspend(struct platform_device *pdev, pm_message_t state) 2556 2566 { 2557 2567 struct usb_hcd *hcd; 2558 2568 struct dummy_hcd *dum_hcd; 2559 2569 int rc = 0; 2560 2570 2561 - dev_dbg (&pdev->dev, "%s\n", __func__); 2571 + dev_dbg(&pdev->dev, "%s\n", __func__); 2562 2572 2563 - hcd = platform_get_drvdata (pdev); 2573 + hcd = platform_get_drvdata(pdev); 2564 2574 dum_hcd = hcd_to_dummy_hcd(hcd); 2565 2575 if (dum_hcd->rh_state == DUMMY_RH_RUNNING) { 2566 2576 dev_warn(&pdev->dev, "Root hub isn't suspended!\n"); ··· 2570 2580 return rc; 2571 2581 } 2572 2582 2573 - static int dummy_hcd_resume (struct platform_device *pdev) 2583 + static int dummy_hcd_resume(struct platform_device *pdev) 2574 2584 { 2575 2585 struct usb_hcd *hcd; 2576 2586 2577 - dev_dbg (&pdev->dev, "%s\n", __func__); 2587 + dev_dbg(&pdev->dev, "%s\n", __func__); 2578 2588 2579 - hcd = platform_get_drvdata (pdev); 2589 + hcd = platform_get_drvdata(pdev); 2580 2590 set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); 2581 - usb_hcd_poll_rh_status (hcd); 2591 + usb_hcd_poll_rh_status(hcd); 2582 2592 return 0; 2583 2593 } 2584 2594 ··· 2598 2608 static struct platform_device *the_udc_pdev; 2599 2609 static struct platform_device *the_hcd_pdev; 2600 2610 2601 - static int __init init (void) 2611 + static int __init init(void) 2602 2612 { 2603 2613 int retval = -ENOMEM; 2604 2614 2605 - if (usb_disabled ()) 2615 + if (usb_disabled()) 2606 2616 return -ENODEV; 2607 2617 2608 2618 if (!mod_data.is_high_speed && mod_data.is_super_speed) ··· 2661 2671 platform_device_put(the_hcd_pdev); 2662 2672 return retval; 2663 2673 } 2664 - module_init (init); 2674 + module_init(init); 2665 2675 2666 - static void __exit cleanup (void) 2676 + static void __exit cleanup(void) 2667 2677 { 2668 2678 platform_device_unregister(the_udc_pdev); 2669 2679 platform_device_unregister(the_hcd_pdev); 2670 2680 platform_driver_unregister(&dummy_udc_driver); 2671 2681 platform_driver_unregister(&dummy_hcd_driver); 2672 2682 } 2673 - module_exit (cleanup); 2683 + module_exit(cleanup);