From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.free-electrons.com (mail.free-electrons.com [94.23.35.102]) by ozlabs.org (Postfix) with ESMTP id BAC0A2C0A2C for ; Wed, 30 Jan 2013 02:40:58 +1100 (EST) Date: Tue, 29 Jan 2013 16:32:42 +0100 From: Thomas Petazzoni To: Florian Fainelli Subject: Re: [PATCH 1/5] net: mvmdio: unmap base register address at driver removal Message-ID: <20130129163242.1df2caf5@skate> In-Reply-To: <1359473048-26551-2-git-send-email-florian@openwrt.org> References: <1359473048-26551-1-git-send-email-florian@openwrt.org> <1359473048-26551-2-git-send-email-florian@openwrt.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Cc: Andrew Lunn , Russell King , Jason Cooper , linux-doc@vger.kernel.org, devicetree-discuss@lists.ozlabs.org, linux-kernel@vger.kernel.org, Rob Herring , netdev@vger.kernel.org, Paul Mackerras , linux-arm-kernel@lists.infradead.org, Rob Landley , Greg Kroah-Hartman , linuxppc-dev@lists.ozlabs.org, davem@davemloft.net, Lennert Buytenhek List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Dear Florian Fainelli, On Tue, 29 Jan 2013 16:24:04 +0100, Florian Fainelli wrote: > Fix the driver remove callback to unmap the base register address and > not leak this mapping after the driver has been removed. > > Signed-off-by: Florian Fainelli What about using devm_request_and_ioremap() instead, in order to get automatic unmap on error and in the ->remove() path? But maybe it won't work because this memory range is claimed both by the MDIO driver and the Ethernet driver itself. In that case, you could use devm_ioremap(). Best regards, Thomas -- Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com