From patchwork Thu Jan 31 10:25:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 2072161 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 DF63A3FD1A for ; Thu, 31 Jan 2013 10:35:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753748Ab3AaKfA (ORCPT ); Thu, 31 Jan 2013 05:35:00 -0500 Received: from mail-da0-f54.google.com ([209.85.210.54]:57660 "EHLO mail-da0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751769Ab3AaKe4 (ORCPT ); Thu, 31 Jan 2013 05:34:56 -0500 Received: by mail-da0-f54.google.com with SMTP id n2so1250134dad.41 for ; Thu, 31 Jan 2013 02:34:56 -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:in-reply-to :references:x-gm-message-state; bh=3oFYDpCWtn4w7BZCFZueU9GoEXjnIU2XGYVcY5b7KD0=; b=k/pqzqFPAFWon9ylX0jPlXm85idZHuV9ke/g0KaciX+1uKF+xxFbDBEX4oY0AL3knz OSdnwBoxWlIBZecKjlclp5qavAnvCGd0k4i+6wtc1c8bc3QeipyW1aYHPO1R/Ww3R0xX oqMrY/G7tQEGObJv/yJwZxXFHlVrjEZ1DrDk5k8axhIj0wEEgC9QKVagSPUKWyuvnwsE QMICvnY7k46YraFOhD4U3ZbjXGyqQzLzeq5Cq97qeTxcrqt1czWmk4I7jwzP8lzMyI90 1TupXs35r+5HtivcCWa+czCLBh3K3YQlBHPAPLNsG/Gh0usMJe4il1Pat4c40bN1fTq+ BO7w== X-Received: by 10.68.236.2 with SMTP id uq2mr20637430pbc.55.1359628496070; Thu, 31 Jan 2013 02:34:56 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id q4sm5199356paz.20.2013.01.31.02.34.53 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 31 Jan 2013 02:34:55 -0800 (PST) From: Sachin Kamat To: linux-kernel@vger.kernel.org Cc: thierry.reding@avionic-design.de, gregkh@linuxfoundation.org, sachin.kamat@linaro.org, Dmitry Torokhov , linux-input@vger.kernel.org Subject: [PATCH 2/3] Input: tegra-kbc- Convert to devm_ioremap_resource() Date: Thu, 31 Jan 2013 15:55:38 +0530 Message-Id: <1359627939-2685-2-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1359627939-2685-1-git-send-email-sachin.kamat@linaro.org> References: <1359627939-2685-1-git-send-email-sachin.kamat@linaro.org> X-Gm-Message-State: ALoCoQl1Gd5CwUdZi7mnJEPLITOJ1Vr1M9RmziwPPn2LKJwstif9UMuwcBQgpkACfn6Nj+itsG6F 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. Signed-off-by: Sachin Kamat Cc: Dmitry Torokhov Cc: linux-input@vger.kernel.org --- Compile tested with linux-next (20130128) --- drivers/input/keyboard/tegra-kbc.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c index 46e8ad2..016d931 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_DEBOUNCE_CNT 0x3ffu @@ -615,10 +616,10 @@ static int tegra_kbc_probe(struct platform_device *pdev) spin_lock_init(&kbc->lock); setup_timer(&kbc->timer, tegra_kbc_keypress_timer, (unsigned long)kbc); - kbc->mmio = devm_request_and_ioremap(&pdev->dev, res); - if (!kbc->mmio) { + kbc->mmio = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(kbc->mmio)) { dev_err(&pdev->dev, "Cannot request memregion/iomap address\n"); - return -EBUSY; + return PTR_ERR(kbc->mmio); } kbc->clk = devm_clk_get(&pdev->dev, NULL);