lkml.org 
[lkml]   [2015]   [Jul]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
SubjectRe: [PATCH] mtd: gpio-addr-flash: add missing iounmap in probe/remove
From
Hi Alexey,

On 25 July 2015 at 13:49, Alexey Khoroshilov <khoroshilov@ispras.ru> 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


\
 
 \ /
  Last update: 2015-07-25 20:01    [W:0.029 / U:0.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site