Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6:
  USB: don't rebind drivers after failed resume or reset
  USB: fix memory leak in cdc-acm
  USB: Unusual dev for Mio moov 330 gps
  USB: cdc-wdm: make module autoload work
  USB: Fix unneeded endpoint check in pxa27x_udc
  usb/gadget: fix kernel-doc warning
  USB: Speedtouch: add pre_reset and post_reset routines
  USB: usbtest.c: length, sglen and vary are unsigned, so cannot be negative
  USB: support Huawei data card product IDs
  USB: add ZTE MF626 USB GSM modem entry
  USB: storage: Avoid I/O errors when issuing SCSI ioctls to JMicron USB/ATA bridge
  USB: Fix debugfs_create_file's error checking method for usb/gadget/s3c2410_udc
  USB: ohci: add support for tmio-ohci cell
  • Loading branch information
Linus Torvalds committed Oct 23, 2008
2 parents 4543237 + 6c64094 commit a270283
Show file tree
Hide file tree
Showing 16 changed files with 792 additions and 35 deletions.
3 changes: 2 additions & 1 deletion drivers/usb/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ config USB_ARCH_HAS_OHCI
default y if PXA3xx
default y if ARCH_EP93XX
default y if ARCH_AT91
default y if ARCH_PNX4008
default y if ARCH_PNX4008 && I2C
default y if MFD_TC6393XB
# PPC:
default y if STB03xxx
default y if PPC_MPC52xx
Expand Down
12 changes: 12 additions & 0 deletions drivers/usb/atm/speedtch.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,16 @@ static void speedtch_atm_stop(struct usbatm_data *usbatm, struct atm_dev *atm_de
flush_scheduled_work();
}

static int speedtch_pre_reset(struct usb_interface *intf)
{
return 0;
}

static int speedtch_post_reset(struct usb_interface *intf)
{
return 0;
}


/**********
** USB **
Expand All @@ -740,6 +750,8 @@ static struct usb_driver speedtch_usb_driver = {
.name = speedtch_driver_name,
.probe = speedtch_usb_probe,
.disconnect = usbatm_usb_disconnect,
.pre_reset = speedtch_pre_reset,
.post_reset = speedtch_post_reset,
.id_table = speedtch_usb_ids
};

Expand Down
3 changes: 2 additions & 1 deletion drivers/usb/class/cdc-acm.c
Original file line number Diff line number Diff line change
Expand Up @@ -849,9 +849,10 @@ static void acm_write_buffers_free(struct acm *acm)
{
int i;
struct acm_wb *wb;
struct usb_device *usb_dev = interface_to_usbdev(acm->control);

for (wb = &acm->wb[0], i = 0; i < ACM_NW; i++, wb++) {
usb_buffer_free(acm->dev, acm->writesize, wb->buf, wb->dmah);
usb_buffer_free(usb_dev, acm->writesize, wb->buf, wb->dmah);
}
}

Expand Down
2 changes: 2 additions & 0 deletions drivers/usb/class/cdc-wdm.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ static struct usb_device_id wdm_ids[] = {
{ }
};

MODULE_DEVICE_TABLE (usb, wdm_ids);

#define WDM_MINOR_BASE 176


Expand Down
3 changes: 2 additions & 1 deletion drivers/usb/core/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -1610,7 +1610,8 @@ int usb_external_resume_device(struct usb_device *udev)
status = usb_resume_both(udev);
udev->last_busy = jiffies;
usb_pm_unlock(udev);
do_unbind_rebind(udev, DO_REBIND);
if (status == 0)
do_unbind_rebind(udev, DO_REBIND);

/* Now that the device is awake, we can start trying to autosuspend
* it again. */
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/core/hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -3504,7 +3504,7 @@ int usb_reset_device(struct usb_device *udev)
USB_INTERFACE_BOUND)
rebind = 1;
}
if (rebind)
if (ret == 0 && rebind)
usb_rebind_intf(cintf);
}
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/gadget/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ usb_copy_descriptors(struct usb_descriptor_header **src)
* usb_find_endpoint - find a copy of an endpoint descriptor
* @src: original vector of descriptors
* @copy: copy of @src
* @ep: endpoint descriptor found in @src
* @match: endpoint descriptor found in @src
*
* This returns the copy of the @match descriptor made for @copy. Its
* intended use is to help remembering the endpoint descriptor to use
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/gadget/pxa27x_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ pxa_ep_alloc_request(struct usb_ep *_ep, gfp_t gfp_flags)
struct pxa27x_request *req;

req = kzalloc(sizeof *req, gfp_flags);
if (!req || !_ep)
if (!req)
return NULL;

INIT_LIST_HEAD(&req->queue);
Expand Down
7 changes: 2 additions & 5 deletions drivers/usb/gadget/s3c2410_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1894,11 +1894,8 @@ static int s3c2410_udc_probe(struct platform_device *pdev)
udc->regs_info = debugfs_create_file("registers", S_IRUGO,
s3c2410_udc_debugfs_root,
udc, &s3c2410_udc_debugfs_fops);
if (IS_ERR(udc->regs_info)) {
dev_warn(dev, "debugfs file creation failed %ld\n",
PTR_ERR(udc->regs_info));
udc->regs_info = NULL;
}
if (!udc->regs_info)
dev_warn(dev, "debugfs file creation failed\n");
}

dev_dbg(dev, "probe ok\n");
Expand Down
1 change: 0 additions & 1 deletion drivers/usb/host/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ config USB_OHCI_HCD
tristate "OHCI HCD support"
depends on USB && USB_ARCH_HAS_OHCI
select ISP1301_OMAP if MACH_OMAP_H2 || MACH_OMAP_H3
select I2C if ARCH_PNX4008
---help---
The Open Host Controller Interface (OHCI) is a standard for accessing
USB 1.1 host controller hardware. It does more in hardware than Intel's
Expand Down
21 changes: 21 additions & 0 deletions drivers/usb/host/ohci-hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1075,12 +1075,18 @@ MODULE_LICENSE ("GPL");
#define SM501_OHCI_DRIVER ohci_hcd_sm501_driver
#endif

#ifdef CONFIG_MFD_TC6393XB
#include "ohci-tmio.c"
#define TMIO_OHCI_DRIVER ohci_hcd_tmio_driver
#endif

#if !defined(PCI_DRIVER) && \
!defined(PLATFORM_DRIVER) && \
!defined(OF_PLATFORM_DRIVER) && \
!defined(SA1111_DRIVER) && \
!defined(PS3_SYSTEM_BUS_DRIVER) && \
!defined(SM501_OHCI_DRIVER) && \
!defined(TMIO_OHCI_DRIVER) && \
!defined(SSB_OHCI_DRIVER)
#error "missing bus glue for ohci-hcd"
#endif
Expand Down Expand Up @@ -1147,13 +1153,25 @@ static int __init ohci_hcd_mod_init(void)
goto error_sm501;
#endif

#ifdef TMIO_OHCI_DRIVER
retval = platform_driver_register(&TMIO_OHCI_DRIVER);
if (retval < 0)
goto error_tmio;
#endif

return retval;

/* Error path */
#ifdef TMIO_OHCI_DRIVER
platform_driver_unregister(&TMIO_OHCI_DRIVER);
error_tmio:
#endif
#ifdef SM501_OHCI_DRIVER
platform_driver_unregister(&SM501_OHCI_DRIVER);
error_sm501:
#endif
#ifdef SSB_OHCI_DRIVER
ssb_driver_unregister(&SSB_OHCI_DRIVER);
error_ssb:
#endif
#ifdef PCI_DRIVER
Expand Down Expand Up @@ -1189,6 +1207,9 @@ module_init(ohci_hcd_mod_init);

static void __exit ohci_hcd_mod_exit(void)
{
#ifdef TMIO_OHCI_DRIVER
platform_driver_unregister(&TMIO_OHCI_DRIVER);
#endif
#ifdef SM501_OHCI_DRIVER
platform_driver_unregister(&SM501_OHCI_DRIVER);
#endif
Expand Down
Loading

0 comments on commit a270283

Please sign in to comment.