From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brad Hards Date: Sat, 31 Mar 2001 02:12:54 +0000 Subject: Re: (remove) event not supported. Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org Keith Owens wrote: > > On Sat, 31 Mar 2001 22:57:18 +1000, > Brad Hards wrote: > >David Brownell wrote: > >> - the dynamic linking framework doesn't track how many devices > >> are attached to each driver module ... so if there's another device > >> controlled by the same driver, but it's not opened, removing that > >> module would be incorrect. ("module use count" doesn't cover > >> uses, just opens.) > >This could be trivially extended to have a inc_dev_open_count() and > >inc_dev_use_count(), where the use count get incremented in probe() > >and the open count gets incremented in open(). Naturally you also > >have to have a dec version of each as well, in disconnect() and > >close(). > > AFAICT there is no need for another count, you can do MOD_INC_USE_COUNT > in any module function. The use count does not have to be for just > open. Add MOD_INC_USE_COUNT to the probe() function for each new > device. An excellent point. I shouldn't write before the first cup of Russian Caravan in the morning. Has anyone audited the drivers to see how consistently this is done? Brad _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel