diff options
author | Himangi Saraogi <himangi774@gmail.com> | 2014-07-14 17:23:51 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-07-16 16:47:53 -0400 |
commit | e1ada0f2c2286f113870b186a563eaee86d80f3c (patch) | |
tree | bd162431c74095792f0a0222e8ffd71e206af0a1 | |
parent | 9f48c89862e39b7f33b44123fc425cf901c89428 (diff) |
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>
-rw-r--r-- | drivers/misc/mic/card/mic_x100.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/misc/mic/card/mic_x100.c b/drivers/misc/mic/card/mic_x100.c index 55c9465bd260..9d57545d64f6 100644 --- a/drivers/misc/mic/card/mic_x100.c +++ b/drivers/misc/mic/card/mic_x100.c | |||
@@ -200,7 +200,8 @@ static int __init mic_probe(struct platform_device *pdev) | |||
200 | 200 | ||
201 | mdev->mmio.pa = MIC_X100_MMIO_BASE; | 201 | mdev->mmio.pa = MIC_X100_MMIO_BASE; |
202 | mdev->mmio.len = MIC_X100_MMIO_LEN; | 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 | if (!mdev->mmio.va) { | 205 | if (!mdev->mmio.va) { |
205 | dev_err(&pdev->dev, "Cannot remap MMIO BAR\n"); | 206 | dev_err(&pdev->dev, "Cannot remap MMIO BAR\n"); |
206 | rc = -EIO; | 207 | rc = -EIO; |
@@ -214,7 +215,7 @@ static int __init mic_probe(struct platform_device *pdev) | |||
214 | if (IS_ERR(mdrv->dma_mbdev)) { | 215 | if (IS_ERR(mdrv->dma_mbdev)) { |
215 | rc = PTR_ERR(mdrv->dma_mbdev); | 216 | rc = PTR_ERR(mdrv->dma_mbdev); |
216 | dev_err(&pdev->dev, "mbus_add_device failed rc %d\n", rc); | 217 | dev_err(&pdev->dev, "mbus_add_device failed rc %d\n", rc); |
217 | goto iounmap; | 218 | goto done; |
218 | } | 219 | } |
219 | rc = mic_driver_init(mdrv); | 220 | rc = mic_driver_init(mdrv); |
220 | if (rc) { | 221 | if (rc) { |
@@ -225,19 +226,15 @@ done: | |||
225 | return rc; | 226 | return rc; |
226 | remove_dma: | 227 | remove_dma: |
227 | mbus_unregister_device(mdrv->dma_mbdev); | 228 | mbus_unregister_device(mdrv->dma_mbdev); |
228 | iounmap: | ||
229 | iounmap(mdev->mmio.va); | ||
230 | return rc; | 229 | return rc; |
231 | } | 230 | } |
232 | 231 | ||
233 | static int mic_remove(struct platform_device *pdev) | 232 | static int mic_remove(struct platform_device *pdev) |
234 | { | 233 | { |
235 | struct mic_driver *mdrv = &g_drv; | 234 | struct mic_driver *mdrv = &g_drv; |
236 | struct mic_device *mdev = &mdrv->mdev; | ||
237 | 235 | ||
238 | mic_driver_uninit(mdrv); | 236 | mic_driver_uninit(mdrv); |
239 | mbus_unregister_device(mdrv->dma_mbdev); | 237 | mbus_unregister_device(mdrv->dma_mbdev); |
240 | iounmap(mdev->mmio.va); | ||
241 | return 0; | 238 | return 0; |
242 | } | 239 | } |
243 | 240 | ||