From patchwork Fri Sep 11 03:02:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: WEN Pingbo X-Patchwork-Id: 7157231 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 21DE29F314 for ; Fri, 11 Sep 2015 03:03:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 476C120873 for ; Fri, 11 Sep 2015 03:03:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3BA8F20874 for ; Fri, 11 Sep 2015 03:03:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751361AbbIKDDx (ORCPT ); Thu, 10 Sep 2015 23:03:53 -0400 Received: from mail-pa0-f47.google.com ([209.85.220.47]:35873 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751270AbbIKDDw (ORCPT ); Thu, 10 Sep 2015 23:03:52 -0400 Received: by padhk3 with SMTP id hk3so60892376pad.3 for ; Thu, 10 Sep 2015 20:03:52 -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; bh=Ds+fvgZpG8f3fE/0ecH+TJqHxfaRJOBZgNsVoA4tXsU=; b=XmGA/Cto1Bg+VX9E/VGr/lG4ScRf/6YbFq69R9x9EHC6lbw0kek/hf5eR+dckW8vcK pbbmwr8hfLng7YX2BLrvjHXcElJxE3HSlBCQj3jqr77TwVlx7idWEBTCDun9RsvujI9T YDSqh+PHLu9nm4qVFzlg5PmPwE+SvmftLLhVxAaC7bsGSx+uG9ybEc4mR6gRRK5Sv9Ju GFgGxe3iv+vDR3o73xqjst9hba/p/ZfCN4U3tMIOyV4oda4D70sOtG5O4J5/sMbwHDxk wXYZ7XwrVLwITQOHWQWL6BeFs/M61qviIp7D97kXCy1B4f+7s+4Oo04kl5RwLyc5Wfmj eZdg== X-Gm-Message-State: ALoCoQkkppVrRzbkJVNATBbAsk2RrYJQPDzx9Cgaf8kL3vOOtMVZVDk2hs16oasFS0yESVyVPC/+ X-Received: by 10.66.243.70 with SMTP id ww6mr82040677pac.88.1441940632448; Thu, 10 Sep 2015 20:03:52 -0700 (PDT) Received: from localhost.localdomain ([202.130.115.78]) by smtp.gmail.com with ESMTPSA id ri9sm14626460pbc.4.2015.09.10.20.03.50 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 10 Sep 2015 20:03:51 -0700 (PDT) From: WEN Pingbo To: dmitry.torokhov@gmail.com Cc: broonie@kernel.org, linux-input@vger.kernel.org, WEN Pingbo Subject: [PATCH 1/2] Input: at32psif: handle clk_enable return value Date: Fri, 11 Sep 2015 11:02:55 +0800 Message-Id: <1441940576-4972-1-git-send-email-pingbo.wen@linaro.org> 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-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 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/input/serio/at32psif.c b/drivers/input/serio/at32psif.c index 2e4ff5b..aebb996 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,10 @@ 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); psif_writel(psif, PSR, prscv); clk_disable(psif->pclk); }