Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964840AbbGYRoD (ORCPT ); Sat, 25 Jul 2015 13:44:03 -0400 Received: from mail-wi0-f172.google.com ([209.85.212.172]:36886 "EHLO mail-wi0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964771AbbGYRoC convert rfc822-to-8bit (ORCPT ); Sat, 25 Jul 2015 13:44:02 -0400 MIME-Version: 1.0 In-Reply-To: <1437842963-8107-1-git-send-email-khoroshilov@ispras.ru> References: <1437842963-8107-1-git-send-email-khoroshilov@ispras.ru> Date: Sat, 25 Jul 2015 14:44:00 -0300 Message-ID: Subject: Re: [PATCH] mtd: gpio-addr-flash: add missing iounmap in probe/remove From: Ezequiel Garcia To: Alexey Khoroshilov Cc: David Woodhouse , Brian Norris , Mike Frysinger , ldv-project@linuxtesting.org, "linux-mtd@lists.infradead.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1433 Lines: 35 Hi Alexey, On 25 July 2015 at 13:49, Alexey Khoroshilov wrote: > There is no iounmap(state->map.virt) in gpio_flash_remove() and > in gpio_flash_probe() error handling code. > Is there any reason why we can't just use managed variants? E.g. diff --git a/drivers/mtd/maps/gpio-addr-flash.c b/drivers/mtd/maps/gpio-addr-flash.c index 2fb3460..bbaa92b 100644 --- a/drivers/mtd/maps/gpio-addr-flash.c +++ b/drivers/mtd/maps/gpio-addr-flash.c @@ -238,7 +238,8 @@ static int gpio_flash_probe(struct platform_device *pdev) state->map.copy_to = gf_copy_to; state->map.bankwidth = pdata->width; state->map.size = state->win_size * (1 << state->gpio_count); - state->map.virt = ioremap_nocache(memory->start, state->map.size); + state->map.virt = devm_ioremap_nocache(&pdev->dev, memory->start, + state->map.size); state->map.phys = NO_XIP; state->map.map_priv_1 = (unsigned long)state; Notice the error checks are still needed though, but managed stuff would make it simpler. -- Ezequiel GarcĂ­a, VanguardiaSur www.vanguardiasur.com.ar -- 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/