diff options
author | axel lin <axel.lin@gmail.com> | 2011-01-29 04:33:48 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2011-03-22 03:07:32 -0400 |
commit | 56fb22f7ca11ba5f04c297b7f7aa758ac8dbb2ce (patch) | |
tree | 8b906f27a1b762a3fbe92fd19fdc67f973f91e5e | |
parent | 7fe029df4245b7765efeebbcfd1b3dfda1432a8e (diff) |
video: hpfb: use resource_size()
The size calculation is done incorrectly here because it should include
both the start and end (end - start + 1).
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-rw-r--r-- | drivers/video/hpfb.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/video/hpfb.c b/drivers/video/hpfb.c index c8e280f1bb0b..ebf8495ff198 100644 --- a/drivers/video/hpfb.c +++ b/drivers/video/hpfb.c | |||
@@ -321,11 +321,11 @@ static int __devinit hpfb_dio_probe(struct dio_dev * d, const struct dio_device_ | |||
321 | unsigned long paddr, vaddr; | 321 | unsigned long paddr, vaddr; |
322 | 322 | ||
323 | paddr = d->resource.start; | 323 | paddr = d->resource.start; |
324 | if (!request_mem_region(d->resource.start, d->resource.end - d->resource.start, d->name)) | 324 | if (!request_mem_region(d->resource.start, resource_size(&d->resource), d->name)) |
325 | return -EBUSY; | 325 | return -EBUSY; |
326 | 326 | ||
327 | if (d->scode >= DIOII_SCBASE) { | 327 | if (d->scode >= DIOII_SCBASE) { |
328 | vaddr = (unsigned long)ioremap(paddr, d->resource.end - d->resource.start); | 328 | vaddr = (unsigned long)ioremap(paddr, resource_size(&d->resource)); |
329 | } else { | 329 | } else { |
330 | vaddr = paddr + DIO_VIRADDRBASE; | 330 | vaddr = paddr + DIO_VIRADDRBASE; |
331 | } | 331 | } |
@@ -344,7 +344,7 @@ static void __devexit hpfb_remove_one(struct dio_dev *d) | |||
344 | unregister_framebuffer(&fb_info); | 344 | unregister_framebuffer(&fb_info); |
345 | if (d->scode >= DIOII_SCBASE) | 345 | if (d->scode >= DIOII_SCBASE) |
346 | iounmap((void *)fb_regs); | 346 | iounmap((void *)fb_regs); |
347 | release_mem_region(d->resource.start, d->resource.end - d->resource.start); | 347 | release_mem_region(d->resource.start, resource_size(&d->resource)); |
348 | } | 348 | } |
349 | 349 | ||
350 | static struct dio_device_id hpfb_dio_tbl[] = { | 350 | static struct dio_device_id hpfb_dio_tbl[] = { |