Re: [PATCH 7/7] usb/gadget: remove global struct usb_composite_driver in composite

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

 



On Wed, 22 Aug 2012, Sebastian Andrzej Siewior wrote:

> The direct user of the gadget driver (composite, dbgp, inode,
> file_storage) keeps a global variable where it stores a pointer to
> something which identifies the "current" instance from the time calling
> usb_gadget_probe_driver() and later in its ->bind() callback.
> This patch passes the struct usb_gadget_driver as an argument. Since it
> is embedded in the private struct of its user (composite, …), the user
> can restore its original data structure and avoid having a global
> pointer.
> Composite is embedding struct usb_gadget_driver. Others are unchanged.
> Only the "old-style" UDC drivers have to be touched here, new style are
> doing it right because this change is made in udc-core.

Pardon me for being stupid, but I don't understand this description at
all.  Example one, on the first line: How is file_storage a direct user
of the gadget driver?  It _is_ the gadget driver!  Example two, on the 
fifth line: The patch passes the usb_gadget_driver structure as an 
argument to what function?  There are lots of other examples.

It's clear that the purpose of this patch is to change composite.c.  
The other source files just go along for the ride -- their bind
routines get an additional, unused argument.

Therefore the patch description should explain what part of composite.c 
is being changed and why the change is needed.

Alan Stern

--
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