Re: [SYSFS QUESTION] How to add new sysfs attributes under /sys/modul e/<my module>

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

 



On Fri, Jul 08, 2005 at 06:13:38PM -0400, Bagalkote, Sreenivas wrote:
> Sysfs Gurus,
> 
> I want to export few driver specific sysfs attributes when my driver loads.
> This driver is a pci hotplug driver. I want to export these sysfs attributes
> as soon as my pci_module_init succeeds.
> 
> 1. I see that there is /sys/modules directory lists all the modules. Is this
> a right place to have such information? Is this only for the insmod'ed
> modules?
> After pci_module_init, I have struct pci_driver object that gives me
> kobject.
> (pci_driver.driver.kobj). But from this kobject, I couldn't find a way to
> reach /sys/modules/<my driver kobject>

No, use DRIVER_ATTR() and put it in your driver directory instead.

See the many other drivers that do this as examples.

For more details see the book, Linux Device Drivers, Third edition.
It's online for free if you don't wish to buy it.

Hope this helps,

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux