aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/net2280.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-10-17 18:05:22 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-17 18:05:22 -0400
commit699ddda6ecd5751fd05fd5128aa7f93438974468 (patch)
treeb09b6a347c2e437e9c8bd5cd87f94fe03944a437 /drivers/usb/gadget/net2280.c
parentacbb67d51ef0ff942d592d44fb8abb4c931041ff (diff)
parentab352c2687a4361aec06a184ddb20deb1e5091eb (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6: (47 commits) USB: Add device id for Sierra Wireless MC8755 USB: cleanup sierra wireless driver a bit USB: Sierra Wireless driver update USB: ftdi_sio whitespace fixes USB-SERIAL:cp2101 Add new device ID USB/gadget/net2280: handle sysfs errors usbtouchscreen: fix data reading for ITM touchscreens UEAGLE: fix ueagle-atm Oops USB: xpad: dance pad support USB: input: extract() and implement() are bit field manipulation routines USB: Memory leak in drivers/usb/serial/airprime.c USB Storage: unusual_devs.h entry for Sony Ericsson P990i USB: fix usbatm tiny race USB: unusual_devs entry for Nokia 6234 USB: mos7840.c: fix a check-after-dereference USB: ftdi-elan.c: remove dead code USB: Mitsumi USB FDD 061M: UNUSUAL_DEV multilun fix USB: fix dereference in drivers/usb/misc/adutux.c USB: add USB serial mos7720 driver USB: move trancevibrator.c to the proper usb directory ...
Diffstat (limited to 'drivers/usb/gadget/net2280.c')
-rw-r--r--drivers/usb/gadget/net2280.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/drivers/usb/gadget/net2280.c b/drivers/usb/gadget/net2280.c
index d954daa8e9e0..7cfe0e5cf670 100644
--- a/drivers/usb/gadget/net2280.c
+++ b/drivers/usb/gadget/net2280.c
@@ -2044,8 +2044,10 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver)
2044 return retval; 2044 return retval;
2045 } 2045 }
2046 2046
2047 device_create_file (&dev->pdev->dev, &dev_attr_function); 2047 retval = device_create_file (&dev->pdev->dev, &dev_attr_function);
2048 device_create_file (&dev->pdev->dev, &dev_attr_queues); 2048 if (retval) goto err_unbind;
2049 retval = device_create_file (&dev->pdev->dev, &dev_attr_queues);
2050 if (retval) goto err_func;
2049 2051
2050 /* ... then enable host detection and ep0; and we're ready 2052 /* ... then enable host detection and ep0; and we're ready
2051 * for set_configuration as well as eventual disconnect. 2053 * for set_configuration as well as eventual disconnect.
@@ -2060,6 +2062,14 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver)
2060 2062
2061 /* pci writes may still be posted */ 2063 /* pci writes may still be posted */
2062 return 0; 2064 return 0;
2065
2066err_func:
2067 device_remove_file (&dev->pdev->dev, &dev_attr_function);
2068err_unbind:
2069 driver->unbind (&dev->gadget);
2070 dev->gadget.dev.driver = NULL;
2071 dev->driver = NULL;
2072 return retval;
2063} 2073}
2064EXPORT_SYMBOL (usb_gadget_register_driver); 2074EXPORT_SYMBOL (usb_gadget_register_driver);
2065 2075
@@ -2974,8 +2984,10 @@ static int net2280_probe (struct pci_dev *pdev, const struct pci_device_id *id)
2974 : "disabled"); 2984 : "disabled");
2975 the_controller = dev; 2985 the_controller = dev;
2976 2986
2977 device_register (&dev->gadget.dev); 2987 retval = device_register (&dev->gadget.dev);
2978 device_create_file (&pdev->dev, &dev_attr_registers); 2988 if (retval) goto done;
2989 retval = device_create_file (&pdev->dev, &dev_attr_registers);
2990 if (retval) goto done;
2979 2991
2980 return 0; 2992 return 0;
2981 2993