USB-skeleton kref query

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

 



Dear Linux Team,

I am trying to understand the USB Architecture and write my own client
driver under Linux and some mew concepts of 2.6.x.

My point of about kref 
----------------------
Used when the multiple threads are involved within the driver.
I am not sure whether this can be when there are no thread within the
driver and to control the Process synchronization. Can I get some
clarity on this?

Main Question
-------------
I have seen that kref_init () is issues in probe.	// no issue with
this

Device memory allocation and Kref_get() call are issued in open context.
Fine.ok.

In that case kref_put should be called in close context or any error
context. Right?
Yes, I find these two being issued in the usb-skeleton driver.

But, I find additional kref_put() call in disconnect? That too without
any condition checking? Why do I need it here?

Regards,
Mukund Jampala

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