summaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses
diff options
context:
space:
mode:
authorRabin Vincent <rabin.vincent@stericsson.com>2010-04-27 07:01:07 +0200
committerBen Dooks <ben-linux@fluff.org>2010-05-20 01:19:00 +0200
commita1c27678c0e92ed4aa3ac489ef2f0d80651e18bb (patch)
treee2aacd6ca852da8ab52f74500277e55068a16811 /drivers/i2c/busses
parentOMAP3: I2C: Clean up Errata 1p153 handling (diff)
downloadlinux-a1c27678c0e92ed4aa3ac489ef2f0d80651e18bb.tar.xz
linux-a1c27678c0e92ed4aa3ac489ef2f0d80651e18bb.zip
i2c-nomadik: release region when removed
So that the module can be loaded again after an unload. Acked-by: Linus Walleij <linus.walleij@stericsson.com> Acked-by: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'drivers/i2c/busses')
-rw-r--r--drivers/i2c/busses/i2c-nomadik.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-nomadik.c b/drivers/i2c/busses/i2c-nomadik.c
index a4f8d33fa389..170dbd70b934 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);