usb: gadget: udc-core: remove protection when setting gadget.dev.release
authorFelipe Balbi <balbi@ti.com>
Tue, 26 Feb 2013 13:25:41 +0000 (15:25 +0200)
committerFelipe Balbi <balbi@ti.com>
Mon, 18 Mar 2013 09:17:56 +0000 (11:17 +0200)
now that no UDC driver touches gadget.dev.release
we can assign our release function to it without
being afraid of breaking anything.

Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/udc-core.c

index a50811e35bdbe6a99bd0ff8a7b9791fd5e36d6e1..26e116bd6f595ddeef539bd861a2ca8db64072c9 100644 (file)
@@ -198,12 +198,10 @@ int usb_add_gadget_udc_release(struct device *parent, struct usb_gadget *gadget,
        gadget->dev.dma_parms = parent->dma_parms;
        gadget->dev.dma_mask = parent->dma_mask;
 
-       if (release) {
+       if (release)
                gadget->dev.release = release;
-       } else {
-               if (!gadget->dev.release)
-                       gadget->dev.release = usb_udc_nop_release;
-       }
+       else
+               gadget->dev.release = usb_udc_nop_release;
 
        ret = device_register(&gadget->dev);
        if (ret)