From patchwork Fri Feb 1 10:07:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 2077991 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 A7666DFE75 for ; Fri, 1 Feb 2013 10:17:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755530Ab3BAKRN (ORCPT ); Fri, 1 Feb 2013 05:17:13 -0500 Received: from mail-pb0-f49.google.com ([209.85.160.49]:35578 "EHLO mail-pb0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753583Ab3BAKRM (ORCPT ); Fri, 1 Feb 2013 05:17:12 -0500 Received: by mail-pb0-f49.google.com with SMTP id xa12so2087683pbc.22 for ; Fri, 01 Feb 2013 02:17:12 -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=DJ+PYqI87HpT5rVlX7o0gtjsOHAm/h3PSnql2XIfuOs=; b=Y1n2Uvy8n7v6Qjr0nclGYQ7LIdk1VA65nx1SZanLMiEaB4RUT84vAQ3unpWt0ns1v/ OLGUoxl5Fb02mJPwCxB011d7m6vylCl+tvWiUnCvyPKfPs2wDBJUMg3tN+07gKsDaBRR uvOZGtb9t5cjxAL5M1mLr/WeLaChW+7QA79UoEn6ITbHPHRQTVN7oPrm5S73NL4oada2 08wGGKZ4iwCZENuwMo4cjQe0CyOgCWb7is/tIlo4IHY86Ot8yNFcjnQSDja2lpF/xJlR IEc9x3NZzLvMghQmhEgmI/3muDfBCvGMJo/ir8PrjEUV0ZnsAm6govIoeNh4lyCXAiDQ oIZg== X-Received: by 10.68.137.167 with SMTP id qj7mr30154722pbb.148.1359713832126; Fri, 01 Feb 2013 02:17:12 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id f9sm8722782paz.12.2013.02.01.02.17.09 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 01 Feb 2013 02:17:11 -0800 (PST) From: Sachin Kamat To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, thierry.reding@avionic-design.de, sachin.kamat@linaro.org, Dmitry Torokhov , linux-input@vger.kernel.org Subject: [PATCH v2 1/2] Input: tegra-kbc- Convert to devm_ioremap_resource() Date: Fri, 1 Feb 2013 15:37:56 +0530 Message-Id: <1359713277-14228-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQnV+7FE5En1+rFeB5ghChkpKkhCdK/2NtrdB2YxRX4gUvVW8tbwvu95O0T1nH0fqObb9RUN 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 Cc: Dmitry Torokhov Cc: linux-input@vger.kernel.org Reviewed-by: Thierry Reding --- Patch based & compile tested on linux-next tree (20130128). Changes since v1: * Dropped the error message as it is now handled by devm_ioremap_resource() itself. --- 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 46e8ad2..fc43806 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,11 +616,9 @@ 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) { - 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)) {