<div dir="auto">I used a pr_debug and printk KERN_INFO ,before my original email , to verify they weren't being called.</div><div class="gmail_extra"><br><div class="gmail_quote">On Apr 17, 2017 1:43 PM, <<a href="mailto:valdis.kletnieks@vt.edu">valdis.kletnieks@vt.edu</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Mon, 17 Apr 2017 01:17:08 -0700, Abhishek Bhardwaj said:<br>
> I followed this link to add a sysfs file<br>
> <a href="http://kroah.com/log/blog/2013/06/26/how-to-create-a-sysfs-file-correctly/" rel="noreferrer" target="_blank">http://kroah.com/log/blog/<wbr>2013/06/26/how-to-create-a-<wbr>sysfs-file-correctly/</a><br>
> .<br>
><br>
> I set the driver.groups field and declared the attribute and attribute<br>
> groups required by the sysfs file. When I boot my kernel I see the<br>
> file but my store and show handlers don't get called when I try to cat<br>
> or echo to the file. Is there any step I'm missing ?.<br>
<br>
The traditional way to start debugging this is to add a line at the beginning<br>
of your show and store routines:<br>
<br>
printk(KERN_DEBUG "Now in our special sysfs show routine\n");<br>
<br>
and see if it shows up in your dmesg or not. If not, your routine<br>
is probably not being called. If it is, the problem is in the routine.<br>
<br>
(You'd be surprised how often people say their routine isn't getting called,<br>
when it in fact is, or vice versa..)<br>
</blockquote></div></div>