Re: devfs_register and private data

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

 



On Tue, Jan 20, 2004 at 01:16:41PM -0700, Liberty Young wrote:
> 
> But the kernel doesn't print out the expected results! What am i doing wrong?

Relying on devfs being enabled is the main problem :)

Just use the minor number in the inode on open to determine which
structure in your driver is being accessed.  Then set the private
pointer in the struct file to this value.  That can then be used on all
future read(), write(), and release() calls.

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