Re: [PATCH 01/19] usb: gadget: introduce UDC Class

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

 



On 06/16/2011 12:28 PM, Michal Nazarewicz wrote:
On 06/14/2011 05:09 PM, Balbi, Felipe wrote:
+       mutex_unlock(&udc_lock);
+       return 0;
+err3:
+       list_del(&udc->list);
+       mutex_unlock(&udc_lock);
+
+err2:
+       put_device(&udc->dev);

On Thu, 16 Jun 2011 11:20:50 +0200, Roger Quadros wrote:
memory leaks here. need to free udc.

release callback does that, doesn't it?

True. Might be worth adding a comment there.


+static void usb_gadget_remove_driver(struct usb_udc *udc)
+{
+       dev_dbg(&udc->dev, "unregistering UDC driver [%s]\n",
+                       udc->gadget->name);
+
+       kobject_uevent(&udc->dev.kobj, KOBJ_CHANGE);

Do you really need this? It will be immediately followed by a
KOBJ_REMOVE since you call device_unregister() soon after.

Not necessarily.  usb_gadget_remove_driver() is called both when
UDC device driver is unloaded or when gadget driver is unloaded.
In the letter case the UDC device is not removed.

OK.

Also, I think it's nice that whenever gadget is removed from the
device CHANGE is generated -- less cases for users to worry about.


missing description?

Description in .h file.  Maybe all should be moved there?  Or here?

Yes, as long as it is at one place.

cheers,
-roger
--
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