Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751536AbdHaSvL (ORCPT ); Thu, 31 Aug 2017 14:51:11 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:36321 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751264AbdHaSvJ (ORCPT ); Thu, 31 Aug 2017 14:51:09 -0400 X-Google-Smtp-Source: ADKCNb7CX2R1D1x0/xohZdFlJr/YtVpFzKoiho0VkH1Ut1Lp3ZeyCpnUXBLqXBriXL8Ra9zOtLmBTA== Date: Thu, 31 Aug 2017 11:51:05 -0700 From: Dmitry Torokhov To: Arvind Yadav Cc: riyer@nvidia.com, ldewangan@nvidia.com, thierry.reding@gmail.com, jonathanh@nvidia.com, linux-input@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] Input: tegra-kbc: Handle return value of clk_prepare_enable. Message-ID: <20170831185105.GD14370@dtor-ws> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 910 Lines: 34 On Tue, Aug 01, 2017 at 03:32:26PM +0530, Arvind Yadav wrote: > clk_prepare_enable() can fail here and we must check its return value. > > Signed-off-by: Arvind Yadav Applied, thank you. > --- > 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); > -- > 1.9.1 > -- Dmitry