diff options
author | Wolfram Sang <w.sang@pengutronix.de> | 2009-07-17 11:54:14 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2009-09-04 04:37:18 -0400 |
commit | 2763c508a3c8f8ec5d6df4e8c63d5e2a5a7d3954 (patch) | |
tree | 07bbb07d236b19ecf3a4f9d1e93095d905648cc7 | |
parent | 44a1f2085e8fe07b3aecdab7c391ca057d75da0f (diff) |
mtd: physmap_of: use resource_size
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
-rw-r--r-- | drivers/mtd/maps/physmap_of.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c index 39d357b2eb47..f223f3fec3af 100644 --- a/drivers/mtd/maps/physmap_of.c +++ b/drivers/mtd/maps/physmap_of.c | |||
@@ -190,6 +190,7 @@ static int __devinit of_flash_probe(struct of_device *dev, | |||
190 | const u32 *p; | 190 | const u32 *p; |
191 | int reg_tuple_size; | 191 | int reg_tuple_size; |
192 | struct mtd_info **mtd_list = NULL; | 192 | struct mtd_info **mtd_list = NULL; |
193 | resource_size_t res_size; | ||
193 | 194 | ||
194 | reg_tuple_size = (of_n_addr_cells(dp) + of_n_size_cells(dp)) * sizeof(u32); | 195 | reg_tuple_size = (of_n_addr_cells(dp) + of_n_size_cells(dp)) * sizeof(u32); |
195 | 196 | ||
@@ -233,8 +234,8 @@ static int __devinit of_flash_probe(struct of_device *dev, | |||
233 | (unsigned long long)res.end); | 234 | (unsigned long long)res.end); |
234 | 235 | ||
235 | err = -EBUSY; | 236 | err = -EBUSY; |
236 | info->list[i].res = request_mem_region(res.start, res.end - | 237 | res_size = resource_size(&res); |
237 | res.start + 1, | 238 | info->list[i].res = request_mem_region(res.start, res_size, |
238 | dev_name(&dev->dev)); | 239 | dev_name(&dev->dev)); |
239 | if (!info->list[i].res) | 240 | if (!info->list[i].res) |
240 | goto err_out; | 241 | goto err_out; |
@@ -249,7 +250,7 @@ static int __devinit of_flash_probe(struct of_device *dev, | |||
249 | 250 | ||
250 | info->list[i].map.name = dev_name(&dev->dev); | 251 | info->list[i].map.name = dev_name(&dev->dev); |
251 | info->list[i].map.phys = res.start; | 252 | info->list[i].map.phys = res.start; |
252 | info->list[i].map.size = res.end - res.start + 1; | 253 | info->list[i].map.size = res_size; |
253 | info->list[i].map.bankwidth = *width; | 254 | info->list[i].map.bankwidth = *width; |
254 | 255 | ||
255 | err = -ENOMEM; | 256 | err = -ENOMEM; |