Re: create sysfs class attribute and sub directories

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

 



Hi,
You should use
sysfs_create_group() and  kobject_create_and_add() and DEVICE_ATTR() macro
see net/bridge/br_sysfs_br.c
and also see Documentation/kobject.txt and filesystems/sysfs.txt


Regards,
Rami Rosen
http://ramirose.wix.com/ramirosen


On Sun, Dec 15, 2013 at 3:52 PM, Jeshwanth Kumar N K
<jeshkumar555@xxxxxxxxx> wrote:
> 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.
> /sys/class/versions/main/version
>                           /dev/version
>
> 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 :)
>
> --
> Regards
> Jeshwanth Kumar N K
> Bangalore, India
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies@xxxxxxxxxxxxxxxxx
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://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