Re: Passing arguments/parameters to a kernel module via sysfs

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

 



Hi,

Ron Lee wrote:

I would like to pass arguments/parameters to a kernel module. My current
method is to use the proc file system but I was told that sysfs would be
a cleaner way. Does anyone have an example for how to do this? Is there
a way to register callback functions that are invoked when a file in the
sysfs is read or written? Any help is appreciated!

Why not simply using module parameters, defined using module_param() ? You can have a look at page 21 of Linux Device Drivers, chapter 2 [1]. Module parameters are the best solution if you don't have to change the parameters when the module is loaded.

Sincerly,

Thomas

[1] http://lwn.net/images/pdf/LDD3/ch02.pdf
--
PETAZZONI Thomas - thomas.petazzoni@xxxxxxxx
http://thomas.enix.org - Jabber: thomas.petazzoni@xxxxxxxxx
KOS: http://kos.enix.org/ - SOS: http://sos.enix.org
Fingerprint : 0BE1 4CF3 CEA4 AC9D CC6E  1624 F653 CB30 98D3 F7A7

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at 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