linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* How to correctly setup a sysfs class
@ 2005-02-08 21:05 Kylene Hall
  2005-02-09  0:37 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Kylene Hall @ 2005-02-08 21:05 UTC (permalink / raw)
  To: linux-hotplug

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.

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.  Today TPMs 
are pci devices but in the future they could be usb devices as well.  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.  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.

Thanks,
Kylie Hall



-------------------------------------------------------
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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How to correctly setup a sysfs class
  2005-02-08 21:05 How to correctly setup a sysfs class Kylene Hall
@ 2005-02-09  0:37 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2005-02-09  0:37 UTC (permalink / raw)
  To: linux-hotplug

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-02-09  0:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-08 21:05 How to correctly setup a sysfs class Kylene Hall
2005-02-09  0:37 ` Greg KH

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).