From patchwork Fri Sep 18 07:13:41 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Klauser X-Patchwork-Id: 48462 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8I7DiQa018308 for ; Fri, 18 Sep 2009 07:13:44 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750930AbZIRHNj (ORCPT ); Fri, 18 Sep 2009 03:13:39 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751322AbZIRHNj (ORCPT ); Fri, 18 Sep 2009 03:13:39 -0400 Received: from mx2.zhaw.ch ([160.85.104.51]:49074 "EHLO mx2.zhaw.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750930AbZIRHNj (ORCPT ); Fri, 18 Sep 2009 03:13:39 -0400 Received: from mx2.zhaw.ch (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id D99723D7; Fri, 18 Sep 2009 09:13:41 +0200 (CEST) Received: from localhost.localdomain (staff-klto-0.zhaw.ch [160.85.232.59]) by mx2.zhaw.ch (Postfix) with ESMTP id 887711DA; Fri, 18 Sep 2009 09:13:41 +0200 (CEST) From: Tobias Klauser To: Dmitry Torokhov Cc: Russell King , linux-input@vger.kernel.org, Tobias Klauser Subject: [PATCH] Input: pxa27x_keypad - Use resource_size Date: Fri, 18 Sep 2009 09:13:41 +0200 Message-Id: <1253258021-7817-1-git-send-email-tklauser@distanz.ch> X-Mailer: git-send-email 1.6.0.4 X-PMX-Version: 5.5.4.371499, Antispam-Engine: 2.7.1.369594, Antispam-Data: 2009.9.18.70621 X-PerlMx-Spam: Gauge=IIIIIIII, Probability=8%, Report=' BODY_SIZE_2000_2999 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, __TO_MALFORMED_2 0' Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Use resource size from linux/ioport.h instead of the private macro res_size. Signed-off-by: Tobias Klauser --- drivers/input/keyboard/pxa27x_keypad.c | 10 ++++------ 1 files changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/input/keyboard/pxa27x_keypad.c b/drivers/input/keyboard/pxa27x_keypad.c index 0d2fc64..911cebc 100644 --- a/drivers/input/keyboard/pxa27x_keypad.c +++ b/drivers/input/keyboard/pxa27x_keypad.c @@ -425,8 +425,6 @@ static int pxa27x_keypad_resume(struct platform_device *pdev) #define pxa27x_keypad_resume NULL #endif -#define res_size(res) ((res)->end - (res)->start + 1) - static int __devinit pxa27x_keypad_probe(struct platform_device *pdev) { struct pxa27x_keypad *keypad; @@ -461,14 +459,14 @@ static int __devinit pxa27x_keypad_probe(struct platform_device *pdev) goto failed_free; } - res = request_mem_region(res->start, res_size(res), pdev->name); + res = request_mem_region(res->start, resource_size(res), pdev->name); if (res == NULL) { dev_err(&pdev->dev, "failed to request I/O memory\n"); error = -EBUSY; goto failed_free; } - keypad->mmio_base = ioremap(res->start, res_size(res)); + keypad->mmio_base = ioremap(res->start, resource_size(res)); if (keypad->mmio_base == NULL) { dev_err(&pdev->dev, "failed to remap I/O memory\n"); error = -ENXIO; @@ -540,7 +538,7 @@ failed_put_clk: failed_free_io: iounmap(keypad->mmio_base); failed_free_mem: - release_mem_region(res->start, res_size(res)); + release_mem_region(res->start, resource_size(res)); failed_free: kfree(keypad); return error; @@ -562,7 +560,7 @@ static int __devexit pxa27x_keypad_remove(struct platform_device *pdev) iounmap(keypad->mmio_base); res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - release_mem_region(res->start, res_size(res)); + release_mem_region(res->start, resource_size(res)); platform_set_drvdata(pdev, NULL); kfree(keypad);