[PATCH 49/49] usb: gadget: udc-core: remove protection when setting gadget.dev.release

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxx>
---
 drivers/usb/gadget/udc-core.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/gadget/udc-core.c b/drivers/usb/gadget/udc-core.c
index a50811e..26e116b 100644
--- a/drivers/usb/gadget/udc-core.c
+++ b/drivers/usb/gadget/udc-core.c
@@ -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)
-- 
1.8.1.rc1.5.g7e0651a

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux