From patchwork Mon Feb 25 03:47:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 2180111 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 60F063FDF1 for ; Mon, 25 Feb 2013 03:57:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759722Ab3BYD5a (ORCPT ); Sun, 24 Feb 2013 22:57:30 -0500 Received: from mail-da0-f44.google.com ([209.85.210.44]:43622 "EHLO mail-da0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759689Ab3BYD5Z (ORCPT ); Sun, 24 Feb 2013 22:57:25 -0500 Received: by mail-da0-f44.google.com with SMTP id z20so1266322dae.3 for ; Sun, 24 Feb 2013 19:57:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=PB/RG9FgCJF0/3LosWZ1gnqg9Uy+s4k0EVN67QfMbo0=; b=fOwNI4kxoTXnotWvVH0XQsnseXsByIG9tO7V9uk4ukT5YFw7ADcJ/sO6WD6VhdBbjr l5fMyVPeyw5NCmHkpLZdogAw/MSXx0Hot3Ai1RqlFHsvRLAoG40NP9Em/xwrjt0g6Uhp mW++BSRokavoDwq4NKP3bbjaBxvKVI2pgM8oyzkEMi9Zzi0lsj07vR5OqrmKKACZOhmK MvW9+FrRuMh2phZuKTFadfp5UP0sKBInzpqLfj3dv0xaEPC3EXMkuxTbvugfZttg3jdb KwfoBXqm0/0v59Be6+mhFJA0zEliTGAhnWYbfQWqUeix4VuZZgYdWBY1xgOFyMf87VOA JwZg== X-Received: by 10.66.12.33 with SMTP id v1mr16403084pab.205.1361764645077; Sun, 24 Feb 2013 19:57:25 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id c3sm12130883pax.9.2013.02.24.19.57.22 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 24 Feb 2013 19:57:24 -0800 (PST) From: Sachin Kamat To: linux-input@vger.kernel.org Cc: dmitry.torokhov@gmail.com, sachin.kamat@linaro.org, thierry.reding@avionic-design.de Subject: [PATCH Resend] Input: tegra-kbc- Convert to devm_ioremap_resource() Date: Mon, 25 Feb 2013 09:17:00 +0530 Message-Id: <1361764020-28728-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQmwnuq2x+JwLJLH5jzwo8kPaMRyA8V3FLDb4eSk6+xqbbOxC40BeTg5MK5sIwscIKfYNylJ Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Use the newly introduced devm_ioremap_resource() instead of devm_request_and_ioremap() 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: Sachin Kamat Reviewed-by: Thierry Reding --- Rebased on the latest Linus' tree (v3.8+). --- drivers/input/keyboard/tegra-kbc.c | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c index 0e138eb..68b2b65 100644 --- a/drivers/input/keyboard/tegra-kbc.c +++ b/drivers/input/keyboard/tegra-kbc.c @@ -31,6 +31,7 @@ #include #include #include +#include #define KBC_MAX_GPIO 24 #define KBC_MAX_KPENT 8 @@ -608,11 +609,9 @@ static int tegra_kbc_probe(struct platform_device *pdev) setup_timer(&kbc->timer, tegra_kbc_keypress_timer, (unsigned long)kbc); - kbc->mmio = devm_request_and_ioremap(&pdev->dev, res); - if (!kbc->mmio) { - dev_err(&pdev->dev, "Cannot request memregion/iomap address\n"); - return -EBUSY; - } + kbc->mmio = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(kbc->mmio)) + return PTR_ERR(kbc->mmio); kbc->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(kbc->clk)) {