Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 93347
b: refs/heads/master
c: a89a2cd
h: refs/heads/master
i:
  93345: 30a8d38
  93343: 77c75e7
v: v3
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed Apr 25, 2008
1 parent 71df2b6 commit 962c69f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 42 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0e530b45783f75a29bde20bbf9e287c915a4f68b
refs/heads/master: a89a2cd396b20c46a37fa8db4b652fb00f29d0a4
70 changes: 29 additions & 41 deletions trunk/drivers/usb/gadget/dummy_hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1933,69 +1933,57 @@ static struct platform_driver dummy_hcd_driver = {

/*-------------------------------------------------------------------------*/

/* These don't need to do anything because the pdev structures are
* statically allocated. */
static void
dummy_udc_release (struct device *dev) {}

static void
dummy_hcd_release (struct device *dev) {}

static struct platform_device the_udc_pdev = {
.name = (char *) gadget_name,
.id = -1,
.dev = {
.release = dummy_udc_release,
},
};

static struct platform_device the_hcd_pdev = {
.name = (char *) driver_name,
.id = -1,
.dev = {
.release = dummy_hcd_release,
},
};
static struct platform_device *the_udc_pdev;
static struct platform_device *the_hcd_pdev;

static int __init init (void)
{
int retval;
int retval = -ENOMEM;

if (usb_disabled ())
return -ENODEV;

retval = platform_driver_register (&dummy_hcd_driver);
if (retval < 0)
the_hcd_pdev = platform_device_alloc(driver_name, -1);
if (!the_hcd_pdev)
return retval;
the_udc_pdev = platform_device_alloc(gadget_name, -1);
if (!the_udc_pdev)
goto err_alloc_udc;

retval = platform_driver_register (&dummy_udc_driver);
retval = platform_driver_register(&dummy_hcd_driver);
if (retval < 0)
goto err_register_hcd_driver;
retval = platform_driver_register(&dummy_udc_driver);
if (retval < 0)
goto err_register_udc_driver;

retval = platform_device_register (&the_hcd_pdev);
retval = platform_device_add(the_hcd_pdev);
if (retval < 0)
goto err_register_hcd;

retval = platform_device_register (&the_udc_pdev);
goto err_add_hcd;
retval = platform_device_add(the_udc_pdev);
if (retval < 0)
goto err_register_udc;
goto err_add_udc;
return retval;

err_register_udc:
platform_device_unregister (&the_hcd_pdev);
err_register_hcd:
platform_driver_unregister (&dummy_udc_driver);
err_add_udc:
platform_device_del(the_hcd_pdev);
err_add_hcd:
platform_driver_unregister(&dummy_udc_driver);
err_register_udc_driver:
platform_driver_unregister (&dummy_hcd_driver);
platform_driver_unregister(&dummy_hcd_driver);
err_register_hcd_driver:
platform_device_put(the_udc_pdev);
err_alloc_udc:
platform_device_put(the_hcd_pdev);
return retval;
}
module_init (init);

static void __exit cleanup (void)
{
platform_device_unregister (&the_udc_pdev);
platform_device_unregister (&the_hcd_pdev);
platform_driver_unregister (&dummy_udc_driver);
platform_driver_unregister (&dummy_hcd_driver);
platform_device_unregister(the_udc_pdev);
platform_device_unregister(the_hcd_pdev);
platform_driver_unregister(&dummy_udc_driver);
platform_driver_unregister(&dummy_hcd_driver);
}
module_exit (cleanup);

0 comments on commit 962c69f

Please sign in to comment.