From: Axel Lin <axel.lin@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Manuel Lauss <mano@roarinelk.homelinux.net>,
Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>,
Paul Mundt <lethal@linux-sh.org>,
linux-fbdev@vger.kernel.org
Subject: [PATCH 2/2] video: sh7760fb: use resource_size()
Date: Sat, 29 Jan 2011 09:35:45 +0000 [thread overview]
Message-ID: <1296293745.13797.4.camel@phoenix> (raw)
In-Reply-To: <1296293628.13797.2.camel@phoenix>
The size calculation is done incorrectly in request_mem_region because
it should include both the start and end (end - start + 1).
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
drivers/video/sh7760fb.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/video/sh7760fb.c b/drivers/video/sh7760fb.c
index bea38fc..8fe1958 100644
--- a/drivers/video/sh7760fb.c
+++ b/drivers/video/sh7760fb.c
@@ -459,14 +459,14 @@ static int __devinit sh7760fb_probe(struct platform_device *pdev)
}
par->ioarea = request_mem_region(res->start,
- (res->end - res->start), pdev->name);
+ resource_size(res), pdev->name);
if (!par->ioarea) {
dev_err(&pdev->dev, "mmio area busy\n");
ret = -EBUSY;
goto out_fb;
}
- par->base = ioremap_nocache(res->start, res->end - res->start + 1);
+ par->base = ioremap_nocache(res->start, resource_size(res));
if (!par->base) {
dev_err(&pdev->dev, "cannot remap\n");
ret = -ENODEV;
--
1.7.0.4
prev parent reply other threads:[~2011-01-29 9:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-29 9:33 [PATCH 1/2] video: hpfb: use resource_size() Axel Lin
2011-01-29 9:35 ` Axel Lin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1296293745.13797.4.camel@phoenix \
--to=axel.lin@gmail.com \
--cc=iwamatsu.nobuhiro@renesas.com \
--cc=lethal@linux-sh.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mano@roarinelk.homelinux.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).