From patchwork Mon Jun 20 22:26:12 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hartley Sweeten X-Patchwork-Id: 898962 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p5KMQq4t029564 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 20 Jun 2011 22:27:15 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QYmva-0000Lc-8v; Mon, 20 Jun 2011 22:26:42 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QYmvZ-0003RS-Tj; Mon, 20 Jun 2011 22:26:41 +0000 Received: from mail160.messagelabs.com ([216.82.253.99]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QYmvR-0003R8-MA for linux-arm-kernel@lists.infradead.org; Mon, 20 Jun 2011 22:26:38 +0000 X-VirusChecked: Checked X-Env-Sender: hartleys@visionengravers.com X-Msg-Ref: server-8.tower-160.messagelabs.com!1308608789!26272598!1 X-StarScan-Version: 6.2.17; banners=-,-,- X-Originating-IP: [216.166.12.32] Received: (qmail 18171 invoked from network); 20 Jun 2011 22:26:30 -0000 Received: from out001.collaborationhost.net (HELO out001.collaborationhost.net) (216.166.12.32) by server-8.tower-160.messagelabs.com with RC4-SHA encrypted SMTP; 20 Jun 2011 22:26:30 -0000 Received: from etch.local (10.2.3.210) by smtp.collaborationhost.net (10.2.0.47) with Microsoft SMTP Server (TLS) id 8.2.176.0; Mon, 20 Jun 2011 17:26:29 -0500 From: H Hartley Sweeten To: ARM Kernel Subject: [PATCH] locomo: use resource_size instead of PAGE_SIZE for ioremap Date: Mon, 20 Jun 2011 15:26:12 -0700 User-Agent: KMail/1.9.9 MIME-Version: 1.0 Content-Disposition: inline Message-ID: <201106201526.12796.hartleys@visionengravers.com> X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110620_182634_026252_0453841B X-CRM114-Status: GOOD ( 10.62 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [216.82.253.99 listed in list.dnswl.org] X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Mon, 20 Jun 2011 22:27:15 +0000 (UTC) The memory resource for the locomo device is properly initialized by both users (mach-pxa/poodle.c and mach-sa1100/collie.c). Use resource_size in the ioremap instead of assuming the resource size is PAGE_SIZE. Signed-off-by: H Hartley Sweeten diff --git a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c index b55c362..e047c3d 100644 --- a/arch/arm/common/locomo.c +++ b/arch/arm/common/locomo.c @@ -391,7 +391,7 @@ __locomo_probe(struct device *me, struct resource *mem, int irq) * Map the whole region. This also maps the * registers for our children. */ - lchip->base = ioremap(mem->start, PAGE_SIZE); + lchip->base = ioremap(mem->start, resource_size(mem)); if (!lchip->base) { ret = -ENOMEM; goto out;