Re: how to create a device from an LKM

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

 



On Wed, 2006-03-01 at 14:28 +0530, kishore wrote:
> hai,
> 
> I attached the driver code. It's working good.
> Previously, I used to create the device manually 
> when am aware of major number( with print message).
> But now I want to do the same from LKM itself with the
> help of sys_mknod( );

As I said DON'T DO IT THAT WAY.
Just use the right sysfs methods, and everything is automatic!

For example, if you only need 1 device node, use a misc device and not
the raw chardev interface. The misc device code takes care of the sysfs
side for you, and already the device node will be generated
automatically by udev. 


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