public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: "Bagalkote, Sreenivas" <sreenib@lsil.com>
Cc: "'linux-kernel@vger.kernel.org'" <linux-kernel@vger.kernel.org>,
	"'Matt Domsch'" <Matt_Domsch@dell.com>,
	"'Christoph Hellwig'" <hch@lst.de>
Subject: Re: [SYSFS QUESTION] How to add new sysfs attributes under /sys/modul e/<my module>
Date: Sat, 9 Jul 2005 08:59:40 -0700	[thread overview]
Message-ID: <20050709155940.GA7559@kroah.com> (raw)
In-Reply-To: <0E3FA95632D6D047BA649F95DAB60E57060CCFAB@exa-atlanta>

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

      reply	other threads:[~2005-07-09 16:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-08 22:13 [SYSFS QUESTION] How to add new sysfs attributes under /sys/modul e/<my module> Bagalkote, Sreenivas
2005-07-09 15:59 ` Greg KH [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050709155940.GA7559@kroah.com \
    --to=greg@kroah.com \
    --cc=Matt_Domsch@dell.com \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sreenib@lsil.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox