From patchwork Mon Dec 14 21:19:44 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hartley Sweeten X-Patchwork-Id: 41143 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 3A51DB6EF2 for ; Tue, 15 Dec 2009 08:21:18 +1100 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1NKIKf-0002xz-Jo; Mon, 14 Dec 2009 21:19:53 +0000 Received: from exprod6og107.obsmtp.com ([64.18.1.208]) by bombadil.infradead.org with smtps (Exim 4.69 #1 (Red Hat Linux)) id 1NKIKY-0002oo-4C for linux-mtd@lists.infradead.org; Mon, 14 Dec 2009 21:19:52 +0000 Received: from source ([63.240.6.3]) (using TLSv1) by exprod6ob107.postini.com ([64.18.5.12]) with SMTP ID DSNKSyar8LJOfxBV//1l1kU1o0dlJow8/WaG@postini.com; Mon, 14 Dec 2009 13:19:46 PST Received: from d01smtp03.Mi8.com ([172.16.1.24]) by Outbound02.Mi8.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 14 Dec 2009 16:19:43 -0500 Received: from mi8nycmail19.Mi8.com ([172.16.7.219]) by d01smtp03.Mi8.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 14 Dec 2009 16:19:43 -0500 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Subject: [PATCH] fsl_elbc_nand.c: user resource_size() Date: Mon, 14 Dec 2009 16:19:44 -0500 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH] fsl_elbc_nand.c: user resource_size() Thread-Index: Acp9Ayhe2VEuaDfOR9yPQRrngTWNYQ== From: "H Hartley Sweeten" To: "kernel list" , X-OriginalArrivalTime: 14 Dec 2009 21:19:43.0462 (UTC) FILETIME=[27810060:01CA7D03] X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20091214_161946_345500_4065BE61 X-CRM114-Status: GOOD ( 10.77 ) 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.208 listed in list.dnswl.org] Cc: David Woodhouse 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 Cc: David Woodhouse diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c index ddd37d2..f5ed403 100644 --- a/drivers/mtd/nand/fsl_elbc_nand.c +++ b/drivers/mtd/nand/fsl_elbc_nand.c @@ -883,7 +883,7 @@ static int __devinit fsl_elbc_chip_probe(struct fsl_elbc_ctrl *ctrl, priv->ctrl = ctrl; priv->dev = ctrl->dev; - priv->vbase = ioremap(res.start, res.end - res.start + 1); + priv->vbase = ioremap(res.start, resource_size(&res)); if (!priv->vbase) { dev_err(ctrl->dev, "failed to map chip region\n"); ret = -ENOMEM;