aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-pxa.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c/busses/i2c-pxa.c')
-rw-r--r--drivers/i2c/busses/i2c-pxa.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
index 035a6c7e59df..762e1e530882 100644
--- a/drivers/i2c/busses/i2c-pxa.c
+++ b/drivers/i2c/busses/i2c-pxa.c
@@ -993,7 +993,6 @@ static const struct i2c_algorithm i2c_pxa_pio_algorithm = {
993 .functionality = i2c_pxa_functionality, 993 .functionality = i2c_pxa_functionality,
994}; 994};
995 995
996#define res_len(r) ((r)->end - (r)->start + 1)
997static int i2c_pxa_probe(struct platform_device *dev) 996static int i2c_pxa_probe(struct platform_device *dev)
998{ 997{
999 struct pxa_i2c *i2c; 998 struct pxa_i2c *i2c;
@@ -1008,7 +1007,7 @@ static int i2c_pxa_probe(struct platform_device *dev)
1008 if (res == NULL || irq < 0) 1007 if (res == NULL || irq < 0)
1009 return -ENODEV; 1008 return -ENODEV;
1010 1009
1011 if (!request_mem_region(res->start, res_len(res), res->name)) 1010 if (!request_mem_region(res->start, resource_size(res), res->name))
1012 return -ENOMEM; 1011 return -ENOMEM;
1013 1012
1014 i2c = kzalloc(sizeof(struct pxa_i2c), GFP_KERNEL); 1013 i2c = kzalloc(sizeof(struct pxa_i2c), GFP_KERNEL);
@@ -1038,7 +1037,7 @@ static int i2c_pxa_probe(struct platform_device *dev)
1038 goto eclk; 1037 goto eclk;
1039 } 1038 }
1040 1039
1041 i2c->reg_base = ioremap(res->start, res_len(res)); 1040 i2c->reg_base = ioremap(res->start, resource_size(res));
1042 if (!i2c->reg_base) { 1041 if (!i2c->reg_base) {
1043 ret = -EIO; 1042 ret = -EIO;
1044 goto eremap; 1043 goto eremap;
@@ -1046,7 +1045,7 @@ static int i2c_pxa_probe(struct platform_device *dev)
1046 i2c->reg_shift = REG_SHIFT(id->driver_data); 1045 i2c->reg_shift = REG_SHIFT(id->driver_data);
1047 1046
1048 i2c->iobase = res->start; 1047 i2c->iobase = res->start;
1049 i2c->iosize = res_len(res); 1048 i2c->iosize = resource_size(res);
1050 1049
1051 i2c->irq = irq; 1050 i2c->irq = irq;
1052 1051
@@ -1110,7 +1109,7 @@ eremap:
1110eclk: 1109eclk:
1111 kfree(i2c); 1110 kfree(i2c);
1112emalloc: 1111emalloc:
1113 release_mem_region(res->start, res_len(res)); 1112 release_mem_region(res->start, resource_size(res));
1114 return ret; 1113 return ret;
1115} 1114}
1116 1115