Re: usb_hcd allocation/deallocation

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

 



On Thu, Oct 13, 2005 at 09:51:31AM +0000, Bahadir Balban wrote:
> Hi,
> 
> In past versions of the kernel, struct hc_driver has hcd_alloc and
> hcd_free functions.
> 
> Is the corresponding allocation that hcd_alloc does in usb_create_hcd
> now? (as of 2.6.14-rc2) How about hcd_free?
> 
> In comments it says usb_remove_hcd reverses the effects of
> usb_add_hcd(). Fair enough, but how about reversing usb_create_hcd()
> then?

You do a call to usb_put_hcd() and if there are no more references to
that hcd, it is cleaned up and will eventually call back into your
release() function that you set up in usb_create_hcd().  That's where
you free the structure you created.

Hope this helps,

greg k-h

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux