aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-at91.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c/busses/i2c-at91.c')
-rw-r--r--drivers/i2c/busses/i2c-at91.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/i2c/busses/i2c-at91.c b/drivers/i2c/busses/i2c-at91.c
index 67d9dc5b351b..06e1ecb4919f 100644
--- a/drivers/i2c/busses/i2c-at91.c
+++ b/drivers/i2c/busses/i2c-at91.c
@@ -200,10 +200,10 @@ static int __devinit at91_i2c_probe(struct platform_device *pdev)
200 if (!res) 200 if (!res)
201 return -ENXIO; 201 return -ENXIO;
202 202
203 if (!request_mem_region(res->start, res->end - res->start + 1, "at91_i2c")) 203 if (!request_mem_region(res->start, resource_size(res), "at91_i2c"))
204 return -EBUSY; 204 return -EBUSY;
205 205
206 twi_base = ioremap(res->start, res->end - res->start + 1); 206 twi_base = ioremap(res->start, resource_size(res));
207 if (!twi_base) { 207 if (!twi_base) {
208 rc = -ENOMEM; 208 rc = -ENOMEM;
209 goto fail0; 209 goto fail0;
@@ -252,7 +252,7 @@ fail2:
252fail1: 252fail1:
253 iounmap(twi_base); 253 iounmap(twi_base);
254fail0: 254fail0:
255 release_mem_region(res->start, res->end - res->start + 1); 255 release_mem_region(res->start, resource_size(res));
256 256
257 return rc; 257 return rc;
258} 258}
@@ -268,7 +268,7 @@ static int __devexit at91_i2c_remove(struct platform_device *pdev)
268 268
269 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 269 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
270 iounmap(twi_base); 270 iounmap(twi_base);
271 release_mem_region(res->start, res->end - res->start + 1); 271 release_mem_region(res->start, resource_size(res));
272 272
273 clk_disable(twi_clk); /* disable peripheral clock */ 273 clk_disable(twi_clk); /* disable peripheral clock */
274 clk_put(twi_clk); 274 clk_put(twi_clk);