From mboxrd@z Thu Jan 1 00:00:00 1970 From: Russell King Subject: Re: [PATCH] Add support for ITE887x serial chipsets Date: Tue, 27 Mar 2007 15:17:15 +0100 Message-ID: <20070327141715.GA20671@flint.arm.linux.org.uk> References: <20070326141702.GA28306@deexvs01.wincor-nixdorf.com> <20070326201705.GA14403@pazke.donpac.ru> <20070327140303.GA11233@deexvs01.wincor-nixdorf.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from caramon.arm.linux.org.uk ([217.147.92.249]:4858 "EHLO caramon.arm.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753870AbXC0OR2 (ORCPT ); Tue, 27 Mar 2007 10:17:28 -0400 Content-Disposition: inline In-Reply-To: <20070327140303.GA11233@deexvs01.wincor-nixdorf.com> Sender: linux-serial-owner@vger.kernel.org List-Id: linux-serial@vger.kernel.org To: Niels de Vos Cc: Andrey Panin , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org On Tue, Mar 27, 2007 at 04:03:03PM +0200, Niels de Vos wrote: > +static int __devinit pci_ite887x_init(struct pci_dev *dev) > +{ > ... > + if (ret > 0) { > + dev->dev.driver_data = iobase; > + } else { > + /* the device has no UARTs if we get here */ > + release_region(iobase->start, ITE_887x_IOSIZE); > + } > + > + return ret; > +} > + > +static void __devexit pci_ite887x_exit(struct pci_dev *dev) > +{ > + struct resource *iobase = (struct resource*) dev->dev.driver_data; > + /* free the private driver data */ > + release_region(iobase->start, ITE_887x_IOSIZE); > + dev->dev.driver_data = NULL; > +} > + You can't do that. dev->dev.driver_data is used by this very driver itself to store its own data, or alternatively the parport_serial driver to store its private data. Therefore, dev->dev.driver_data will be corrupted between your _init function setting it and your _exit function using it. Suggest you read the iobase back from the device to release it. -- Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: