linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: How to correctly setup a sysfs class
Date: Wed, 09 Feb 2005 00:37:03 +0000	[thread overview]
Message-ID: <20050209003703.GA19262@kroah.com> (raw)
In-Reply-To: <1107896759.22140.61.camel@jo.austin.ibm.com>

On Tue, Feb 08, 2005 at 03:05:59PM -0600, Kylene Hall wrote:
> Hello-
> 
> I am trying to create a class in the sysfs filesystem for the tpm device
> driver to use. It was brought to my attention that my first attempts
> were missing a release function and thus causing ugly messages in
> /var/log/messages.  The problem I have is I do not know what I need to
> put in the release function.  The class_simple was recommended to me put
> I don't think it meets my needs.

I think linux-kernel is the best place for this...  But anyway...

> What I'd like to do is that when an application is built on top of this
> driver and needs to know where to find the sysfs files for the device,
> it doesn't have to look on all the different buses in /sys.

But you are using the misc device interface, right?  Why not just use
that class interface?  You have a pointer to the class_device offered to
you in the misc structure that is for you to put sysfs files into the
tree.  Just make sure to clean them up when you are done.

> Today TPMs are pci devices but in the future they could be usb devices
> as well.

Ok, you could hang your files off of the struct device if you want too.
All depends on what you feel comfortable with.

> By createing the tpm class and adding each device to the class the
> device link that is created can be followed to find the necessary
> files.  When using class_simple it seems the only file that can be
> created in the class is dev which contains the major and minor number.

No, you have a pointer to the class device that you can then pass to the
"create a class device file" function, right?  That's why you are passed
back a pointer.

> There is no link to the actual device created and since you don't have
> access to the actual struct class you can't create the link either.
> Please direct me if there is another way to do this.

See above.

thanks,

greg k-h


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id\x14396&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

      reply	other threads:[~2005-02-09  0:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-08 21:05 How to correctly setup a sysfs class Kylene Hall
2005-02-09  0:37 ` 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=20050209003703.GA19262@kroah.com \
    --to=greg@kroah.com \
    --cc=linux-hotplug@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).