From patchwork Fri Jan 22 07:25:55 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Klauser X-Patchwork-Id: 74487 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o0M7ZJwH023868 for ; Fri, 22 Jan 2010 07:35:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751999Ab0AVHfT (ORCPT ); Fri, 22 Jan 2010 02:35:19 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752136Ab0AVHfS (ORCPT ); Fri, 22 Jan 2010 02:35:18 -0500 Received: from mx2.zhaw.ch ([160.85.104.51]:52690 "EHLO mx2.zhaw.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751999Ab0AVHfR (ORCPT ); Fri, 22 Jan 2010 02:35:17 -0500 X-Greylist: delayed 553 seconds by postgrey-1.27 at vger.kernel.org; Fri, 22 Jan 2010 02:35:17 EST Received: from mx2.zhaw.ch (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id 43A1E3D4; Fri, 22 Jan 2010 08:26:01 +0100 (CET) Received: from localhost.localdomain (staff-klto-0.zhaw.ch [160.85.232.160]) by mx2.zhaw.ch (Postfix) with ESMTP id DB103288; Fri, 22 Jan 2010 08:26:00 +0100 (CET) From: Tobias Klauser To: Dmitry Torokhov , linux-input@vger.kernel.org, John Linn Cc: Tobias Klauser Subject: [PATCH] Input: xilinx_ps2 - Use resource_size Date: Fri, 22 Jan 2010 08:25:55 +0100 Message-Id: <1264145155-5383-1-git-send-email-tklauser@distanz.ch> X-Mailer: git-send-email 1.6.3.3 X-PMX-Version: 5.5.9.388399, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2010.1.22.71533 X-PerlMx-Spam: Gauge=IIIIIIII, Probability=8%, Report=' BODY_SIZE_1100_1199 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __MIME_TEXT_ONLY 0, __SANE_MSGID 0, __STOCK_PHRASE_7 0, __TO_MALFORMED_2 0, __URI_NS ' Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org diff --git a/drivers/input/serio/xilinx_ps2.c b/drivers/input/serio/xilinx_ps2.c index ebb22f8..4d835e9 100644 --- a/drivers/input/serio/xilinx_ps2.c +++ b/drivers/input/serio/xilinx_ps2.c @@ -270,7 +270,7 @@ static int __devinit xps2_of_probe(struct of_device *ofdev, drvdata->irq = r_irq.start; phys_addr = r_mem.start; - remap_size = r_mem.end - r_mem.start + 1; + remap_size = resource_size(r_mem); if (!request_mem_region(phys_addr, remap_size, DRIVER_NAME)) { dev_err(dev, "Couldn't lock memory region at 0x%08llX\n", (unsigned long long)phys_addr); @@ -344,7 +344,7 @@ static int __devexit xps2_of_remove(struct of_device *of_dev) if (of_address_to_resource(of_dev->node, 0, &r_mem)) dev_err(dev, "invalid address\n"); else - release_mem_region(r_mem.start, r_mem.end - r_mem.start + 1); + release_mem_region(r_mem.start, resource_size(r_mem)); kfree(drvdata);