Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262324AbVBDWLP (ORCPT ); Fri, 4 Feb 2005 17:11:15 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S265343AbVBDWFu (ORCPT ); Fri, 4 Feb 2005 17:05:50 -0500 Received: from mail.kroah.org ([69.55.234.183]:37833 "EHLO perch.kroah.org") by vger.kernel.org with ESMTP id S264351AbVBDVv7 (ORCPT ); Fri, 4 Feb 2005 16:51:59 -0500 Date: Fri, 4 Feb 2005 13:51:35 -0800 From: Greg KH To: Kylene Hall Cc: linux-kernel@vger.kernel.org, Emily Ratliff , Tom Lendacky , tpmdd-devel@lists.sourceforge.net Subject: Re: [PATCH 1/1] tpm: implement use of sysfs classes Message-ID: <20050204215134.GA27433@kroah.com> References: <20050204205226.GA26780@kroah.com> <1107553040.22140.30.camel@jo.austin.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1107553040.22140.30.camel@jo.austin.ibm.com> User-Agent: Mutt/1.5.6i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1382 Lines: 35 On Fri, Feb 04, 2005 at 03:37:20PM -0600, Kylene Hall wrote: > On Fri, 2005-02-04 at 14:52, Greg KH wrote: > > On Fri, Feb 04, 2005 at 02:12:50PM -0600, Kylene Hall wrote: > > > +static struct class tpm_class = { > > > + .name = "tpm", > > > + .class_dev_attrs = tpm_attrs, > > > +}; > > > > Where is your release function? Did you see any warnings from the > > kernel when you removed any of these class devices? Why did you ignore > > it? > > > Sorry, I missed the warning message. I have looked at some other > instances for what I might need to put in that function and I'm > stumped. I didn't kmalloc my class_device structure so I don't need to > kfree it. How do you create the structure that contains the class device? What will happen if a user holds a reference to the class device and your structure holding that class device goes away? Ick, I think I agree more and more with Al Viro that exposing this kind of stuff to developers was a big mistake... Anyway, why not try using the class_simple interface instead? If you do that you don't have to worry (as much) in the reference counting logic. thanks, 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/