Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Wei Yongjun and committed by
Lee Jones
3f9850f2 c8eaed45

+2 -2
+2 -2
drivers/mfd/htc-egpio.c
··· 286 286 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 287 287 if (!res) 288 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 291 if (!ei->base_addr) 291 292 goto fail; 292 293 pr_debug("EGPIO phys=%08x virt=%p\n", (u32)res->start, ei->base_addr); ··· 381 380 irq_set_chained_handler(ei->chained_irq, NULL); 382 381 device_init_wakeup(&pdev->dev, 0); 383 382 } 384 - iounmap(ei->base_addr); 385 383 386 384 return 0; 387 385 }