diff options
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/ci13xxx_udc.c | 5 | ||||
-rw-r--r-- | drivers/usb/gadget/file_storage.c | 20 | ||||
-rw-r--r-- | drivers/usb/gadget/omap_udc.c | 3 | ||||
-rw-r--r-- | drivers/usb/gadget/u_ether.c | 8 |
4 files changed, 10 insertions, 26 deletions
diff --git a/drivers/usb/gadget/ci13xxx_udc.c b/drivers/usb/gadget/ci13xxx_udc.c index 22c65960c429..38e531ecae4d 100644 --- a/drivers/usb/gadget/ci13xxx_udc.c +++ b/drivers/usb/gadget/ci13xxx_udc.c | |||
@@ -51,6 +51,7 @@ | |||
51 | * - Gadget API (majority of optional features) | 51 | * - Gadget API (majority of optional features) |
52 | * - Suspend & Remote Wakeup | 52 | * - Suspend & Remote Wakeup |
53 | */ | 53 | */ |
54 | #include <linux/delay.h> | ||
54 | #include <linux/device.h> | 55 | #include <linux/device.h> |
55 | #include <linux/dmapool.h> | 56 | #include <linux/dmapool.h> |
56 | #include <linux/dma-mapping.h> | 57 | #include <linux/dma-mapping.h> |
@@ -142,7 +143,7 @@ static struct { | |||
142 | #define CAP_DEVICEADDR (0x014UL) | 143 | #define CAP_DEVICEADDR (0x014UL) |
143 | #define CAP_ENDPTLISTADDR (0x018UL) | 144 | #define CAP_ENDPTLISTADDR (0x018UL) |
144 | #define CAP_PORTSC (0x044UL) | 145 | #define CAP_PORTSC (0x044UL) |
145 | #define CAP_DEVLC (0x0B4UL) | 146 | #define CAP_DEVLC (0x084UL) |
146 | #define CAP_USBMODE (hw_bank.lpm ? 0x0C8UL : 0x068UL) | 147 | #define CAP_USBMODE (hw_bank.lpm ? 0x0C8UL : 0x068UL) |
147 | #define CAP_ENDPTSETUPSTAT (hw_bank.lpm ? 0x0D8UL : 0x06CUL) | 148 | #define CAP_ENDPTSETUPSTAT (hw_bank.lpm ? 0x0D8UL : 0x06CUL) |
148 | #define CAP_ENDPTPRIME (hw_bank.lpm ? 0x0DCUL : 0x070UL) | 149 | #define CAP_ENDPTPRIME (hw_bank.lpm ? 0x0DCUL : 0x070UL) |
@@ -1986,6 +1987,8 @@ static int ep_enable(struct usb_ep *ep, | |||
1986 | do { | 1987 | do { |
1987 | dbg_event(_usb_addr(mEp), "ENABLE", 0); | 1988 | dbg_event(_usb_addr(mEp), "ENABLE", 0); |
1988 | 1989 | ||
1990 | mEp->qh[mEp->dir].ptr->cap = 0; | ||
1991 | |||
1989 | if (mEp->type == USB_ENDPOINT_XFER_CONTROL) | 1992 | if (mEp->type == USB_ENDPOINT_XFER_CONTROL) |
1990 | mEp->qh[mEp->dir].ptr->cap |= QH_IOS; | 1993 | mEp->qh[mEp->dir].ptr->cap |= QH_IOS; |
1991 | else if (mEp->type == USB_ENDPOINT_XFER_ISOC) | 1994 | else if (mEp->type == USB_ENDPOINT_XFER_ISOC) |
diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c index 5c030b080d4c..381a53b3e11c 100644 --- a/drivers/usb/gadget/file_storage.c +++ b/drivers/usb/gadget/file_storage.c | |||
@@ -738,7 +738,6 @@ static struct fsg_dev *the_fsg; | |||
738 | static struct usb_gadget_driver fsg_driver; | 738 | static struct usb_gadget_driver fsg_driver; |
739 | 739 | ||
740 | static void close_backing_file(struct lun *curlun); | 740 | static void close_backing_file(struct lun *curlun); |
741 | static void close_all_backing_files(struct fsg_dev *fsg); | ||
742 | 741 | ||
743 | 742 | ||
744 | /*-------------------------------------------------------------------------*/ | 743 | /*-------------------------------------------------------------------------*/ |
@@ -3593,12 +3592,10 @@ static int fsg_main_thread(void *fsg_) | |||
3593 | fsg->thread_task = NULL; | 3592 | fsg->thread_task = NULL; |
3594 | spin_unlock_irq(&fsg->lock); | 3593 | spin_unlock_irq(&fsg->lock); |
3595 | 3594 | ||
3596 | /* In case we are exiting because of a signal, unregister the | 3595 | /* If we are exiting because of a signal, unregister the |
3597 | * gadget driver and close the backing file. */ | 3596 | * gadget driver. */ |
3598 | if (test_and_clear_bit(REGISTERED, &fsg->atomic_bitflags)) { | 3597 | if (test_and_clear_bit(REGISTERED, &fsg->atomic_bitflags)) |
3599 | usb_gadget_unregister_driver(&fsg_driver); | 3598 | usb_gadget_unregister_driver(&fsg_driver); |
3600 | close_all_backing_files(fsg); | ||
3601 | } | ||
3602 | 3599 | ||
3603 | /* Let the unbind and cleanup routines know the thread has exited */ | 3600 | /* Let the unbind and cleanup routines know the thread has exited */ |
3604 | complete_and_exit(&fsg->thread_notifier, 0); | 3601 | complete_and_exit(&fsg->thread_notifier, 0); |
@@ -3703,14 +3700,6 @@ static void close_backing_file(struct lun *curlun) | |||
3703 | } | 3700 | } |
3704 | } | 3701 | } |
3705 | 3702 | ||
3706 | static void close_all_backing_files(struct fsg_dev *fsg) | ||
3707 | { | ||
3708 | int i; | ||
3709 | |||
3710 | for (i = 0; i < fsg->nluns; ++i) | ||
3711 | close_backing_file(&fsg->luns[i]); | ||
3712 | } | ||
3713 | |||
3714 | 3703 | ||
3715 | static ssize_t show_ro(struct device *dev, struct device_attribute *attr, char *buf) | 3704 | static ssize_t show_ro(struct device *dev, struct device_attribute *attr, char *buf) |
3716 | { | 3705 | { |
@@ -3845,6 +3834,7 @@ static void /* __init_or_exit */ fsg_unbind(struct usb_gadget *gadget) | |||
3845 | if (curlun->registered) { | 3834 | if (curlun->registered) { |
3846 | device_remove_file(&curlun->dev, &dev_attr_ro); | 3835 | device_remove_file(&curlun->dev, &dev_attr_ro); |
3847 | device_remove_file(&curlun->dev, &dev_attr_file); | 3836 | device_remove_file(&curlun->dev, &dev_attr_file); |
3837 | close_backing_file(curlun); | ||
3848 | device_unregister(&curlun->dev); | 3838 | device_unregister(&curlun->dev); |
3849 | curlun->registered = 0; | 3839 | curlun->registered = 0; |
3850 | } | 3840 | } |
@@ -4190,7 +4180,6 @@ autoconf_fail: | |||
4190 | out: | 4180 | out: |
4191 | fsg->state = FSG_STATE_TERMINATED; // The thread is dead | 4181 | fsg->state = FSG_STATE_TERMINATED; // The thread is dead |
4192 | fsg_unbind(gadget); | 4182 | fsg_unbind(gadget); |
4193 | close_all_backing_files(fsg); | ||
4194 | complete(&fsg->thread_notifier); | 4183 | complete(&fsg->thread_notifier); |
4195 | return rc; | 4184 | return rc; |
4196 | } | 4185 | } |
@@ -4284,7 +4273,6 @@ static void __exit fsg_cleanup(void) | |||
4284 | /* Wait for the thread to finish up */ | 4273 | /* Wait for the thread to finish up */ |
4285 | wait_for_completion(&fsg->thread_notifier); | 4274 | wait_for_completion(&fsg->thread_notifier); |
4286 | 4275 | ||
4287 | close_all_backing_files(fsg); | ||
4288 | kref_put(&fsg->ref, fsg_release); | 4276 | kref_put(&fsg->ref, fsg_release); |
4289 | } | 4277 | } |
4290 | module_exit(fsg_cleanup); | 4278 | module_exit(fsg_cleanup); |
diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c index 57d9641c6bf8..a2db0e174f2c 100644 --- a/drivers/usb/gadget/omap_udc.c +++ b/drivers/usb/gadget/omap_udc.c | |||
@@ -3104,7 +3104,6 @@ static int omap_udc_resume(struct platform_device *dev) | |||
3104 | /*-------------------------------------------------------------------------*/ | 3104 | /*-------------------------------------------------------------------------*/ |
3105 | 3105 | ||
3106 | static struct platform_driver udc_driver = { | 3106 | static struct platform_driver udc_driver = { |
3107 | .probe = omap_udc_probe, | ||
3108 | .remove = __exit_p(omap_udc_remove), | 3107 | .remove = __exit_p(omap_udc_remove), |
3109 | .suspend = omap_udc_suspend, | 3108 | .suspend = omap_udc_suspend, |
3110 | .resume = omap_udc_resume, | 3109 | .resume = omap_udc_resume, |
@@ -3122,7 +3121,7 @@ static int __init udc_init(void) | |||
3122 | #endif | 3121 | #endif |
3123 | "%s\n", driver_desc, | 3122 | "%s\n", driver_desc, |
3124 | use_dma ? " (dma)" : ""); | 3123 | use_dma ? " (dma)" : ""); |
3125 | return platform_driver_register(&udc_driver); | 3124 | return platform_driver_probe(&udc_driver, omap_udc_probe); |
3126 | } | 3125 | } |
3127 | module_init(udc_init); | 3126 | module_init(udc_init); |
3128 | 3127 | ||
diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c index 96d65ca06ecd..4007770f7ed2 100644 --- a/drivers/usb/gadget/u_ether.c +++ b/drivers/usb/gadget/u_ether.c | |||
@@ -175,12 +175,6 @@ static void eth_get_drvinfo(struct net_device *net, struct ethtool_drvinfo *p) | |||
175 | strlcpy(p->bus_info, dev_name(&dev->gadget->dev), sizeof p->bus_info); | 175 | strlcpy(p->bus_info, dev_name(&dev->gadget->dev), sizeof p->bus_info); |
176 | } | 176 | } |
177 | 177 | ||
178 | static u32 eth_get_link(struct net_device *net) | ||
179 | { | ||
180 | struct eth_dev *dev = netdev_priv(net); | ||
181 | return dev->gadget->speed != USB_SPEED_UNKNOWN; | ||
182 | } | ||
183 | |||
184 | /* REVISIT can also support: | 178 | /* REVISIT can also support: |
185 | * - WOL (by tracking suspends and issuing remote wakeup) | 179 | * - WOL (by tracking suspends and issuing remote wakeup) |
186 | * - msglevel (implies updated messaging) | 180 | * - msglevel (implies updated messaging) |
@@ -189,7 +183,7 @@ static u32 eth_get_link(struct net_device *net) | |||
189 | 183 | ||
190 | static struct ethtool_ops ops = { | 184 | static struct ethtool_ops ops = { |
191 | .get_drvinfo = eth_get_drvinfo, | 185 | .get_drvinfo = eth_get_drvinfo, |
192 | .get_link = eth_get_link | 186 | .get_link = ethtool_op_get_link, |
193 | }; | 187 | }; |
194 | 188 | ||
195 | static void defer_kevent(struct eth_dev *dev, int flag) | 189 | static void defer_kevent(struct eth_dev *dev, int flag) |