From patchwork Sun Dec 28 06:00:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 424296 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 7B0621400D5 for ; Sun, 28 Dec 2014 17:01:07 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751249AbaL1GBG (ORCPT ); Sun, 28 Dec 2014 01:01:06 -0500 Received: from mail-pa0-f44.google.com ([209.85.220.44]:63559 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751045AbaL1GBF (ORCPT ); Sun, 28 Dec 2014 01:01:05 -0500 Received: by mail-pa0-f44.google.com with SMTP id et14so15547329pad.3 for ; Sat, 27 Dec 2014 22:01:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:subject:from:to:cc:date:content-type :mime-version:content-transfer-encoding; bh=fiPbPea78pbUpKAvIOUfp/tNxVeFXsuJzyATsUr7S6E=; b=Rdq5xpu5OJ2ziapKC+PZxw1mF2qSCjyIhVcF6jKKLHps0JY5J+/E0Hik+FTgMiOK+v tQPgt8vduZYLVdIufCWLhe4mZKBj98vd2FOv4cSben93uXRMnl9IdrKGbEMJ87Zg5QFZ vH9nrcEYxvug0fBqTWdiakpQ+rF/dpCcLk4+ZV6kcTD/EtBsvKfW3wNB7rGdWdtRORAO LYvFRVHlb1+s0Rt69pyUQzYNSF4dXT8Cr2QkwQaqKI9kd8G/YxcgzV9mCU1EccFhNZCh B/xZfEnuRc0b5Je3cTXv+kr/jEv7WMqQUi6ZfZTLruNnSjG/llBEuy2zpvmjqhc0VQ3X Hegg== X-Gm-Message-State: ALoCoQlwqXyg5NPUa5HpNvbfd419NxPlwiehAYeSIGnyjDadnX+pT0BLuRX7h69W1Kl1ilfR/Xx+ X-Received: by 10.68.197.194 with SMTP id iw2mr79876124pbc.73.1419746464122; Sat, 27 Dec 2014 22:01:04 -0800 (PST) Received: from [10.118.50.176] ([60.245.64.174]) by mx.google.com with ESMTPSA id 9sm32221074pdg.38.2014.12.27.22.01.02 (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128); Sat, 27 Dec 2014 22:01:03 -0800 (PST) Message-ID: <1419746439.4496.1.camel@phoenix> Subject: [PATCH 1/2] gpio: tz1090: Use resource_size to fix off-by-one resource size calculation From: Axel Lin To: Linus Walleij , Alexandre Courbot Cc: James Hogan , "linux-gpio@vger.kernel.org" Date: Sun, 28 Dec 2014 14:00:39 +0800 X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Signed-off-by: Axel Lin --- drivers/gpio/gpio-tz1090.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-tz1090.c b/drivers/gpio/gpio-tz1090.c index e3024bb..445660a 100644 --- a/drivers/gpio/gpio-tz1090.c +++ b/drivers/gpio/gpio-tz1090.c @@ -573,7 +573,7 @@ static int tz1090_gpio_probe(struct platform_device *pdev) /* Ioremap the registers */ priv.reg = devm_ioremap(&pdev->dev, res_regs->start, - res_regs->end - res_regs->start); + resource_size(res_regs)); if (!priv.reg) { dev_err(&pdev->dev, "unable to ioremap registers\n"); return -ENOMEM;