From patchwork Mon Jan 21 10:09:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 2010441 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id CDFFCDF23A for ; Mon, 21 Jan 2013 10:18:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752967Ab3AUKSF (ORCPT ); Mon, 21 Jan 2013 05:18:05 -0500 Received: from moutng.kundenserver.de ([212.227.126.186]:57794 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752982Ab3AUKJp (ORCPT ); Mon, 21 Jan 2013 05:09:45 -0500 Received: from mailbox.adnet.avionic-design.de (mailbox.avionic-design.de [109.75.18.3]) by mrelayeu.kundenserver.de (node=mrbap2) with ESMTP (Nemesis) id 0Lo2Ke-1THYqs3mGG-00gHaN; Mon, 21 Jan 2013 11:09:44 +0100 Received: from localhost (localhost [127.0.0.1]) by mailbox.adnet.avionic-design.de (Postfix) with ESMTP id A51792A28162; Mon, 21 Jan 2013 11:09:38 +0100 (CET) X-Virus-Scanned: amavisd-new at avionic-design.de Received: from mailbox.adnet.avionic-design.de ([127.0.0.1]) by localhost (mailbox.avionic-design.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zSk6+67xHF6A; Mon, 21 Jan 2013 11:09:36 +0100 (CET) Received: from mailman.adnet.avionic-design.de (mailman.adnet.avionic-design.de [172.20.31.172]) by mailbox.adnet.avionic-design.de (Postfix) with ESMTP id 5D4942A28178; Mon, 21 Jan 2013 11:09:27 +0100 (CET) Received: from localhost (avionic-0098.adnet.avionic-design.de [172.20.31.233]) by mailman.adnet.avionic-design.de (Postfix) with ESMTP id AB683100825; Mon, 21 Jan 2013 11:09:23 +0100 (CET) From: Thierry Reding To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , Dmitry Torokhov , Arnd Bergmann , Wolfram Sang , linux-input@vger.kernel.org Subject: [PATCH 12/33] Input: Convert to devm_ioremap_resource() Date: Mon, 21 Jan 2013 11:09:05 +0100 Message-Id: <1358762966-20791-13-git-send-email-thierry.reding@avionic-design.de> X-Mailer: git-send-email 1.8.1.1 In-Reply-To: <1358762966-20791-1-git-send-email-thierry.reding@avionic-design.de> References: <1358762966-20791-1-git-send-email-thierry.reding@avionic-design.de> X-Provags-ID: V02:K0:ChyyDLn7Trm57CFTISpSsL1LTKq21m7ww3ok0sxO0aU OWK+n40KuwdRfVpdGZU18jI3/yWEdYjZmC3SPI2EQFJAtwECH0 5fJs4t+u+mgjcp6FCf1bDgoy+JQcPYJaeHlTY2FEy3z86gyabX LxdRL27RFzTu0ZiKKbPbovzMA2HiatFU98+CPdp6KmojFRLg8d Qw1b/A/RW2GLBmo18D5lYiP/h+J4ZtVpQ0ISv8WNHObZwEQsSM 4p0Qk1YckPz9Wzge6gumPvufqOV7822nwOOcuWWT91LC6GtT4a g8b7qjbudS+mfJh9y+D2HFQpjK2vSzcipgqq6ZG0NHwnQXwVKO kj+NkHl6xGX9ShTFrClnL+RObJXTtMXtvFLF2G9YWihscrUI+c 3Aj7WI/dRbMwxJKuFscxaGGgrWnLuzNg9z1ljScAS8se4Efzjn te9ZI Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Convert all uses of devm_request_and_ioremap() to the newly introduced devm_ioremap_resource() which provides more consistent error handling. devm_ioremap_resource() provides its own error messages so all explicit error messages can be removed from the failure code paths. Signed-off-by: Thierry Reding Cc: Dmitry Torokhov Cc: linux-input@vger.kernel.org Acked-by: Dmitry Torokhov Acked-by: Viresh Kumar --- drivers/input/keyboard/spear-keyboard.c | 8 +++----- drivers/input/serio/arc_ps2.c | 7 ++++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/input/keyboard/spear-keyboard.c b/drivers/input/keyboard/spear-keyboard.c index 695d237..cb1e8f6 100644 --- a/drivers/input/keyboard/spear-keyboard.c +++ b/drivers/input/keyboard/spear-keyboard.c @@ -228,11 +228,9 @@ static int spear_kbd_probe(struct platform_device *pdev) kbd->suspended_rate = pdata->suspended_rate; } - kbd->io_base = devm_request_and_ioremap(&pdev->dev, res); - if (!kbd->io_base) { - dev_err(&pdev->dev, "request-ioremap failed for kbd_region\n"); - return -ENOMEM; - } + kbd->io_base = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(kbd->io_base)) + return PTR_ERR(kbd->io_base); kbd->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(kbd->clk)) diff --git a/drivers/input/serio/arc_ps2.c b/drivers/input/serio/arc_ps2.c index b571eb3..c52e3e5 100644 --- a/drivers/input/serio/arc_ps2.c +++ b/drivers/input/serio/arc_ps2.c @@ -8,6 +8,7 @@ * Driver is originally developed by Pavel Sokolov */ +#include #include #include #include @@ -206,9 +207,9 @@ static int arc_ps2_probe(struct platform_device *pdev) return -ENOMEM; } - arc_ps2->addr = devm_request_and_ioremap(&pdev->dev, res); - if (!arc_ps2->addr) - return -EBUSY; + arc_ps2->addr = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(arc_ps2->addr)) + return PTR_ERR(arc_ps2->addr); dev_info(&pdev->dev, "irq = %d, address = 0x%p, ports = %i\n", irq, arc_ps2->addr, ARC_PS2_PORTS);