diff options
author | Felipe Balbi <balbi@ti.com> | 2013-01-24 08:10:10 -0500 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2013-03-18 05:16:41 -0400 |
commit | 12ad0fcaf2fbf3f48dd2b4dbaff372830aada8a2 (patch) | |
tree | a725ac9b4d4b31ce19f05e442c600f4fc3129920 | |
parent | 6dfc84fcb6eb32621c557e64f7520be27c0d636a (diff) |
usb: gadget: amd5536udc: let udc-core manage gadget->dev
By simply setting a flag, we drop some boilerplate
code.
Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r-- | drivers/usb/gadget/amd5536udc.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/usb/gadget/amd5536udc.c b/drivers/usb/gadget/amd5536udc.c index 75973f33a4c8..eee01ea70f8c 100644 --- a/drivers/usb/gadget/amd5536udc.c +++ b/drivers/usb/gadget/amd5536udc.c | |||
@@ -3080,7 +3080,6 @@ static void udc_pci_remove(struct pci_dev *pdev) | |||
3080 | if (dev->active) | 3080 | if (dev->active) |
3081 | pci_disable_device(pdev); | 3081 | pci_disable_device(pdev); |
3082 | 3082 | ||
3083 | device_unregister(&dev->gadget.dev); | ||
3084 | pci_set_drvdata(pdev, NULL); | 3083 | pci_set_drvdata(pdev, NULL); |
3085 | 3084 | ||
3086 | udc_remove(dev); | 3085 | udc_remove(dev); |
@@ -3276,6 +3275,7 @@ static int udc_probe(struct udc *dev) | |||
3276 | dev->gadget.dev.release = gadget_release; | 3275 | dev->gadget.dev.release = gadget_release; |
3277 | dev->gadget.name = name; | 3276 | dev->gadget.name = name; |
3278 | dev->gadget.max_speed = USB_SPEED_HIGH; | 3277 | dev->gadget.max_speed = USB_SPEED_HIGH; |
3278 | dev->gadget.register_my_device = true; | ||
3279 | 3279 | ||
3280 | /* init registers, interrupts, ... */ | 3280 | /* init registers, interrupts, ... */ |
3281 | startup_registers(dev); | 3281 | startup_registers(dev); |
@@ -3301,13 +3301,6 @@ static int udc_probe(struct udc *dev) | |||
3301 | if (retval) | 3301 | if (retval) |
3302 | goto finished; | 3302 | goto finished; |
3303 | 3303 | ||
3304 | retval = device_register(&dev->gadget.dev); | ||
3305 | if (retval) { | ||
3306 | usb_del_gadget_udc(&dev->gadget); | ||
3307 | put_device(&dev->gadget.dev); | ||
3308 | goto finished; | ||
3309 | } | ||
3310 | |||
3311 | /* timer init */ | 3304 | /* timer init */ |
3312 | init_timer(&udc_timer); | 3305 | init_timer(&udc_timer); |
3313 | udc_timer.function = udc_timer_function; | 3306 | udc_timer.function = udc_timer_function; |