Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Mon, 7 Oct 2002 18:43:49 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Mon, 7 Oct 2002 18:43:49 -0400 Received: from air-2.osdl.org ([65.172.181.6]:18343 "EHLO cherise.pdx.osdl.net") by vger.kernel.org with ESMTP id ; Mon, 7 Oct 2002 18:43:47 -0400 Date: Mon, 7 Oct 2002 15:51:06 -0700 (PDT) From: Patrick Mochel X-X-Sender: mochel@cherise.pdx.osdl.net To: Alexander Viro cc: torvalds@transmeta.com, , , Subject: Re: [patch] IDE driver model update In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1569 Lines: 48 On Mon, 7 Oct 2002, Alexander Viro wrote: > > > On Mon, 7 Oct 2002, Patrick Mochel wrote: > > > --- a/drivers/ide/ide-probe.c Mon Oct 7 12:19:11 2002 > > +++ b/drivers/ide/ide-probe.c Mon Oct 7 12:19:11 2002 > > @@ -952,6 +952,15 @@ > > > > EXPORT_SYMBOL(init_irq); > > > > +static void ide_device_release(struct device * dev) > > +{ > > + ide_drive_t * drive = dev->driver_data; > > + ide_driver_t * driver = drive->driver; > > + > > + if (driver && driver->cleanup) > > + driver->cleanup(drive); > > +} > > + > > /* > > * init_gendisk() (as opposed to ide_geninit) is called for each major device, > > * after probing for drives, to allocate partition tables and other data > > @@ -986,6 +995,8 @@ > > "%s","IDE Drive"); > > disk->disk_dev.parent = &hwif->gendev; > > disk->disk_dev.bus = &ide_bus_type; > > + disk->disk_dev.driver_data = &hwif->drives[unit]; > > + disk->disk_dev.release = ide_device_release; > > That is Wrong(tm). Logics around ->cleanup() doesn't belong to driverfs. > As far as IDE code is concerned, any outside calls of ->cleanup() are > illegal. What are you trying to achieve with that? It's the desctrutor for the device object. ->release() is the last thing called when the last reference to the device goes away. That's the only time it's called. -pat - 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/