/* init software state */
udc = &controller;
+ udc->gadget.register_my_device = true;
udc->gadget.dev.parent = dev;
if (pdev->dev.of_node)
at91udc_of_init(udc, pdev->dev.of_node);
DBG("clocks missing\n");
retval = -ENODEV;
/* NOTE: we "know" here that refcounts on these are NOPs */
- goto fail0b;
- }
-
- retval = device_register(&udc->gadget.dev);
- if (retval < 0) {
- put_device(&udc->gadget.dev);
- goto fail0b;
+ goto fail1;
}
/* don't do anything until we have both gadget driver and VBUS */
fail2:
free_irq(udc->udp_irq, udc);
fail1:
- device_unregister(&udc->gadget.dev);
-fail0b:
iounmap(udc->udp_baseaddr);
fail0a:
if (cpu_is_at91rm9200())
gpio_free(udc->board.vbus_pin);
}
free_irq(udc->udp_irq, udc);
- device_unregister(&udc->gadget.dev);
-
iounmap(udc->udp_baseaddr);
if (cpu_is_at91rm9200())