+
+ hcd->self.bus_name = dev->bus_id;
+ usb_register_bus (&hcd->self);
+
+ if ((retval = dummy_start (hcd)) < 0)
+ dummy_remove (dev);
+ return retval;
+
+err1:
+ usb_put_hcd (hcd);
+ dev_set_drvdata (dev, NULL);
+ return retval;
+}
+
+static void dummy_remove (struct device *dev)
+{
+ struct usb_hcd *hcd;
+ struct dummy *dum;
+
+ hcd = dev_get_drvdata (dev);
+ dum = hcd_to_dummy (hcd);
+
+ hcd->state = USB_STATE_QUIESCING;
+
+ dev_dbg (dev, "roothub graceful disconnect\n");
+ usb_disconnect (&hcd->self.root_hub);
+
+ hcd->driver->stop (hcd);
+ hcd->state = USB_STATE_HALT;
+
+ hcd_buffer_destroy (hcd);
+
+ dev_set_drvdata (dev, NULL);
+ usb_deregister_bus (&hcd->self);
+ the_controller = NULL;
+}
+
+/*-------------------------------------------------------------------------*/
+
+static int dummy_pdev_detect (void)
+{
+ int retval;
+
+ retval = driver_register (&dummy_driver);
+ if (retval < 0)
+ return retval;
+
+ the_pdev.name = "hc";
+ the_pdev.dev.driver = &dummy_driver;
+ the_pdev.dev.release = dummy_pdev_release;
+
+ retval = platform_device_register (&the_pdev);
+ if (retval < 0)
+ driver_unregister (&dummy_driver);
+ return retval;
+}
+
+static void dummy_pdev_remove (void)
+{
+ platform_device_unregister (&the_pdev);
+ driver_unregister (&dummy_driver);
+}
+
+/*-------------------------------------------------------------------------*/
+
+static int __init init (void)
+{
+ int retval;
+
+ if (usb_disabled ())
+ return -ENODEV;
+ if ((retval = dummy_pdev_detect ()) != 0)
+ return retval;
+ if ((retval = dummy_probe (&the_pdev.dev)) != 0)
+ dummy_pdev_remove ();
+ return retval;