diff options
author | Richard Röjfors <richard.rojfors@pelagicore.com> | 2010-12-07 11:28:30 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-12-10 17:28:29 -0500 |
commit | 49e208346616328e535b5d6ecd510ab38f210858 (patch) | |
tree | 4cc701ee47b9380a1ae81d15cc1be24fdc936685 /drivers/usb/gadget | |
parent | 969152341e852ae7a5e1b11c33ef6244f3cb3579 (diff) |
usb: pch_udc: Fix compile error, warnings and checkpatch warnings
Building pch_udc in linux-next fails, this patch fixes the a compile
error:
drivers/usb/gadget/pch_udc.c: In function ‘usb_gadget_register_driver’:
drivers/usb/gadget/pch_udc.c:2645: error: ‘struct usb_gadget_driver’ has no member named ‘bind’
drivers/usb/gadget/pch_udc.c:2664: error: ‘struct usb_gadget_driver’ has no member named ‘bind’
And a couple of compiler warnings and checkpatch warnings.
Signed-off-by: Richard Röjfors <richard.rojfors@pelagicore.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/pch_udc.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/usb/gadget/pch_udc.c b/drivers/usb/gadget/pch_udc.c index 4a5256977d29..216f648bae6c 100644 --- a/drivers/usb/gadget/pch_udc.c +++ b/drivers/usb/gadget/pch_udc.c | |||
@@ -337,7 +337,7 @@ struct pch_udc_dev { | |||
337 | struct usb_gadget_driver *driver; | 337 | struct usb_gadget_driver *driver; |
338 | struct pci_dev *pdev; | 338 | struct pci_dev *pdev; |
339 | struct pch_udc_ep ep[PCH_UDC_EP_NUM]; | 339 | struct pch_udc_ep ep[PCH_UDC_EP_NUM]; |
340 | spinlock_t lock; | 340 | spinlock_t lock; /* protects all state */ |
341 | unsigned active:1, | 341 | unsigned active:1, |
342 | stall:1, | 342 | stall:1, |
343 | prot_stall:1, | 343 | prot_stall:1, |
@@ -1980,7 +1980,7 @@ static void pch_udc_svc_data_in(struct pch_udc_dev *dev, int ep_num) | |||
1980 | pch_udc_enable_ep_interrupts(ep->dev, | 1980 | pch_udc_enable_ep_interrupts(ep->dev, |
1981 | PCH_UDC_EPINT(ep->in, ep->num)); | 1981 | PCH_UDC_EPINT(ep->in, ep->num)); |
1982 | } | 1982 | } |
1983 | if (epsts & UDC_EPSTS_RCS) | 1983 | if (epsts & UDC_EPSTS_RCS) { |
1984 | if (!dev->prot_stall) { | 1984 | if (!dev->prot_stall) { |
1985 | pch_udc_ep_clear_stall(ep); | 1985 | pch_udc_ep_clear_stall(ep); |
1986 | } else { | 1986 | } else { |
@@ -1988,6 +1988,7 @@ static void pch_udc_svc_data_in(struct pch_udc_dev *dev, int ep_num) | |||
1988 | pch_udc_enable_ep_interrupts(ep->dev, | 1988 | pch_udc_enable_ep_interrupts(ep->dev, |
1989 | PCH_UDC_EPINT(ep->in, ep->num)); | 1989 | PCH_UDC_EPINT(ep->in, ep->num)); |
1990 | } | 1990 | } |
1991 | } | ||
1991 | if (epsts & UDC_EPSTS_TDC) | 1992 | if (epsts & UDC_EPSTS_TDC) |
1992 | pch_udc_complete_transfer(ep); | 1993 | pch_udc_complete_transfer(ep); |
1993 | /* On IN interrupt, provide data if we have any */ | 1994 | /* On IN interrupt, provide data if we have any */ |
@@ -2028,7 +2029,7 @@ static void pch_udc_svc_data_out(struct pch_udc_dev *dev, int ep_num) | |||
2028 | pch_udc_ep_set_stall(ep); | 2029 | pch_udc_ep_set_stall(ep); |
2029 | pch_udc_enable_ep_interrupts(ep->dev, | 2030 | pch_udc_enable_ep_interrupts(ep->dev, |
2030 | PCH_UDC_EPINT(ep->in, ep->num)); | 2031 | PCH_UDC_EPINT(ep->in, ep->num)); |
2031 | if (epsts & UDC_EPSTS_RCS) | 2032 | if (epsts & UDC_EPSTS_RCS) { |
2032 | if (!dev->prot_stall) { | 2033 | if (!dev->prot_stall) { |
2033 | pch_udc_ep_clear_stall(ep); | 2034 | pch_udc_ep_clear_stall(ep); |
2034 | } else { | 2035 | } else { |
@@ -2036,6 +2037,7 @@ static void pch_udc_svc_data_out(struct pch_udc_dev *dev, int ep_num) | |||
2036 | pch_udc_enable_ep_interrupts(ep->dev, | 2037 | pch_udc_enable_ep_interrupts(ep->dev, |
2037 | PCH_UDC_EPINT(ep->in, ep->num)); | 2038 | PCH_UDC_EPINT(ep->in, ep->num)); |
2038 | } | 2039 | } |
2040 | } | ||
2039 | if (((epsts & UDC_EPSTS_OUT_MASK) >> UDC_EPSTS_OUT_SHIFT) == | 2041 | if (((epsts & UDC_EPSTS_OUT_MASK) >> UDC_EPSTS_OUT_SHIFT) == |
2040 | UDC_EPSTS_OUT_DATA) { | 2042 | UDC_EPSTS_OUT_DATA) { |
2041 | if (ep->dev->prot_stall == 1) { | 2043 | if (ep->dev->prot_stall == 1) { |
@@ -2635,12 +2637,13 @@ static int init_dma_pools(struct pch_udc_dev *dev) | |||
2635 | return 0; | 2637 | return 0; |
2636 | } | 2638 | } |
2637 | 2639 | ||
2638 | int usb_gadget_register_driver(struct usb_gadget_driver *driver) | 2640 | int usb_gadget_probe_driver(struct usb_gadget_driver *driver, |
2641 | int (*bind)(struct usb_gadget *)) | ||
2639 | { | 2642 | { |
2640 | struct pch_udc_dev *dev = pch_udc; | 2643 | struct pch_udc_dev *dev = pch_udc; |
2641 | int retval; | 2644 | int retval; |
2642 | 2645 | ||
2643 | if (!driver || (driver->speed == USB_SPEED_UNKNOWN) || !driver->bind || | 2646 | if (!driver || (driver->speed == USB_SPEED_UNKNOWN) || !bind || |
2644 | !driver->setup || !driver->unbind || !driver->disconnect) { | 2647 | !driver->setup || !driver->unbind || !driver->disconnect) { |
2645 | dev_err(&dev->pdev->dev, | 2648 | dev_err(&dev->pdev->dev, |
2646 | "%s: invalid driver parameter\n", __func__); | 2649 | "%s: invalid driver parameter\n", __func__); |
@@ -2659,7 +2662,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver) | |||
2659 | dev->gadget.dev.driver = &driver->driver; | 2662 | dev->gadget.dev.driver = &driver->driver; |
2660 | 2663 | ||
2661 | /* Invoke the bind routine of the gadget driver */ | 2664 | /* Invoke the bind routine of the gadget driver */ |
2662 | retval = driver->bind(&dev->gadget); | 2665 | retval = bind(&dev->gadget); |
2663 | 2666 | ||
2664 | if (retval) { | 2667 | if (retval) { |
2665 | dev_err(&dev->pdev->dev, "%s: binding to %s returning %d\n", | 2668 | dev_err(&dev->pdev->dev, "%s: binding to %s returning %d\n", |
@@ -2677,7 +2680,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver) | |||
2677 | dev->connected = 1; | 2680 | dev->connected = 1; |
2678 | return 0; | 2681 | return 0; |
2679 | } | 2682 | } |
2680 | EXPORT_SYMBOL(usb_gadget_register_driver); | 2683 | EXPORT_SYMBOL(usb_gadget_probe_driver); |
2681 | 2684 | ||
2682 | int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) | 2685 | int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) |
2683 | { | 2686 | { |
@@ -2902,7 +2905,7 @@ finished: | |||
2902 | return retval; | 2905 | return retval; |
2903 | } | 2906 | } |
2904 | 2907 | ||
2905 | static const struct pci_device_id pch_udc_pcidev_id[] = { | 2908 | static DEFINE_PCI_DEVICE_TABLE(pch_udc_pcidev_id) = { |
2906 | { | 2909 | { |
2907 | PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_EG20T_UDC), | 2910 | PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_EG20T_UDC), |
2908 | .class = (PCI_CLASS_SERIAL_USB << 8) | 0xfe, | 2911 | .class = (PCI_CLASS_SERIAL_USB << 8) | 0xfe, |