From patchwork Tue Aug 1 10:02:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 9874035 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1C3D56038F for ; Tue, 1 Aug 2017 10:02:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 01D652869A for ; Tue, 1 Aug 2017 10:02:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EA6B9286A7; Tue, 1 Aug 2017 10:02:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9BA9D286A1 for ; Tue, 1 Aug 2017 10:02:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751056AbdHAKCo (ORCPT ); Tue, 1 Aug 2017 06:02:44 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:33073 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750832AbdHAKCn (ORCPT ); Tue, 1 Aug 2017 06:02:43 -0400 Received: by mail-pf0-f194.google.com with SMTP id c65so1588629pfl.0; Tue, 01 Aug 2017 03:02:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=iEFToyxiP7gk3/0pbkHUQ0PzGQGpNzL5K466NwuHdhE=; b=J2VO9xhyVAY6jsrMVDyHi2xSyzHMoRZS8hugJmOrsCsiruu36u5RZg8+hy4Afy0B49 eGQr6Mury6PWxaVqlwgsHV2/nQIzR4vi+vAqJkqyoDCIDgayC6P8tdUc8LHObEappIGK H/FeER4flsRL3zBg3UdWS7cnCDBv+vpCDNtcbBGBg8NaWNs1BMjkKaTrwF2Lec0CsSlh 2GpkA//TGsrlpyqC+9qCRWw4QWf2hFNHpRGI5yh+zi5D+wVnQdL1Yxw1jyjN3l4/nSum BIZBqV8bWy+RnQ6zjRKbMsuNDEm7yaq7Bx03JaoDKTDaXFT04uqrZkbL3L6HBFIKtv+2 lBHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=iEFToyxiP7gk3/0pbkHUQ0PzGQGpNzL5K466NwuHdhE=; b=I8j9InecE0A2KUB3T7cyrMXg2wwShaTyk8E02WNTsDKrGizBmt1C9GcbGdCr7r+0lM EZNHzX30eYMQfqKtv9ZpC6D3e4onWCUiJ+OuD0cG820ZT10hACnjw2PSFOU45icpniip b9TyqElYNw5Qn3u7fkNgcSxQKIJy3RlZTaNjqeg2wCiijeusaw5J2PXhkhfcN/tCZfYK 6EdqQdbxoI99ZfAtB3K8kBib7R6FPgwBRuHC7kmBVr+KipYTX+yWIvEmIgXPioIkyc0q q28LMVFcXsPp+tBy3AQt1/XNGjwfSC3GgYRgF08zhX2HBA42fPNVJMZgvK8WPWJYIG0I UKTQ== X-Gm-Message-State: AIVw113S86lhUJFK9fCFLCAcV/4MPLlKOBTLKdm0RqxVYswqipYOKNaX 2PRV9ZTqe6VCUw== X-Received: by 10.99.181.66 with SMTP id u2mr17996216pgo.83.1501581762863; Tue, 01 Aug 2017 03:02:42 -0700 (PDT) Received: from symbol-HP-Z420-Workstation.zebra.lan ([223.31.70.102]) by smtp.googlemail.com with ESMTPSA id e131sm52216026pgc.64.2017.08.01.03.02.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 01 Aug 2017 03:02:42 -0700 (PDT) From: Arvind Yadav To: riyer@nvidia.com, ldewangan@nvidia.com, dmitry.torokhov@gmail.com, thierry.reding@gmail.com, jonathanh@nvidia.com Cc: linux-input@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] Input: tegra-kbc: Handle return value of clk_prepare_enable. Date: Tue, 1 Aug 2017 15:32:26 +0530 Message-Id: X-Mailer: git-send-email 1.9.1 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP clk_prepare_enable() can fail here and we must check its return value. Signed-off-by: Arvind Yadav --- drivers/input/keyboard/tegra-kbc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c index 0c07e10..edc1385 100644 --- a/drivers/input/keyboard/tegra-kbc.c +++ b/drivers/input/keyboard/tegra-kbc.c @@ -370,8 +370,11 @@ static int tegra_kbc_start(struct tegra_kbc *kbc) { unsigned int debounce_cnt; u32 val = 0; + int ret; - clk_prepare_enable(kbc->clk); + ret = clk_prepare_enable(kbc->clk); + if (ret) + return ret; /* Reset the KBC controller to clear all previous status.*/ reset_control_assert(kbc->rst);