summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/pch_udc.c
diff options
context:
space:
mode:
authorRichard Röjfors <richard.rojfors@pelagicore.com>2010-12-07 19:28:30 +0300
committerGreg Kroah-Hartman <gregkh@suse.de>2010-12-11 01:28:29 +0300
commit49e208346616328e535b5d6ecd510ab38f210858 (patch)
tree4cc701ee47b9380a1ae81d15cc1be24fdc936685 /drivers/usb/gadget/pch_udc.c
parent969152341e852ae7a5e1b11c33ef6244f3cb3579 (diff)
downloadlinux-49e208346616328e535b5d6ecd510ab38f210858.tar.xz
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/pch_udc.c')
-rw-r--r--drivers/usb/gadget/pch_udc.c19
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 {
struct usb_gadget_driver *driver;
struct pci_dev *pdev;
struct pch_udc_ep ep[PCH_UDC_EP_NUM];
- spinlock_t lock;
+ spinlock_t lock; /* protects all state */
unsigned active:1,
stall:1,
prot_stall:1,
@@ -1980,7 +1980,7 @@ static void pch_udc_svc_data_in(struct pch_udc_dev *dev, int ep_num)
pch_udc_enable_ep_interrupts(ep->dev,
PCH_UDC_EPINT(ep->in, ep->num));
}
- if (epsts & UDC_EPSTS_RCS)
+ if (epsts & UDC_EPSTS_RCS) {
if (!dev->prot_stall) {
pch_udc_ep_clear_stall(ep);
} else {
@@ -1988,6 +1988,7 @@ static void pch_udc_svc_data_in(struct pch_udc_dev *dev, int ep_num)
pch_udc_enable_ep_interrupts(ep->dev,
PCH_UDC_EPINT(ep->in, ep->num));
}
+ }
if (epsts & UDC_EPSTS_TDC)
pch_udc_complete_transfer(ep);
/* 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)
pch_udc_ep_set_stall(ep);
pch_udc_enable_ep_interrupts(ep->dev,
PCH_UDC_EPINT(ep->in, ep->num));
- if (epsts & UDC_EPSTS_RCS)
+ if (epsts & UDC_EPSTS_RCS) {
if (!dev->prot_stall) {
pch_udc_ep_clear_stall(ep);
} else {
@@ -2036,6 +2037,7 @@ static void pch_udc_svc_data_out(struct pch_udc_dev *dev, int ep_num)
pch_udc_enable_ep_interrupts(ep->dev,
PCH_UDC_EPINT(ep->in, ep->num));
}
+ }
if (((epsts & UDC_EPSTS_OUT_MASK) >> UDC_EPSTS_OUT_SHIFT) ==
UDC_EPSTS_OUT_DATA) {
if (ep->dev->prot_stall == 1) {
@@ -2635,12 +2637,13 @@ static int init_dma_pools(struct pch_udc_dev *dev)
return 0;
}
-int usb_gadget_register_driver(struct usb_gadget_driver *driver)
+int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
+ int (*bind)(struct usb_gadget *))
{
struct pch_udc_dev *dev = pch_udc;
int retval;
- if (!driver || (driver->speed == USB_SPEED_UNKNOWN) || !driver->bind ||
+ if (!driver || (driver->speed == USB_SPEED_UNKNOWN) || !bind ||
!driver->setup || !driver->unbind || !driver->disconnect) {
dev_err(&dev->pdev->dev,
"%s: invalid driver parameter\n", __func__);
@@ -2659,7 +2662,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
dev->gadget.dev.driver = &driver->driver;
/* Invoke the bind routine of the gadget driver */
- retval = driver->bind(&dev->gadget);
+ retval = bind(&dev->gadget);
if (retval) {
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)
dev->connected = 1;
return 0;
}
-EXPORT_SYMBOL(usb_gadget_register_driver);
+EXPORT_SYMBOL(usb_gadget_probe_driver);
int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
{
@@ -2902,7 +2905,7 @@ finished:
return retval;
}
-static const struct pci_device_id pch_udc_pcidev_id[] = {
+static DEFINE_PCI_DEVICE_TABLE(pch_udc_pcidev_id) = {
{
PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_EG20T_UDC),
.class = (PCI_CLASS_SERIAL_USB << 8) | 0xfe,