aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb
AgeCommit message (Collapse)AuthorFilesLines
2010-11-16USB device driver of Topcliff PCHToshiharu Okada4-0/+2971
This patch adds the USB device driver of EG20T(Topcliff) PCH. EG20T PCH is the platform controller hub that is going to be used in Intel's upcoming general embedded platform. All IO peripherals in EG20T PCH are actually devices sitting on AMBA bus. EG20T PCH has USB device I/F. Using this I/F, it is able to access system devices connected to USB device. Signed-off-by: Toshiharu Okada <[email protected]> Acked-by: Michał Nazarewicz <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-11-16usb: gadget: f_fs: remove custom printk() wrappersMichal Nazarewicz1-60/+48
This commit removes custom printk() wrappers from the f_fs.c file. They served little purpose above what pr_*() family of macros provides. Only FVDBG() has been left but renamed to pr_vdebug() to match other uses. Signed-off-by: Michal Nazarewicz <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-11-16usb: gadget: FunctionFS: fix typos and coding styleMichal Nazarewicz2-178/+186
This commit changes FunctionFS as to make it more compliant with coding style as well as fixes several typos. Signed-off-by: Michal Nazarewicz <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-11-16drivers/usb/gadget: Remove unnecessary semicolonsJoe Perches1-1/+1
Signed-off-by: Joe Perches <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-11-16drivers/usb/host/uhci-hcd.c: Remove unnecessary casts of pci_get_drvdataJoe Perches1-1/+1
Signed-off-by: Joe Perches <[email protected]> Acked-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-11-16USB host: Adding USB ehci & ohci support for spear platformDeepak Sikri5-0/+464
This patch adds support for ehci and ohci controller in the SPEAr platform. Changes since V2: added clear_tt_buffer_complete in ehci_spear_hc_driver Signed-off-by: Deepak Sikri <[email protected]> Signed-off-by: Viresh Kumar <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-11-16USB: EHCI: fix obscure race in ehci_endpoint_disableAlan Stern1-5/+5
This patch (as1435) fixes an obscure and unlikely race in ehci-hcd. When an async URB is unlinked, the corresponding QH is removed from the async list. If the QH's endpoint is then disabled while the URB is being given back, ehci_endpoint_disable() won't find the QH on the async list, causing it to believe that the QH has been lost. This will lead to a memory leak at best and quite possibly to an oops. The solution is to trust usbcore not to lose track of endpoints. If the QH isn't on the async list then it doesn't need to be taken off the list, but the driver should still wait for the QH to become IDLE before disabling it. In theory this fixes Bugzilla #20182. In fact the race is so rare that it's not possible to tell whether the bug is still present. However, adding delays and making other changes to force the race seems to show that the patch works. Signed-off-by: Alan Stern <[email protected]> Reported-by: Stefan Richter <[email protected]> CC: David Brownell <[email protected]> CC: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-11-16USB: gadget: AT91: fix typo in atmel_usba_udc driverJosh Wu1-1/+1
compile fix for bug introduced by 969affff547027) Signed-off-by: Josh Wu <[email protected]> Cc: Jiri Kosina <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-11-16USB: isp1362-hcd - fix section mismatch warningAxel Lin1-1/+1
Fix section mismatch warning by using "__devinit" annotation for isp1362_probe. WARNING: drivers/usb/host/isp1362-hcd.o(.data+0x0): Section mismatch in reference from the variable isp1362_driver to the function .init.text:isp1362_probe() The variable isp1362_driver references the function __init isp1362_probe() If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, Signed-off-by: Axel Lin <[email protected]> Acked-by: Mike Frysinger <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-11-16USB: EHCI: AMD periodic frame list table quirkAndiry Xu4-5/+57
On AMD SB700/SB800/Hudson-2/3 platforms, USB EHCI controller may read/write to memory space not allocated to USB controller if there is longer than normal latency on DMA read encountered. In this condition the exposure will be encountered only if the driver has following format of Periodic Frame List link pointer structure: For any idle periodic schedule, the Frame List link pointers that have the T-bit set to 1 intending to terminate the use of frame list link pointer as a physical memory pointer. Idle periodic schedule Frame List Link pointer shoule be in the following format to avoid the issue: Frame list link pointer should be always contains a valid pointer to a inactive QHead with T-bit set to 0. Signed-off-by: Andiry Xu <[email protected]> Acked-by: David Brownell <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-11-16SCSI host lock push-downJeff Garzik3-4/+10
Move the mid-layer's ->queuecommand() invocation from being locked with the host lock to being unlocked to facilitate speeding up the critical path for drivers who don't need this lock taken anyway. The patch below presents a simple SCSI host lock push-down as an equivalent transformation. No locking or other behavior should change with this patch. All existing bugs and locking orders are preserved. Additionally, add one parameter to queuecommand, struct Scsi_Host * and remove one parameter from queuecommand, void (*done)(struct scsi_cmnd *) Scsi_Host* is a convenient pointer that most host drivers need anyway, and 'done' is redundant to struct scsi_cmnd->scsi_done. Minimal code disturbance was attempted with this change. Most drivers needed only two one-line modifications for their host lock push-down. Signed-off-by: Jeff Garzik <[email protected]> Acked-by: James Bottomley <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2010-11-16Staging: Merge 2.6.37-rc2 into staging-nextGreg Kroah-Hartman19-100/+183
This was necessary in order to resolve some conflicts that happened between -rc1 and -rc2 with the following files: drivers/staging/bcm/Bcmchar.c drivers/staging/intel_sst/intel_sst_app_interface.c All should be resolved now. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-11-15USB: OTG: langwell_otg: fix up some sysfs attribute permissionsGreg Kroah-Hartman1-5/+4
They should not be writable by any user. Reported-by: Linus Torvalds <[email protected]> Cc: Hao Wu <[email protected]> Cc: Alan Cox <[email protected]> Cc: Alek Du <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-11-15USB: misc: usbsevseg: fix up some sysfs attribute permissionsGreg Kroah-Hartman1-6/+4
They should not be writable by any user. Reported-by: Linus Torvalds <[email protected]> Cc: Harrison Metzger <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-11-15USB: misc: usbled: fix up some sysfs attribute permissionsGreg Kroah-Hartman1-1/+1
They should not be writable by any user. Reported-by: Linus Torvalds <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-11-15USB: misc: trancevibrator: fix up a sysfs attribute permissionGreg Kroah-Hartman1-1/+1
It should not be writable by any user. Reported-by: Linus Torvalds <[email protected]> Cc: Sam Hocevar <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-11-15USB: misc: cypress_cy7c63: fix up some sysfs attribute permissionsGreg Kroah-Hartman1-4/+2
They should not be writable by any user. Reported-by: Linus Torvalds <[email protected]> Cc: Oliver Bock <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-11-15USB: storage: sierra_ms: fix sysfs file attributeGreg Kroah-Hartman1-1/+1
A non-writable sysfs file shouldn't have writable attributes. Reported-by: Linus Torvalds <[email protected]> Cc: Kevin Lloyd <[email protected]> Cc: Matthew Dharm <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-11-15USB: ehci: fix debugfs 'lpm' permissionsGreg Kroah-Hartman1-1/+1
The permissions for the lpm debugfs file is incorrect, this fixes it. Reported-by: Linus Torvalds <[email protected]> Cc: Alek Du <[email protected]> Cc: Jacob Pan <[email protected]> Cc: David Brownell <[email protected]> Cc: Alan Stern <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-11-15USB: atm: ueagle-atm: fix up some permissions on the sysfs filesGreg Kroah-Hartman1-4/+3
Some of the sysfs files had the incorrect permissions. Some didn't make sense at all (writable for a file that you could not write to?) Reported-by: Linus Torvalds <[email protected]> Cc: Matthieu Castet <[email protected]> Cc: Stanislaw Gruszka <[email protected]> Cc: Damien Bergamini <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-11-15Merge branch 'for-usb-linus' of ↵Greg Kroah-Hartman4-13/+70
git://git.kernel.org/pub/scm/linux/kernel/git/sarah/xhci into usb-linus * 'for-usb-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sarah/xhci: xhci: Fix command ring replay after resume. xHCI: fix wMaxPacketSize mask xHCI: release spinlock when setup interrupt xhci: Remove excessive printks with shared IRQs.
2010-11-15xhci: Fix command ring replay after resume.Sarah Sharp1-10/+61
Andiry's xHCI bus suspend patch introduced the possibly of a host controller replaying old commands on the command ring, if the host successfully restores the registers after a resume. After a resume from suspend, the xHCI driver must restore the registers, including the command ring pointer. I had suggested that Andiry set the command ring pointer to the current command ring dequeue pointer, so that the driver wouldn't have to zero the command ring. Unfortunately, setting the command ring pointer to the current dequeue pointer won't work because the register assumes the pointer is 64-byte aligned, and TRBs on the command ring are 16-byte aligned. The lower seven bits will always be masked off, leading to the written pointer being up to 3 TRBs behind the intended pointer. Here's a log excerpt. On init, the xHCI driver places a vendor-specific command on the command ring: [ 215.750958] xhci_hcd 0000:01:00.0: Vendor specific event TRB type = 48 [ 215.750960] xhci_hcd 0000:01:00.0: NEC firmware version 30.25 [ 215.750962] xhci_hcd 0000:01:00.0: Command ring deq = 0x3781e010 (DMA) When we resume, the command ring dequeue pointer to be written should have been 0x3781e010. Instead, it's 0x3781e000: [ 235.557846] xhci_hcd 0000:01:00.0: // Setting command ring address to 0x3781e001 [ 235.557848] xhci_hcd 0000:01:00.0: `MEM_WRITE_DWORD(3'b000, 64'hffffc900100bc038, 64'h3781e001, 4'hf); [ 235.557850] xhci_hcd 0000:01:00.0: `MEM_WRITE_DWORD(3'b000, 32'hffffc900100bc020, 32'h204, 4'hf); [ 235.557866] usb usb9: root hub lost power or was reset (I can't see the results of this bug because the xHCI restore always fails on this box, and the xHCI driver re-allocates everything.) The fix is to zero the command ring and put the software and hardware enqueue and dequeue pointer back to the beginning of the ring. We do this before the system suspends, to be paranoid and prevent the BIOS from starting the host without clearing the command ring pointer, which might cause the host to muck with stale memory. (The pointer isn't required to be in the suspend power well, but it could be.) The command ring pointer is set again after the host resumes. Signed-off-by: Sarah Sharp <[email protected]> Tested-by: Andiry Xu <[email protected]>
2010-11-13block: check bdev_read_only() from blkdev_get()Tejun Heo1-5/+2
bdev read-only status can be queried using bdev_read_only() and may change while the device is being opened. Enforce it by checking it from blkdev_get() after open succeeds. This makes bdev_read_only() check in open_bdev_exclusive() and fsg_lun_open() unnecessary. Drop them. Signed-off-by: Tejun Heo <[email protected]> Cc: David Brownell <[email protected]> Cc: [email protected]
2010-11-12Merge branch 'usb-linus' of ↵Linus Torvalds18-96/+182
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6 * 'usb-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (28 commits) Revert "USB: xhci: Use GFP_ATOMIC under spin_lock" USB: ohci-jz4740: Fix spelling in MODULE_ALIAS UWB: Return UWB_RSV_ALLOC_NOT_FOUND rather than crashing on NULL dereference if kzalloc fails usb: core: fix information leak to userland usb: misc: iowarrior: fix information leak to userland usb: misc: sisusbvga: fix information leak to userland usb: subtle increased memory usage in u_serial USB: option: fix when the driver is loaded incorrectly for some Huawei devices. USB: xhci: Use GFP_ATOMIC under spin_lock usb: gadget: goku_udc: add registered flag bit, fixing build USB: ehci/mxc: compile fix USB: Fix FSL USB driver on non Open Firmware systems USB: the development of the usb tree is now in git usb: musb: fail unaligned DMA transfers on v1.8 and above USB: ftdi_sio: add device IDs for Milkymist One JTAG/serial usb.h: fix ioctl kernel-doc info usb: musb: gadget: kill duplicate code in musb_gadget_queue() usb: musb: Fix handling of spurious SESSREQ usb: musb: fix kernel oops when loading musb_hdrc module for the 2nd time USB: musb: blackfin: push clkin value to platform resources ...
2010-11-11xHCI: fix wMaxPacketSize maskAndiry Xu2-2/+7
USB2.0 spec 9.6.6 says: For all endpoints, bit 10..0 specify the maximum packet size(in bytes). So the wMaxPacketSize mask should be 0x7ff rather than 0x3ff. This patch should be queued for the stable tree. The bug in xhci_endpoint_init() was present as far back as 2.6.31, and the bug in xhci_get_max_esit_payload() was present when the function was introduced in 2.6.34. Reported-by: Sander Eikelenboom <[email protected]> Signed-off-by: Andiry Xu <[email protected]> Signed-off-by: Sarah Sharp <[email protected]> Cc: [email protected]
2010-11-11xHCI: release spinlock when setup interruptAndiry Xu1-0/+2
Jiri Slaby reports spinlock is held while calling kmalloc(GFP_KERNEL) and request_irq() in xhci_resume(). Release the spinlock when setup interrupt. Reported-by: Jiri Slaby <[email protected]> Signed-off-by: Andiry Xu <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2010-11-11xhci: Remove excessive printks with shared IRQs.Sarah Sharp1-1/+0
If the xHCI host controller shares an interrupt line with another device, the xHCI driver needs to check if the interrupt was generated by its hardware. Unfortunately, the user will see a ton of "Spurious interrupt." lines if the other hardware interrupts often. Lawrence found his dmesg output cluttered with this output when the xHCI host shared an interrupt with his i915 hardware. Remove the warning, as sharing an interrupt is a normal thing. This should be applied to the 2.6.36 stable tree. Signed-off-by: Sarah Sharp <[email protected]> Reported-by: Lawrence Rust <[email protected]> Cc: [email protected]
2010-11-11Revert "USB: xhci: Use GFP_ATOMIC under spin_lock"Greg Kroah-Hartman1-1/+1
This reverts commit ef821ae70fc35a76bdce7e07c70a1a7c2c33cdb9. The correct thing to do is to drop the spinlock, not change the GFP flag here. Thanks to Sarah for pointing out I shouldn't have taken this patch in the first place. Cc: Sarah Sharp <[email protected]> Cc: David Sterba <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-11-11USB: ohci-jz4740: Fix spelling in MODULE_ALIASStefan Weil1-1/+1
platfrom -> platform Cc: David Brownell <[email protected]> Signed-off-by: Stefan Weil <[email protected]> Reviewed-by: Jesper Juhl <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-11-11usb: core: fix information leak to userlandVasiliy Kulikov1-3/+4
Structure usbdevfs_connectinfo is copied to userland with padding byted after "slow" field uninitialized. It leads to leaking of contents of kernel stack memory. Signed-off-by: Vasiliy Kulikov <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-11-11usb: misc: iowarrior: fix information leak to userlandVasiliy Kulikov1-0/+1
Structure iowarrior_info is copied to userland with padding byted between "serial" and "revision" fields uninitialized. It leads to leaking of contents of kernel stack memory. Signed-off-by: Vasiliy Kulikov <[email protected]> Cc: stable <[email protected]> Acked-by: Kees Cook <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-11-11usb: misc: sisusbvga: fix information leak to userlandVasiliy Kulikov1-0/+1
Structure sisusb_info is copied to userland with "sisusb_reserved" field uninitialized. It leads to leaking of contents of kernel stack memory. Signed-off-by: Vasiliy Kulikov <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-11-11usb: subtle increased memory usage in u_serialJim Sung1-14/+40
OK, the USB gadget serial driver actually has a couple of problems. On gs_open(), it always allocates and queues an additional QUEUE_SIZE (16) worth of requests, so with a loop like this: i=1 ; while echo $i > /dev/ttyGS0 ; do let i++ ; done eventually we run into OOM (Out of Memory). Technically, it is not a leak as everything gets freed up when the USB connection is broken, but not on gs_close(). With a USB device/gadget controller driver that has limited resources (e.g., Marvell has a this MAX_XDS_FOR_TR_CALLS of 64 for transmit and receive), so even after 4 stty -F /dev/ttyGS0 we cannot transmit anymore. We can still receive (not necessarily reliably) as now we have 16 * 4 = 64 descriptors/buffers ready, but the device is otherwise not usable. Signed-off-by: Jim Sung <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-11-11USB: option: fix when the driver is loaded incorrectly for some Huawei devices.ma rui1-1/+1
When huawei datacard with PID 0x14AC is insterted into Linux system, the present kernel will load the "option" driver to all the interfaces. But actually, some interfaces run as other function and do not need "option" driver. In this path, we modify the id_tables, when the PID is 0x14ac ,VID is 0x12d1, Only when the interface's Class is 0xff,Subclass is 0xff, Pro is 0xff, it does need "option" driver. Signed-off-by: ma rui <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-11-11USB: xhci: Use GFP_ATOMIC under spin_lockDavid Sterba1-1/+1
coccinelle check scripts/coccinelle/locks/call_kern.cocci found that in drivers/usb/host/xhci.c an allocation with GFP_KERNEL is done with locks held: xhci_resume spin_lock_irq(xhci->lock) xhci_setup_msix kmalloc(GFP_KERNEL) Change it to GFP_ATOMIC. Signed-off-by: David Sterba <[email protected]> CC: Sarah Sharp <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-11-11usb: gadget: goku_udc: add registered flag bit, fixing buildAndy Whitcroft1-1/+2
The commit below cleaned up error handling, in part by introducing a registered flag bit. This however was not added to the device structure leding to build failures: commit 319feaabb6c7ccd90da6e3207563c265da7d21ae Author: Dan Carpenter <[email protected]> Date: Tue Oct 5 18:55:34 2010 +0200 usb: gadget: goku_udc: Fix error path Add the missing registered flag bit. Signed-off-by: Andy Whitcroft <[email protected]> Acked-by: Dan Carpenter <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-11-11USB: ehci/mxc: compile fixUwe Kleine-König1-5/+9
Commit 65fd427 (USB: ehci tdi : let's tdi_reset set host mode) broke the build using ARM's mx51_defconfig: CC drivers/usb/host/ehci-hcd.o In file included from drivers/usb/host/ehci-hcd.c:1166: drivers/usb/host/ehci-mxc.c: In function 'ehci_mxc_drv_probe': drivers/usb/host/ehci-mxc.c:192: error: 'ehci' undeclared (first use in this function) drivers/usb/host/ehci-mxc.c:192: error: (Each undeclared identifier is reported only once drivers/usb/host/ehci-mxc.c:192: error: for each function it appears in.) drivers/usb/host/ehci-mxc.c:117: warning: unused variable 'temp' make[3]: *** [drivers/usb/host/ehci-hcd.o] Error 1 make[2]: *** [drivers/usb/host/ehci-hcd.o] Error 2 make[1]: *** [sub-make] Error 2 make: *** [all] Error 2 Fix it together with the warning about the unused variable and use msleep instead of mdelay as requested by Alan Stern. Cc: Dinh Nguyen <[email protected]> Cc: Alan Stern <[email protected]> Signed-off-by: Uwe Kleine-König <[email protected]> Tested-by: Nguyen Dinh-R00091 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-11-11USB: Fix FSL USB driver on non Open Firmware systemsMarc Kleine-Budde2-2/+2
Commit 126512e3f274802ca65ebeca8660237f0361ad48 added support for FSL's USB controller on powerpc. In this commit the Open Firmware code was selected and compiled unconditionally. This breaks on ARM systems from FSL which use the same driver (.i.e. the i.MX series), because ARM don't have OF support (yet). This patch fixes the problem by only selecting the OF code on systems with Open Firmware support. Reported-by: Uwe Kleine-König <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]> Compile-Tested-by: Uwe Kleine-König <[email protected]> Acked-by: Grant Likely <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-11-11usb: Add support for VIA VT8500 and compatibles in EHCI HCDAlexey Charkov3-0/+178
VIA and WonderMedia Systems-on-Chip feature a standard EHCI host controller. This adds necessary glue to use the standard driver with these systems. Signed-off-by: Alexey Charkov <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-11-11usb: dummy_hcd code simplificationTatyana Brokhman1-116/+135
Take handling of the control requests out from dummy_timer to a different function. Signed-off-by: Tatyana Brokhman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-11-11USB: gadget: f_mass_storage: code style clean upsMichal Nazarewicz2-211/+249
This commit is purely style clean ups. Signed-off-by: Michal Nazarewicz <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-11-11USB: gadget: f_mass_storage: remove needless complete()Michal Nazarewicz1-4/+1
This commit removes call to the complete() function done in fsg_unbind() which was never needed there but was a leftover form file_storage.c. Signed-off-by: Michal Nazarewicz <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-11-11USB: gadget: f_mass_storage: drop START_TRANSFER() macroMichal Nazarewicz1-25/+24
This commit drops START_TRANSFER_OR() and START_TRANSFER() macros with a pair of nice inline functions which are actually more readable and easier to use. Signed-off-by: Michal Nazarewicz <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-11-11USB: gadget: f_mass_storage: use ?: instead of a macroMichal Nazarewicz1-7/+4
This commit removes an "OR" macro defined in Mass Storage Function in favour of a two argument version of "?:" operator (which is a GCC extension). Signed-off-by: Michal Nazarewicz <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-11-11USB: gadget: f_mass_storage: put_device() in error recoveryRahul Ruikar1-0/+1
This commit fixes an issue with error recovery after device_register() fails in Mass Storage Function. The device needs to be put to avoid resource leakage. Signed-off-by: Rahul Ruikar <[email protected]> [[email protected]: updated commit message] Signed-off-by: Michal Nazarewicz <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-11-11USB: gadget: file_storage: put_device() in error recoveryMichal Nazarewicz1-13/+16
This commit fixes some issues with File-backed Storage Gadget error recovery when registering LUN's devices. First of all, when device_register() fails the device still needs to be put. However, because lun_release() decreases fsg->ref reference counter the counter must be incremented beforehand. Second of all, after any of the device_create_file()s fails, device_unregister() is called which in turn (indirectly) calls lun_release() which decrements fsg->ref. So, again, the reference counter must be incremented beforehand. Lastly, if the first or the second device_create_file() succeeds, the files are never removed. To fix it, device_remove_file() needs to be called. This is done by simply marking LUN as registered prior to creating files so that fsg_unbind() can handle removing files. Signed-off-by: Michal Nazarewicz <[email protected]> Reported-by: Rahul Ruikar <[email protected]> Acked-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-11-11USB: gadget: composite: Typo fix.Marek Belisko1-1/+1
Signed-off-by: Marek Belisko <[email protected]> Acked-by: David Brownell <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-11-11USB: gadget: amd5536udc.c: delete double assignmentJulia Lawall1-1/+0
Delete successive assignments to the same location. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression i; @@ *i = ...; i = ...; // </smpl> Signed-off-by: Julia Lawall <[email protected]> Acked-by: Thomas Dahlmann <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-11-11usb: gadget/imx-udc: remove usage of deprecated symbol USBD_INT0Uwe Kleine-König2-5/+2
Since v2.6.34-rc2~66^2~5^2~47 USBD_INT0 is deprecated in favour of MX1_USBD_INT0. So use the new name. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-11-11USB: ssu100: remove max_packet_size calculationBill Pemberton1-48/+8
The max_packet_size logic is taken from ftdi_sio, but it's not needed for this device. This also makes proces_read_urb simpler. Signed-off-by: Bill Pemberton <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>