Re: Problems with adding a sysfs file

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

 



On Mon, 17 Apr 2017 01:17:08 -0700, Abhishek Bhardwaj said:
> I followed this link to add a sysfs file
> http://kroah.com/log/blog/2013/06/26/how-to-create-a-sysfs-file-correctly/
> .
>
> I set the driver.groups field and declared the attribute and attribute
> groups required by the sysfs file. When I boot my kernel I see the
> file but my store and show handlers don't get called when I try to cat
> or echo to the file. Is there any step I'm missing ?.

The traditional way to start debugging this is to add a line at the beginning
of your show and store routines:

	printk(KERN_DEBUG "Now in our special sysfs show routine\n");

and see if it shows up in your dmesg or not.  If not, your routine
is probably not being called.  If it is, the problem is in the routine.

(You'd be surprised how often people say their routine isn't getting called,
when it in fact is, or vice versa..)

Attachment: pgpK1SU9ImTxW.pgp
Description: PGP signature

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[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