Commit 56fb22f7 authored by axel lin's avatar axel lin Committed by Paul Mundt

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: default avatarAxel Lin <axel.lin@gmail.com>
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent 7fe029df
...@@ -321,11 +321,11 @@ static int __devinit hpfb_dio_probe(struct dio_dev * d, const struct dio_device_ ...@@ -321,11 +321,11 @@ static int __devinit hpfb_dio_probe(struct dio_dev * d, const struct dio_device_
unsigned long paddr, vaddr; unsigned long paddr, vaddr;
paddr = d->resource.start; paddr = d->resource.start;
if (!request_mem_region(d->resource.start, d->resource.end - d->resource.start, d->name)) if (!request_mem_region(d->resource.start, resource_size(&d->resource), d->name))
return -EBUSY; return -EBUSY;
if (d->scode >= DIOII_SCBASE) { if (d->scode >= DIOII_SCBASE) {
vaddr = (unsigned long)ioremap(paddr, d->resource.end - d->resource.start); vaddr = (unsigned long)ioremap(paddr, resource_size(&d->resource));
} else { } else {
vaddr = paddr + DIO_VIRADDRBASE; vaddr = paddr + DIO_VIRADDRBASE;
} }
...@@ -344,7 +344,7 @@ static void __devexit hpfb_remove_one(struct dio_dev *d) ...@@ -344,7 +344,7 @@ static void __devexit hpfb_remove_one(struct dio_dev *d)
unregister_framebuffer(&fb_info); unregister_framebuffer(&fb_info);
if (d->scode >= DIOII_SCBASE) if (d->scode >= DIOII_SCBASE)
iounmap((void *)fb_regs); iounmap((void *)fb_regs);
release_mem_region(d->resource.start, d->resource.end - d->resource.start); release_mem_region(d->resource.start, resource_size(&d->resource));
} }
static struct dio_device_id hpfb_dio_tbl[] = { static struct dio_device_id hpfb_dio_tbl[] = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment