Commit c258f9a0 authored by Julia Lawall's avatar Julia Lawall Committed by Linus Torvalds

drivers/rtc/rtc-mrst.c: use release_mem_region after request_mem_region

The memory allocated using request_mem_region should be released using
release_mem_region, not release_region.

The semantic patch that fixes part of this problem is as follows:
(http://coccinelle.lip6.fr/)

  // <smpl>
  @@
  expression E1,E2,E3;
  @@

  request_mem_region(E1,E2,E3)
  ...
  ?- release_region(E1,E2)
  + release_mem_region(E1,E2)
  // </smpl>

[akpm@linux-foundation.org: use resource_size()]
Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 74d34d4b
...@@ -380,7 +380,7 @@ vrtc_mrst_do_probe(struct device *dev, struct resource *iomem, int rtc_irq) ...@@ -380,7 +380,7 @@ vrtc_mrst_do_probe(struct device *dev, struct resource *iomem, int rtc_irq)
cleanup0: cleanup0:
dev_set_drvdata(dev, NULL); dev_set_drvdata(dev, NULL);
mrst_rtc.dev = NULL; mrst_rtc.dev = NULL;
release_region(iomem->start, iomem->end + 1 - iomem->start); release_mem_region(iomem->start, resource_size(iomem));
dev_err(dev, "rtc-mrst: unable to initialise\n"); dev_err(dev, "rtc-mrst: unable to initialise\n");
return retval; return retval;
} }
...@@ -406,7 +406,7 @@ static void __devexit rtc_mrst_do_remove(struct device *dev) ...@@ -406,7 +406,7 @@ static void __devexit rtc_mrst_do_remove(struct device *dev)
mrst->rtc = NULL; mrst->rtc = NULL;
iomem = mrst->iomem; iomem = mrst->iomem;
release_region(iomem->start, iomem->end + 1 - iomem->start); release_mem_region(iomem->start, resource_size(iomem));
mrst->iomem = NULL; mrst->iomem = NULL;
mrst->dev = NULL; mrst->dev = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment