diff options
author | Joe Perches <joe@perches.com> | 2011-06-09 12:13:32 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2011-06-10 08:55:36 -0400 |
commit | 28f65c11f2ffb3957259dece647a24f8ad2e241b (patch) | |
tree | 6b7621d09d10df89eedd908d4506fb9f457a909f /drivers/mtd/maps/ixp2000.c | |
parent | 140a1ef2f91a00e1d25f0878c193abdc25bf6ebe (diff) |
treewide: Convert uses of struct resource to resource_size(ptr)
Several fixes as well where the +1 was missing.
Done via coccinelle scripts like:
@@
struct resource *ptr;
@@
- ptr->end - ptr->start + 1
+ resource_size(ptr)
and some grep and typing.
Mostly uncompiled, no cross-compilers.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/mtd/maps/ixp2000.c')
-rw-r--r-- | drivers/mtd/maps/ixp2000.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/mtd/maps/ixp2000.c b/drivers/mtd/maps/ixp2000.c index c00b9175ba9e..1594a802631d 100644 --- a/drivers/mtd/maps/ixp2000.c +++ b/drivers/mtd/maps/ixp2000.c | |||
@@ -155,7 +155,7 @@ static int ixp2000_flash_probe(struct platform_device *dev) | |||
155 | if (!plat) | 155 | if (!plat) |
156 | return -ENODEV; | 156 | return -ENODEV; |
157 | 157 | ||
158 | window_size = dev->resource->end - dev->resource->start + 1; | 158 | window_size = resource_size(dev->resource); |
159 | dev_info(&dev->dev, "Probe of IXP2000 flash(%d banks x %dMiB)\n", | 159 | dev_info(&dev->dev, "Probe of IXP2000 flash(%d banks x %dMiB)\n", |
160 | ixp_data->nr_banks, ((u32)window_size >> 20)); | 160 | ixp_data->nr_banks, ((u32)window_size >> 20)); |
161 | 161 | ||
@@ -194,16 +194,17 @@ static int ixp2000_flash_probe(struct platform_device *dev) | |||
194 | info->map.copy_to = ixp2000_flash_copy_to; | 194 | info->map.copy_to = ixp2000_flash_copy_to; |
195 | 195 | ||
196 | info->res = request_mem_region(dev->resource->start, | 196 | info->res = request_mem_region(dev->resource->start, |
197 | dev->resource->end - dev->resource->start + 1, | 197 | resource_size(dev->resource), |
198 | dev_name(&dev->dev)); | 198 | dev_name(&dev->dev)); |
199 | if (!info->res) { | 199 | if (!info->res) { |
200 | dev_err(&dev->dev, "Could not reserve memory region\n"); | 200 | dev_err(&dev->dev, "Could not reserve memory region\n"); |
201 | err = -ENOMEM; | 201 | err = -ENOMEM; |
202 | goto Error; | 202 | goto Error; |
203 | } | 203 | } |
204 | 204 | ||
205 | info->map.map_priv_1 = (unsigned long) ioremap(dev->resource->start, | 205 | info->map.map_priv_1 = |
206 | dev->resource->end - dev->resource->start + 1); | 206 | (unsigned long)ioremap(dev->resource->start, |
207 | resource_size(dev->resource)); | ||
207 | if (!info->map.map_priv_1) { | 208 | if (!info->map.map_priv_1) { |
208 | dev_err(&dev->dev, "Failed to ioremap flash region\n"); | 209 | dev_err(&dev->dev, "Failed to ioremap flash region\n"); |
209 | err = -EIO; | 210 | err = -EIO; |