linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] i2c-nomadik: release region when removed
@ 2010-04-27  5:01 Rabin Vincent
       [not found] ` <1272344468-9411-1-git-send-email-rabin.vincent-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Rabin Vincent @ 2010-04-27  5:01 UTC (permalink / raw)
  To: linux-i2c-u79uwXL29TY76Z2rM5mHXA
  Cc: ben-linux-elnMNo+KYs3YtjvyW6yDsg,
	STEricsson_nomadik_linux-nkJGhpqTU55BDgjK7y7TUQ, Rabin Vincent,
	Linus Walleij, Srinidhi Kasagar

So that the module can be loaded again after an unload.

Acked-by: Linus Walleij <linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>
Acked-by: Srinidhi Kasagar <srinidhi.kasagar-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>
Signed-off-by: Rabin Vincent <rabin.vincent-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>
---
 drivers/i2c/busses/i2c-nomadik.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/busses/i2c-nomadik.c b/drivers/i2c/busses/i2c-nomadik.c
index a4f8d33..170dbd7 100644
--- a/drivers/i2c/busses/i2c-nomadik.c
+++ b/drivers/i2c/busses/i2c-nomadik.c
@@ -914,6 +914,7 @@ static int __devinit nmk_i2c_probe(struct platform_device *pdev)
 
 static int __devexit nmk_i2c_remove(struct platform_device *pdev)
 {
+	struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	struct nmk_i2c_dev *dev = platform_get_drvdata(pdev);
 
 	i2c_del_adapter(&dev->adap);
@@ -924,6 +925,8 @@ static int __devexit nmk_i2c_remove(struct platform_device *pdev)
 	i2c_clr_bit(dev->virtbase + I2C_CR, I2C_CR_PE);
 	free_irq(dev->irq, dev);
 	iounmap(dev->virtbase);
+	if (res)
+		release_mem_region(res->start, resource_size(res));
 	clk_disable(dev->clk);
 	clk_put(dev->clk);
 	platform_set_drvdata(pdev, NULL);
-- 
1.7.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-05-11 23:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-27  5:01 [PATCH 1/2] i2c-nomadik: release region when removed Rabin Vincent
     [not found] ` <1272344468-9411-1-git-send-email-rabin.vincent-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>
2010-04-27  5:01   ` [PATCH 2/2] i2c-nomadik: fix operator precedence warning Rabin Vincent
2010-05-11  5:23   ` [PATCH 1/2] i2c-nomadik: release region when removed Rabin VINCENT
     [not found]     ` <20100511052322.GA22860-IpC0hRtnIjATch7Zyv7bEAC/G2K4zDHf@public.gmane.org>
2010-05-11 23:15       ` Ben Dooks

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).