summaryrefslogtreecommitdiff
path: root/drivers/i2c/busses
diff options
context:
space:
mode:
authorRob Herring <r.herring@freescale.com>2010-01-22 15:03:01 -0200
committerAlejandro Gonzalez <alex.gonzalez@digi.com>2010-05-24 12:16:00 +0200
commit2a813db9284a0cffe7ff99520506b43c210277b2 (patch)
tree576e2fb1fa18e4c17e67ed4c5efd500a38d53ca0 /drivers/i2c/busses
parentd853de63d39096d43dc2fdbe494b8cd9cfe9a251 (diff)
ENGR00120394-3 imx: remove IO_ADDRESS usage in drivers
This replaces IO_ADDRESS with ioremap in drivers. Drivers needing more than trivial changes are not included. Signed-off-by: Rob Herring <r.herring@freescale.com> Signed-off-by: Alejandro Gonzalez <alex.gonzalez@digi.com>
Diffstat (limited to 'drivers/i2c/busses')
-rw-r--r--drivers/i2c/busses/mxc_i2c.c16
-rw-r--r--drivers/i2c/busses/mxc_i2c_hs.c6
2 files changed, 14 insertions, 8 deletions
diff --git a/drivers/i2c/busses/mxc_i2c.c b/drivers/i2c/busses/mxc_i2c.c
index 157695402819..c994c56da665 100644
--- a/drivers/i2c/busses/mxc_i2c.c
+++ b/drivers/i2c/busses/mxc_i2c.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2004-2009 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright (C) 2004-2010 Freescale Semiconductor, Inc. All Rights Reserved.
*/
/*
@@ -669,7 +669,7 @@ static int mxci2c_probe(struct platform_device *pdev)
ret = -ENODEV;
goto err1;
}
- mxc_i2c->membase = IO_ADDRESS(res->start);
+ mxc_i2c->membase = ioremap(res->start, res->end - res->start + 1);
/*
* Request the I2C interrupt
@@ -677,13 +677,13 @@ static int mxci2c_probe(struct platform_device *pdev)
mxc_i2c->irq = platform_get_irq(pdev, 0);
if (mxc_i2c->irq < 0) {
ret = mxc_i2c->irq;
- goto err1;
+ goto err2;
}
ret = request_irq(mxc_i2c->irq, mxc_i2c_handler,
0, pdev->name, mxc_i2c);
if (ret < 0) {
- goto err1;
+ goto err2;
}
init_waitqueue_head(&mxc_i2c->wq);
@@ -724,15 +724,17 @@ static int mxci2c_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, mxc_i2c);
i2c_set_adapdata(&mxc_i2c->adap, mxc_i2c);
if ((ret = i2c_add_numbered_adapter(&mxc_i2c->adap)) < 0) {
- goto err2;
+ goto err3;
}
printk(KERN_INFO "MXC I2C driver\n");
return 0;
- err2:
+ err3:
free_irq(mxc_i2c->irq, mxc_i2c);
gpio_i2c_inactive(id);
+ err2:
+ iounmap(mxc_i2c->membase);
err1:
dev_err(&pdev->dev, "failed to probe i2c adapter\n");
kfree(mxc_i2c);
@@ -757,6 +759,8 @@ static int mxci2c_remove(struct platform_device *pdev)
gpio_i2c_inactive(id);
clk_put(mxc_i2c->clk);
platform_set_drvdata(pdev, NULL);
+ iounmap(mxc_i2c->membase);
+ kfree(mxc_i2c);
return 0;
}
diff --git a/drivers/i2c/busses/mxc_i2c_hs.c b/drivers/i2c/busses/mxc_i2c_hs.c
index d31b5759ecda..16cf8a8d66e2 100644
--- a/drivers/i2c/busses/mxc_i2c_hs.c
+++ b/drivers/i2c/busses/mxc_i2c_hs.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright (C) 2008-2010 Freescale Semiconductor, Inc. All Rights Reserved.
*/
/*
@@ -425,7 +425,7 @@ static int mxci2c_hs_probe(struct platform_device *pdev)
ret = -ENODEV;
goto err1;
}
- i2c_hs->reg_base_virt = IO_ADDRESS(res->start);
+ i2c_hs->reg_base_virt = ioremap(res->start, res->end - res->start + 1);
i2c_hs->reg_base_phy = res->start;
i2c_hs->ipg_clk = clk_get(&pdev->dev, "hsi2c_clk");
@@ -468,6 +468,7 @@ static int mxci2c_hs_probe(struct platform_device *pdev)
kfree(adap);
err1:
dev_err(&pdev->dev, "failed to probe high speed i2c adapter\n");
+ iounmap(i2c_hs->reg_base_virt);
kfree(i2c_hs);
return ret;
}
@@ -508,6 +509,7 @@ static int mxci2c_hs_remove(struct platform_device *pdev)
i2c_del_adapter(adap);
gpio_i2c_hs_inactive();
platform_set_drvdata(pdev, NULL);
+ iounmap(i2c_hs->reg_base_virt);
kfree(i2c_hs);
return 0;
}