From patchwork Mon Dec 14 22:48:59 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hartley Sweeten X-Patchwork-Id: 67418 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nBEMnPaS032651 for ; Mon, 14 Dec 2009 22:49:25 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.ch3.sourceforge.com) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1NKJjC-0000G5-NC; Mon, 14 Dec 2009 22:49:18 +0000 Received: from sfi-mx-1.v28.ch3.sourceforge.com ([172.29.28.121] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1NKJj7-0000FQ-8T for spi-devel-general@lists.sourceforge.net; Mon, 14 Dec 2009 22:49:13 +0000 X-ACL-Warn: Received: from exprod6og107.obsmtp.com ([64.18.1.208]) by sfi-mx-1.v28.ch3.sourceforge.com with smtps (TLSv1:AES256-SHA:256) (Exim 4.69) id 1NKJiy-0005p0-L2 for spi-devel-general@lists.sourceforge.net; Mon, 14 Dec 2009 22:49:13 +0000 Received: from source ([63.240.6.3]) (using TLSv1) by exprod6ob107.postini.com ([64.18.5.12]) with SMTP ID DSNKSybA2sZWfiSVhJ71T1RuWDBkxA/hsssh@postini.com; Mon, 14 Dec 2009 14:49:04 PST Received: from d01smtp06.Mi8.com ([172.16.1.239]) by Outbound01.Mi8.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 14 Dec 2009 17:48:58 -0500 Received: from mi8nycmail19.Mi8.com ([172.16.7.219]) by d01smtp06.Mi8.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 14 Dec 2009 17:48:58 -0500 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Date: Mon, 14 Dec 2009 17:48:59 -0500 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH] xilinx_spi.c: use resource_size() Thread-Index: Acp9D5/ewc7ygpsUTvidw/lprgEYJA== From: "H Hartley Sweeten" To: "kernel list" , X-OriginalArrivalTime: 14 Dec 2009 22:48:58.0035 (UTC) FILETIME=[9F140030:01CA7D0F] X-Sender-Verify: failed, postmaster X-Spam-Score: -2.9 (--) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -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] 0.5 VA_SENDER_VERIFY_POSTMASTER Unable to Verify postmaster@domain.tld 0.6 AWL AWL: From: address is in the auto white-list X-Headers-End: 1NKJiy-0005p0-L2 Cc: David Brownell Subject: [spi-devel-general] [PATCH] xilinx_spi.c: use resource_size() X-BeenThere: spi-devel-general@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux SPI core/device drivers discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spi-devel-general-bounces@lists.sourceforge.net diff --git a/drivers/spi/xilinx_spi.c b/drivers/spi/xilinx_spi.c index 5a143b9..32525e6 100644 --- a/drivers/spi/xilinx_spi.c +++ b/drivers/spi/xilinx_spi.c @@ -332,14 +332,14 @@ static int __init xilinx_spi_of_probe(struct of_device *ofdev, xspi->irq = r_irq->start; - if (!request_mem_region(r_mem->start, - r_mem->end - r_mem->start + 1, XILINX_SPI_NAME)) { + if (!request_mem_region(r_mem->start, resource_size(r_mem), + XILINX_SPI_NAME)) { rc = -ENXIO; dev_warn(&ofdev->dev, "memory request failure\n"); goto put_master; } - xspi->regs = ioremap(r_mem->start, r_mem->end - r_mem->start + 1); + xspi->regs = ioremap(r_mem->start, resource_size(r_mem)); if (xspi->regs == NULL) { rc = -ENOMEM; dev_warn(&ofdev->dev, "ioremap failure\n");