lkml.org 
[lkml]   [2005]   [Jul]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [SYSFS QUESTION] How to add new sysfs attributes under /sys/modul e/<my module>
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 majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-07-09 18:04    [W:0.035 / U:0.568 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site