/*
* init gadget
*/
- dev_set_name(&gpriv->gadget.dev, "gadget");
gpriv->gadget.dev.parent = dev;
gpriv->gadget.dev.release = usbhs_mod_gadget_release;
gpriv->gadget.name = "renesas_usbhs_udc";
gpriv->gadget.ops = &usbhsg_gadget_ops;
gpriv->gadget.max_speed = USB_SPEED_HIGH;
- ret = device_register(&gpriv->gadget.dev);
- if (ret < 0)
- goto err_add_udc;
+ gpriv->gadget.register_my_device = true;
INIT_LIST_HEAD(&gpriv->gadget.ep_list);
ret = usb_add_gadget_udc(dev, &gpriv->gadget);
if (ret)
- goto err_register;
+ goto err_add_udc;
dev_info(dev, "gadget probed\n");
return 0;
-err_register:
- device_unregister(&gpriv->gadget.dev);
err_add_udc:
kfree(gpriv->uep);
usb_del_gadget_udc(&gpriv->gadget);
- device_unregister(&gpriv->gadget.dev);
-
kfree(gpriv->uep);
kfree(gpriv);
}