From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg KH Date: Wed, 09 Feb 2005 00:37:03 +0000 Subject: Re: How to correctly setup a sysfs class Message-Id: <20050209003703.GA19262@kroah.com> List-Id: References: <1107896759.22140.61.camel@jo.austin.ibm.com> In-Reply-To: <1107896759.22140.61.camel@jo.austin.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org 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_id396&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