diff options
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/at91_udc.c | 4 | ||||
-rw-r--r-- | drivers/usb/gadget/dummy_hcd.c | 2 | ||||
-rw-r--r-- | drivers/usb/gadget/gmidi.c | 1 | ||||
-rw-r--r-- | drivers/usb/gadget/goku_udc.c | 2 | ||||
-rw-r--r-- | drivers/usb/gadget/lh7a40x_udc.c | 2 | ||||
-rw-r--r-- | drivers/usb/gadget/net2280.c | 26 | ||||
-rw-r--r-- | drivers/usb/gadget/omap_udc.c | 9 | ||||
-rw-r--r-- | drivers/usb/gadget/pxa2xx_udc.c | 13 |
8 files changed, 33 insertions, 26 deletions
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c index 77beba485a84..72f3db99ff94 100644 --- a/drivers/usb/gadget/at91_udc.c +++ b/drivers/usb/gadget/at91_udc.c @@ -1366,7 +1366,7 @@ static void handle_ep0(struct at91_udc *udc) } } -static irqreturn_t at91_udc_irq (int irq, void *_udc, struct pt_regs *r) +static irqreturn_t at91_udc_irq (int irq, void *_udc) { struct at91_udc *udc = _udc; u32 rescans = 5; @@ -1552,7 +1552,7 @@ static struct at91_udc controller = { /* ep6 and ep7 are also reserved (custom silicon might use them) */ }; -static irqreturn_t at91_vbus_irq(int irq, void *_udc, struct pt_regs *r) +static irqreturn_t at91_vbus_irq(int irq, void *_udc) { struct at91_udc *udc = _udc; unsigned value; diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c index 4d2946e540cf..f1f32d7be5f9 100644 --- a/drivers/usb/gadget/dummy_hcd.c +++ b/drivers/usb/gadget/dummy_hcd.c @@ -1551,7 +1551,7 @@ return_urb: ep->already_seen = ep->setup_stage = 0; spin_unlock (&dum->lock); - usb_hcd_giveback_urb (dummy_to_hcd(dum), urb, NULL); + usb_hcd_giveback_urb (dummy_to_hcd(dum), urb); spin_lock (&dum->lock); goto restart; diff --git a/drivers/usb/gadget/gmidi.c b/drivers/usb/gadget/gmidi.c index 83601d4009e3..64554acad63f 100644 --- a/drivers/usb/gadget/gmidi.c +++ b/drivers/usb/gadget/gmidi.c @@ -21,7 +21,6 @@ #define DEBUG 1 // #define VERBOSE -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/delay.h> diff --git a/drivers/usb/gadget/goku_udc.c b/drivers/usb/gadget/goku_udc.c index 7cf2999e8616..a3076da3f4eb 100644 --- a/drivers/usb/gadget/goku_udc.c +++ b/drivers/usb/gadget/goku_udc.c @@ -1628,7 +1628,7 @@ stall: handled = 1; \ } -static irqreturn_t goku_irq(int irq, void *_dev, struct pt_regs *r) +static irqreturn_t goku_irq(int irq, void *_dev) { struct goku_udc *dev = _dev; struct goku_udc_regs __iomem *regs = dev->regs; diff --git a/drivers/usb/gadget/lh7a40x_udc.c b/drivers/usb/gadget/lh7a40x_udc.c index 36db72579377..179259664c18 100644 --- a/drivers/usb/gadget/lh7a40x_udc.c +++ b/drivers/usb/gadget/lh7a40x_udc.c @@ -922,7 +922,7 @@ static void lh7a40x_reset_intr(struct lh7a40x_udc *dev) /* * lh7a40x usb client interrupt handler. */ -static irqreturn_t lh7a40x_udc_irq(int irq, void *_dev, struct pt_regs *r) +static irqreturn_t lh7a40x_udc_irq(int irq, void *_dev) { struct lh7a40x_udc *dev = _dev; diff --git a/drivers/usb/gadget/net2280.c b/drivers/usb/gadget/net2280.c index 3bda37f9a35f..3acc896a5d4c 100644 --- a/drivers/usb/gadget/net2280.c +++ b/drivers/usb/gadget/net2280.c @@ -1774,8 +1774,8 @@ static DEVICE_ATTR (queues, S_IRUGO, show_queues, NULL); #else -#define device_create_file(a,b) do {} while (0) -#define device_remove_file device_create_file +#define device_create_file(a,b) (0) +#define device_remove_file(a,b) do { } while (0) #endif @@ -2044,8 +2044,10 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver) return retval; } - device_create_file (&dev->pdev->dev, &dev_attr_function); - device_create_file (&dev->pdev->dev, &dev_attr_queues); + retval = device_create_file (&dev->pdev->dev, &dev_attr_function); + if (retval) goto err_unbind; + retval = device_create_file (&dev->pdev->dev, &dev_attr_queues); + if (retval) goto err_func; /* ... then enable host detection and ep0; and we're ready * for set_configuration as well as eventual disconnect. @@ -2060,6 +2062,14 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver) /* pci writes may still be posted */ return 0; + +err_func: + device_remove_file (&dev->pdev->dev, &dev_attr_function); +err_unbind: + driver->unbind (&dev->gadget); + dev->gadget.dev.driver = NULL; + dev->driver = NULL; + return retval; } EXPORT_SYMBOL (usb_gadget_register_driver); @@ -2753,7 +2763,7 @@ static void handle_stat1_irqs (struct net2280 *dev, u32 stat) DEBUG (dev, "unhandled irqstat1 %08x\n", stat); } -static irqreturn_t net2280_irq (int irq, void *_dev, struct pt_regs * r) +static irqreturn_t net2280_irq (int irq, void *_dev) { struct net2280 *dev = _dev; @@ -2974,8 +2984,10 @@ static int net2280_probe (struct pci_dev *pdev, const struct pci_device_id *id) : "disabled"); the_controller = dev; - device_register (&dev->gadget.dev); - device_create_file (&pdev->dev, &dev_attr_registers); + retval = device_register (&dev->gadget.dev); + if (retval) goto done; + retval = device_create_file (&pdev->dev, &dev_attr_registers); + if (retval) goto done; return 0; diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c index 8c18df869833..48a09fd89d18 100644 --- a/drivers/usb/gadget/omap_udc.c +++ b/drivers/usb/gadget/omap_udc.c @@ -1815,8 +1815,7 @@ static void devstate_irq(struct omap_udc *udc, u16 irq_src) UDC_IRQ_SRC_REG = UDC_DS_CHG; } -static irqreturn_t -omap_udc_irq(int irq, void *_udc, struct pt_regs *r) +static irqreturn_t omap_udc_irq(int irq, void *_udc) { struct omap_udc *udc = _udc; u16 irq_src; @@ -1888,8 +1887,7 @@ static void pio_out_timer(unsigned long _ep) spin_unlock_irqrestore(&ep->udc->lock, flags); } -static irqreturn_t -omap_udc_pio_irq(int irq, void *_dev, struct pt_regs *r) +static irqreturn_t omap_udc_pio_irq(int irq, void *_dev) { u16 epn_stat, irq_src; irqreturn_t status = IRQ_NONE; @@ -1968,8 +1966,7 @@ omap_udc_pio_irq(int irq, void *_dev, struct pt_regs *r) } #ifdef USE_ISO -static irqreturn_t -omap_udc_iso_irq(int irq, void *_dev, struct pt_regs *r) +static irqreturn_t omap_udc_iso_irq(int irq, void *_dev) { struct omap_udc *udc = _dev; struct omap_ep *ep; diff --git a/drivers/usb/gadget/pxa2xx_udc.c b/drivers/usb/gadget/pxa2xx_udc.c index f1adcf8b2023..671c24bc6d75 100644 --- a/drivers/usb/gadget/pxa2xx_udc.c +++ b/drivers/usb/gadget/pxa2xx_udc.c @@ -43,11 +43,11 @@ #include <linux/mm.h> #include <linux/platform_device.h> #include <linux/dma-mapping.h> +#include <linux/irq.h> #include <asm/byteorder.h> #include <asm/dma.h> #include <asm/io.h> -#include <asm/irq.h> #include <asm/system.h> #include <asm/mach-types.h> #include <asm/unaligned.h> @@ -110,7 +110,7 @@ static int use_dma = 1; module_param(use_dma, bool, 0); MODULE_PARM_DESC (use_dma, "true to use dma"); -static void dma_nodesc_handler (int dmach, void *_ep, struct pt_regs *r); +static void dma_nodesc_handler (int dmach, void *_ep); static void kick_dma(struct pxa2xx_ep *ep, struct pxa2xx_request *req); #ifdef USE_OUT_DMA @@ -828,7 +828,7 @@ static void cancel_dma(struct pxa2xx_ep *ep) } /* dma channel stopped ... normal tx end (IN), or on error (IN/OUT) */ -static void dma_nodesc_handler(int dmach, void *_ep, struct pt_regs *r) +static void dma_nodesc_handler(int dmach, void *_ep) { struct pxa2xx_ep *ep = _ep; struct pxa2xx_request *req; @@ -1724,7 +1724,7 @@ EXPORT_SYMBOL(usb_gadget_unregister_driver); */ static irqreturn_t -lubbock_vbus_irq(int irq, void *_dev, struct pt_regs *r) +lubbock_vbus_irq(int irq, void *_dev) { struct pxa2xx_udc *dev = _dev; int vbus; @@ -1754,8 +1754,7 @@ lubbock_vbus_irq(int irq, void *_dev, struct pt_regs *r) #endif -static irqreturn_t -udc_vbus_irq(int irq, void *_dev, struct pt_regs *r) +static irqreturn_t udc_vbus_irq(int irq, void *_dev) { struct pxa2xx_udc *dev = _dev; int vbus = pxa_gpio_get(dev->mach->gpio_vbus); @@ -2084,7 +2083,7 @@ static void handle_ep(struct pxa2xx_ep *ep) * could cause usb protocol errors. */ static irqreturn_t -pxa2xx_udc_irq(int irq, void *_dev, struct pt_regs *r) +pxa2xx_udc_irq(int irq, void *_dev) { struct pxa2xx_udc *dev = _dev; int handled; |