From patchwork Mon Dec 14 20:58:06 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hartley Sweeten X-Patchwork-Id: 41134 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 21E0DB6F15 for ; Tue, 15 Dec 2009 07:59:57 +1100 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1NKHzi-0006Xc-Ta; Mon, 14 Dec 2009 20:58:14 +0000 Received: from exprod6og110.obsmtp.com ([64.18.1.25]) by bombadil.infradead.org with smtps (Exim 4.69 #1 (Red Hat Linux)) id 1NKHzc-0006WE-53 for linux-mtd@lists.infradead.org; Mon, 14 Dec 2009 20:58:12 +0000 Received: from source ([63.240.6.3]) (using TLSv1) by exprod6ob110.postini.com ([64.18.5.12]) with SMTP ID DSNKSyam3oDlzGi22AlCMXPJEOe8E6WoSnWp@postini.com; Mon, 14 Dec 2009 12:58:08 PST Received: from D01HOST03.Mi8.com ([172.16.1.25]) by Outbound01.Mi8.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 14 Dec 2009 15:58:05 -0500 Received: from mi8nycmail19.Mi8.com ([172.16.7.219]) by D01HOST03.Mi8.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 14 Dec 2009 15:58:05 -0500 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Subject: [PATCH] atmel_nand.c: use resource_size() Date: Mon, 14 Dec 2009 15:58:06 -0500 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH] atmel_nand.c: use resource_size() Thread-Index: Acp9ACKsx6nqH8tSQWGT/WNu74pbCQ== From: "H Hartley Sweeten" To: "kernel list" , X-OriginalArrivalTime: 14 Dec 2009 20:58:05.0560 (UTC) FILETIME=[21E4DF80:01CA7D00] X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20091214_155808_405820_377B7009 X-CRM114-Status: GOOD ( 13.35 ) X-Spam-Score: -4.0 (----) X-Spam-Report: SpamAssassin version 3.2.5 on bombadil.infradead.org summary: Content analysis details: (-4.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -4.0 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [64.18.1.25 listed in list.dnswl.org] X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Use resource_size(). Signed-off-by: H Hartley Sweeten diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c index f8e9975..162b4f2 100644 --- a/drivers/mtd/nand/atmel_nand.c +++ b/drivers/mtd/nand/atmel_nand.c @@ -399,7 +399,7 @@ static int __init atmel_nand_probe(struct platform_device *pdev) return -ENOMEM; } - host->io_base = ioremap(mem->start, mem->end - mem->start + 1); + host->io_base = ioremap(mem->start, resource_size(mem)); if (host->io_base == NULL) { printk(KERN_ERR "atmel_nand: ioremap failed\n"); res = -EIO; @@ -433,7 +433,7 @@ static int __init atmel_nand_probe(struct platform_device *pdev) if (no_ecc) nand_chip->ecc.mode = NAND_ECC_NONE; if (hard_ecc && regs) { - host->ecc = ioremap(regs->start, regs->end - regs->start + 1); + host->ecc = ioremap(regs->start, resource_size(regs)); if (host->ecc == NULL) { printk(KERN_ERR "atmel_nand: ioremap failed\n"); res = -EIO;