From patchwork Tue Jan 20 07:33:46 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 19443 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@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 67E44DDF04 for ; Tue, 20 Jan 2009 18:59:56 +1100 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1LPBVK-0004sg-TO; Tue, 20 Jan 2009 07:58:34 +0000 Received: from 89.6b.364a.static.theplanet.com ([74.54.107.137] helo=cathcart.site5.com) by bombadil.infradead.org with esmtps (Exim 4.69 #1 (Red Hat Linux)) id 1LPB7T-0002Ft-L2 for linux-mtd@lists.infradead.org; Tue, 20 Jan 2009 07:33:58 +0000 Received: from mail.linux-boards.com ([192.114.83.142]) by cathcart.site5.com with esmtpsa (TLSv1:DES-CBC3-SHA:168) (Exim 4.69) (envelope-from ) id 1LPB7R-0007VS-Oq; Tue, 20 Jan 2009 01:33:54 -0600 Received: from gentoodev.compulab.local (mike-pc.compulab.local [10.1.1.95]) by mail.linux-boards.com (8.12.5/8.12.8) with ESMTP id n0K7XqgC015526; Tue, 20 Jan 2009 09:33:52 +0200 Received: from gentoodev.compulab.local (localhost [127.0.0.1]) by gentoodev.compulab.local (8.14.0/8.14.0) with ESMTP id n0K7Xpm6015205; Tue, 20 Jan 2009 09:33:51 +0200 Received: (from mike@localhost) by gentoodev.compulab.local (8.14.0/8.14.0/Submit) id n0K7Xp1l015204; Tue, 20 Jan 2009 09:33:51 +0200 X-Authentication-Warning: gentoodev.compulab.local: mike set sender to mike@compulab.co.il using -f From: Mike Rapoport To: eric.miao@marvell.com Subject: [PATCH] MTD: NAND: pxa3xx_nand: use resource_size instead of 'r->end - r->start + 1' Date: Tue, 20 Jan 2009 09:33:46 +0200 Message-Id: <1232436828-15176-2-git-send-email-mike@compulab.co.il> X-Mailer: git-send-email 1.5.6.4 In-Reply-To: <1232436828-15176-1-git-send-email-mike@compulab.co.il> References: <1232436828-15176-1-git-send-email-mike@compulab.co.il> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cathcart.site5.com X-AntiAbuse: Original Domain - lists.infradead.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - compulab.co.il X-Source: X-Source-Args: X-Source-Dir: X-Bad-Reply: References and In-Reply-To but no 'Re:' in Subject. X-Spam-Score: 0.0 (/) X-Mailman-Approved-At: Tue, 20 Jan 2009 02:58:33 -0500 Cc: linux-mtd@lists.infradead.org, linux-arm-kernel@lists.arm.linux.org.uk, ben-linux@fluff.org, Mike Rapoport X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Mike Rapoport --- drivers/mtd/nand/pxa3xx_nand.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c index cc55cbc..ffa960b 100644 --- a/drivers/mtd/nand/pxa3xx_nand.c +++ b/drivers/mtd/nand/pxa3xx_nand.c @@ -1118,14 +1118,14 @@ static int pxa3xx_nand_probe(struct platform_device *pdev) goto fail_put_clk; } - r = request_mem_region(r->start, r->end - r->start + 1, pdev->name); + r = request_mem_region(r->start, resource_size(r), pdev->name); if (r == NULL) { dev_err(&pdev->dev, "failed to request memory resource\n"); ret = -EBUSY; goto fail_put_clk; } - info->mmio_base = ioremap(r->start, r->end - r->start + 1); + info->mmio_base = ioremap(r->start, resource_size(r)); if (info->mmio_base == NULL) { dev_err(&pdev->dev, "ioremap() failed\n"); ret = -ENODEV; @@ -1174,7 +1174,7 @@ fail_free_buf: fail_free_io: iounmap(info->mmio_base); fail_free_res: - release_mem_region(r->start, r->end - r->start + 1); + release_mem_region(r->start, resource_size(r)); fail_put_clk: clk_disable(info->clk); clk_put(info->clk);