aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/s3c-hsudc.c
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2013-01-24 10:04:56 -0500
committerFelipe Balbi <balbi@ti.com>2013-03-18 05:16:52 -0400
commit40ed30cff5957d15dcd2638c6f48fae839a3100a (patch)
tree8d6dba4961bd52a124af7df28868de61a1cb361c /drivers/usb/gadget/s3c-hsudc.c
parentb8d833a327aaed6637398446ec8a3e555b3ddd11 (diff)
usb: gadget: s3c-hsudc: let udc-core manage gadget->dev
By simply setting a flag, we can drop some boilerplate code. Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget/s3c-hsudc.c')
-rw-r--r--drivers/usb/gadget/s3c-hsudc.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/usb/gadget/s3c-hsudc.c b/drivers/usb/gadget/s3c-hsudc.c
index 458965a1b138..c4ff747f53fc 100644
--- a/drivers/usb/gadget/s3c-hsudc.c
+++ b/drivers/usb/gadget/s3c-hsudc.c
@@ -1303,18 +1303,16 @@ static int s3c_hsudc_probe(struct platform_device *pdev)
1303 1303
1304 spin_lock_init(&hsudc->lock); 1304 spin_lock_init(&hsudc->lock);
1305 1305
1306 dev_set_name(&hsudc->gadget.dev, "gadget");
1307
1308 hsudc->gadget.max_speed = USB_SPEED_HIGH; 1306 hsudc->gadget.max_speed = USB_SPEED_HIGH;
1309 hsudc->gadget.ops = &s3c_hsudc_gadget_ops; 1307 hsudc->gadget.ops = &s3c_hsudc_gadget_ops;
1310 hsudc->gadget.name = dev_name(dev); 1308 hsudc->gadget.name = dev_name(dev);
1311 hsudc->gadget.dev.parent = dev; 1309 hsudc->gadget.dev.parent = dev;
1312 hsudc->gadget.dev.dma_mask = dev->dma_mask; 1310 hsudc->gadget.dev.dma_mask = dev->dma_mask;
1313 hsudc->gadget.ep0 = &hsudc->ep[0].ep; 1311 hsudc->gadget.ep0 = &hsudc->ep[0].ep;
1314
1315 hsudc->gadget.is_otg = 0; 1312 hsudc->gadget.is_otg = 0;
1316 hsudc->gadget.is_a_peripheral = 0; 1313 hsudc->gadget.is_a_peripheral = 0;
1317 hsudc->gadget.speed = USB_SPEED_UNKNOWN; 1314 hsudc->gadget.speed = USB_SPEED_UNKNOWN;
1315 hsudc->gadget.register_my_device = true;
1318 1316
1319 s3c_hsudc_setup_ep(hsudc); 1317 s3c_hsudc_setup_ep(hsudc);
1320 1318
@@ -1345,12 +1343,6 @@ static int s3c_hsudc_probe(struct platform_device *pdev)
1345 disable_irq(hsudc->irq); 1343 disable_irq(hsudc->irq);
1346 local_irq_enable(); 1344 local_irq_enable();
1347 1345
1348 ret = device_register(&hsudc->gadget.dev);
1349 if (ret) {
1350 put_device(&hsudc->gadget.dev);
1351 goto err_add_device;
1352 }
1353
1354 ret = usb_add_gadget_udc(&pdev->dev, &hsudc->gadget); 1346 ret = usb_add_gadget_udc(&pdev->dev, &hsudc->gadget);
1355 if (ret) 1347 if (ret)
1356 goto err_add_udc; 1348 goto err_add_udc;
@@ -1359,7 +1351,6 @@ static int s3c_hsudc_probe(struct platform_device *pdev)
1359 1351
1360 return 0; 1352 return 0;
1361err_add_udc: 1353err_add_udc:
1362 device_unregister(&hsudc->gadget.dev);
1363err_add_device: 1354err_add_device:
1364 clk_disable(hsudc->uclk); 1355 clk_disable(hsudc->uclk);
1365err_res: 1356err_res: