create sysfs class attribute and sub directories

Jeshwanth Kumar N K jeshkumar555 at
Sun Dec 15 08:52:31 EST 2013

Hello List :),

I have a small question about sysfs.
I am creating a kernel module to print some versions in sysfs attributes.
So the directory tree would be.

So, versions is my class directory, inside that two directories main and
dev, both directory should contains version attribute. I am little familiar
with creating with sysfs class attribute using struct class, but how to
create the directory (like main/dev) and create attributes in both
directory ?

I have one more question, Is sysfs is right place to display version
information ?

Thanks in Advance :)

Jeshwanth Kumar N K
Bangalore, India
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the Kernelnewbies mailing list