Skip to content

Commit

Permalink
mfd: htc-egpio: Use devm_ioremap_nocache() instead of ioremap_nocache()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wei Yongjun authored and Lee Jones committed Jun 19, 2013
1 parent c8eaed4 commit 3f9850f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/mfd/htc-egpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,8 @@ static int __init egpio_probe(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res)
goto fail;
ei->base_addr = ioremap_nocache(res->start, resource_size(res));
ei->base_addr = devm_ioremap_nocache(&pdev->dev, res->start,
resource_size(res));
if (!ei->base_addr)
goto fail;
pr_debug("EGPIO phys=%08x virt=%p\n", (u32)res->start, ei->base_addr);
Expand Down Expand Up @@ -380,7 +381,6 @@ static int __exit egpio_remove(struct platform_device *pdev)
irq_set_chained_handler(ei->chained_irq, NULL);
device_init_wakeup(&pdev->dev, 0);
}
iounmap(ei->base_addr);

return 0;
}
Expand Down

0 comments on commit 3f9850f

Please sign in to comment.