[RFC/PATCH 29/32] usb: gadget: pxa27x_udc: let udc-core manage gadget->dev
By simply setting a flag, we can drop some boilerplate code. Signed-off-by: Felipe Balbi --- drivers/usb/gadget/pxa27x_udc.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/usb/gadget/pxa27x_udc.c b/drivers/usb/gadget/pxa27x_udc.c index f7d2579..23a3eed 100644 --- a/drivers/usb/gadget/pxa27x_udc.c +++ b/drivers/usb/gadget/pxa27x_udc.c @@ -1814,11 +1814,6 @@ static int pxa27x_udc_start(struct usb_gadget *g, udc->gadget.dev.driver = &driver->driver; dplus_pullup(udc, 1); - retval = device_add(&udc->gadget.dev); - if (retval) { - dev_err(udc->dev, "device_add error %d\n", retval); - goto fail; - } if (!IS_ERR_OR_NULL(udc->transceiver)) { retval = otg_set_peripheral(udc->transceiver->otg, &udc->gadget); @@ -1876,8 +1871,6 @@ static int pxa27x_udc_stop(struct usb_gadget *g, udc->driver = NULL; - device_del(&udc->gadget.dev); - if (!IS_ERR_OR_NULL(udc->transceiver)) return otg_set_peripheral(udc->transceiver->otg, NULL); return 0; @@ -2462,9 +2455,9 @@ static int __init pxa_udc_probe(struct platform_device *pdev) goto err_map; } - device_initialize(&udc->gadget.dev); udc->gadget.dev.parent = &pdev->dev; udc->gadget.dev.dma_mask = NULL; + udc->gadget.register_my_device = true; udc->vbus_sensed = 0; the_controller = udc; -- 1.8.1.rc1.5.g7e0651a ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [RFC/PATCH 29/32] usb: gadget: pxa27x_udc: let udc-core manage gadget->dev
Felipe Balbi writes: > By simply setting a flag, we can drop some > boilerplate code. > > Signed-off-by: Felipe Balbi > --- > drivers/usb/gadget/pxa27x_udc.c | 9 + Acked-by: Robert Jarzmik And I tested also your patch and it works in my environment. For next patches I'd like to be CCed for pxa27x_udc stuff as I'm maintaining that one since its beginning (and yes, I know, I didn't put that in MAINTAINERS ...). Cheers. -- Robert ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [RFC/PATCH 29/32] usb: gadget: pxa27x_udc: let udc-core manage gadget->dev
On Mon, Jan 28, 2013 at 09:18:29PM +0100, Robert Jarzmik wrote: > Felipe Balbi writes: > > > By simply setting a flag, we can drop some > > boilerplate code. > > > > Signed-off-by: Felipe Balbi > > --- > > drivers/usb/gadget/pxa27x_udc.c | 9 + > Acked-by: Robert Jarzmik > > And I tested also your patch and it works in my environment. For next patches > I'd like to be CCed for pxa27x_udc stuff as I'm maintaining that one since its > beginning (and yes, I know, I didn't put that in MAINTAINERS ...). you should add yourself to MAINTAINERS. Please send a patch to Greg when you have time. No need to prepare a tree, though. I just need you to give your Acked-by and I'll queue the patches myself. cheers -- balbi signature.asc Description: Digital signature ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev