aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2013-06-18 22:47:06 -0400
committerLee Jones <lee.jones@linaro.org>2013-06-19 04:53:55 -0400
commit3f9850f26241f1d4f9ed49eaa70e043a3bb24a7c (patch)
tree42d77a5c3a6c0d0f1c391626cdccfc5e7900ec37
parentc8eaed458e2cfbd906dbbe1af49aa028f59cc132 (diff)
mfd: htc-egpio: Use devm_ioremap_nocache() instead of ioremap_nocache()
Replace probe-time ioremap_nocache() call with devm_ioremap_nocache() to avoid iounmap() missing and get rid of the corresponding iounmap() call on remove. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Lee Jones <lee.jones@linaro.org>
-rw-r--r--drivers/mfd/htc-egpio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mfd/htc-egpio.c b/drivers/mfd/htc-egpio.c
index f2e0ad4b332e..26aca545084b 100644
--- a/drivers/mfd/htc-egpio.c
+++ b/drivers/mfd/htc-egpio.c
@@ -286,7 +286,8 @@ static int __init egpio_probe(struct platform_device *pdev)
286 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 286 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
287 if (!res) 287 if (!res)
288 goto fail; 288 goto fail;
289 ei->base_addr = ioremap_nocache(res->start, resource_size(res)); 289 ei->base_addr = devm_ioremap_nocache(&pdev->dev, res->start,
290 resource_size(res));
290 if (!ei->base_addr) 291 if (!ei->base_addr)
291 goto fail; 292 goto fail;
292 pr_debug("EGPIO phys=%08x virt=%p\n", (u32)res->start, ei->base_addr); 293 pr_debug("EGPIO phys=%08x virt=%p\n", (u32)res->start, ei->base_addr);
@@ -380,7 +381,6 @@ static int __exit egpio_remove(struct platform_device *pdev)
380 irq_set_chained_handler(ei->chained_irq, NULL); 381 irq_set_chained_handler(ei->chained_irq, NULL);
381 device_init_wakeup(&pdev->dev, 0); 382 device_init_wakeup(&pdev->dev, 0);
382 } 383 }
383 iounmap(ei->base_addr);
384 384
385 return 0; 385 return 0;
386} 386}