From patchwork Fri Sep 11 03:34:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: WEN Pingbo X-Patchwork-Id: 7157401 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4C9FB9F326 for ; Fri, 11 Sep 2015 03:35:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7BE7E207BA for ; Fri, 11 Sep 2015 03:35:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A5722207C1 for ; Fri, 11 Sep 2015 03:35:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751066AbbIKDfj (ORCPT ); Thu, 10 Sep 2015 23:35:39 -0400 Received: from mail-pa0-f52.google.com ([209.85.220.52]:36353 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750862AbbIKDfj (ORCPT ); Thu, 10 Sep 2015 23:35:39 -0400 Received: by padhk3 with SMTP id hk3so61633316pad.3 for ; Thu, 10 Sep 2015 20:35:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=xWTiTYjK85eLzLFZQ9bwv6VtlvxDPG3lX14lcpeaCrE=; b=AEDHLN5kxeAqgTYcaTueBvSnBIs/tWmD/wtEfx3fGnvjJI32Sl70ECBGKE43H5oASA YzzMd0FAmcImi382tScsjpwp6GAq8RKC093lp+xt/do03QhKsJ+0sA956wtgiDDNXbjl XmLAEY9iBvHJmZ8qARD7+hlaevPpeSHw57QqAF3V8LTBeq/6JZYpYOMVhAkKF2JKYr1M ZtTx7SnIjnr+bc5BgExEjjLn73exVhdLrT7M46kmc2/84SbhVQApCjEJie3/e98eQma+ HOsu6IbrdaPg4S9/uxDjwB4tXIVITwWFjvp7VIpVYAGPLapy7GClgPdGwAE+371DMZK3 D8nw== X-Gm-Message-State: ALoCoQmNkuwo2GxYyLFcF1PTK/qc95zmmji1Mp6G5Np2OUveFw6BKEvOfK8QFO0PO2OmdK+lCDit X-Received: by 10.68.190.38 with SMTP id gn6mr90487954pbc.125.1441942538991; Thu, 10 Sep 2015 20:35:38 -0700 (PDT) Received: from localhost.localdomain ([202.130.115.78]) by smtp.gmail.com with ESMTPSA id qh2sm14734331pbc.7.2015.09.10.20.35.37 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 10 Sep 2015 20:35:38 -0700 (PDT) From: WEN Pingbo To: dmitry.torokhov@gmail.com Cc: broonie@kernel.org, linux-input@vger.kernel.org, WEN Pingbo Subject: [PATCH V2 1/2] Input: at32psif: handle clk_enable return value Date: Fri, 11 Sep 2015 11:34:50 +0800 Message-Id: <1441942490-5980-1-git-send-email-pingbo.wen@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We should print the err if clk_enable failed. Signed-off-by: WEN Pingbo --- drivers/input/serio/at32psif.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/input/serio/at32psif.c b/drivers/input/serio/at32psif.c index 2e4ff5b..38862a8 100644 --- a/drivers/input/serio/at32psif.c +++ b/drivers/input/serio/at32psif.c @@ -185,6 +185,7 @@ static void psif_set_prescaler(struct psif *psif) { unsigned long prscv; unsigned long rate = clk_get_rate(psif->pclk); + int retval; /* PRSCV = Pulse length (100 us) * PSIF module frequency. */ prscv = 100 * (rate / 1000000UL); @@ -195,7 +196,12 @@ static void psif_set_prescaler(struct psif *psif) "prescaler set to max\n"); } - clk_enable(psif->pclk); + retval = clk_enable(psif->pclk); + if (retval < 0) { + dev_err(&psif->pdev->dev, + "could not enable pclk, ret %d\n", retval); + return; + } psif_writel(psif, PSR, prscv); clk_disable(psif->pclk); }