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

misc: mic: Introduce the managed version of ioremap

This patch moves data allocated using ioremap to managed data
allocated using devm_ioremap and cleans now unnecessary
iounmaps in probe and remove functions. Also the unnecessary
label iounmap is done away with.

Link: https://lkml.org/lkml/2014/6/1/191
Tested-by: Sudeep Dutt <sudeep.dutt@intel.com>
Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Himangi Saraogi and committed by
Greg Kroah-Hartman
e1ada0f2 9f48c898

+3 -6
+3 -6
drivers/misc/mic/card/mic_x100.c
··· 200 200 201 201 mdev->mmio.pa = MIC_X100_MMIO_BASE; 202 202 mdev->mmio.len = MIC_X100_MMIO_LEN; 203 - mdev->mmio.va = ioremap(MIC_X100_MMIO_BASE, MIC_X100_MMIO_LEN); 203 + mdev->mmio.va = devm_ioremap(&pdev->dev, MIC_X100_MMIO_BASE, 204 + MIC_X100_MMIO_LEN); 204 205 if (!mdev->mmio.va) { 205 206 dev_err(&pdev->dev, "Cannot remap MMIO BAR\n"); 206 207 rc = -EIO; ··· 215 214 if (IS_ERR(mdrv->dma_mbdev)) { 216 215 rc = PTR_ERR(mdrv->dma_mbdev); 217 216 dev_err(&pdev->dev, "mbus_add_device failed rc %d\n", rc); 218 - goto iounmap; 217 + goto done; 219 218 } 220 219 rc = mic_driver_init(mdrv); 221 220 if (rc) { ··· 226 225 return rc; 227 226 remove_dma: 228 227 mbus_unregister_device(mdrv->dma_mbdev); 229 - iounmap: 230 - iounmap(mdev->mmio.va); 231 228 return rc; 232 229 } 233 230 234 231 static int mic_remove(struct platform_device *pdev) 235 232 { 236 233 struct mic_driver *mdrv = &g_drv; 237 - struct mic_device *mdev = &mdrv->mdev; 238 234 239 235 mic_driver_uninit(mdrv); 240 236 mbus_unregister_device(mdrv->dma_mbdev); 241 - iounmap(mdev->mmio.va); 242 237 return 0; 243 238 } 244 239