From patchwork Tue Jun 6 09:34:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 9768357 X-Patchwork-Delegate: eduardo.valentin@ti.com 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 7252A6035D for ; Tue, 6 Jun 2017 09:35:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5923423D5E for ; Tue, 6 Jun 2017 09:35:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4E0E5269A3; Tue, 6 Jun 2017 09:35:08 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI 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 E130923D5E for ; Tue, 6 Jun 2017 09:35:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751481AbdFFJfH (ORCPT ); Tue, 6 Jun 2017 05:35:07 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:34492 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751439AbdFFJfG (ORCPT ); Tue, 6 Jun 2017 05:35:06 -0400 Received: by mail-pf0-f196.google.com with SMTP id w69so23873785pfk.1; Tue, 06 Jun 2017 02:35:05 -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=pvIpuNGD3AGMHTrGF6/RTCJ3gOfUxOgz93zALJTV+7E=; b=LVGB7ZAkerIG1HLXoPR1npQdbluwPt1PadegqWviiFh8GvdorpeSfrJtwAL7uYERNH XUZqzeYjTlQQizdKCuvvdoyjkoT6qZwIHpuQBPIvUDQqtAswIZMX+UcjxETpr2LEEhd6 yS0SSqKKmB8fTjNMVkem4Cqbee4PeIM2NbpUiB9MGKjsodzQLbrbGaEIMGJMUQzEA+SW /K26lw3u/GtAxlnLKnavpcwzpeHgazc8X7u8TBYjmERU0pSBl91MtGZ39+jEvNmtCUHG GJGK7Pba1m60qVrEcyGJSlYeoS7uuKE8ilE6vmje9JCFV5wsiPxXRobA5fXP28ejbuya Vdfg== 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=pvIpuNGD3AGMHTrGF6/RTCJ3gOfUxOgz93zALJTV+7E=; b=m/RjWvlvgJZbLE6a0gKzGBlMBqOIfGYaH7bbNBg5RY9zsEWMYaLVFQYPtkAuCUfIzB do8fWstZhkHl939acOsYeba/YTkRUOLuhHsGbP+i8amEAtCnWBnirIosnRpqVISK0U5t 5OKf+ZPIDjEoZQ2U/jbpKae7mHigjjxkxKl7UF8lLB1qSTBqer5S5LW1vmS40Ks/cW+O 7YFyGMQuN/kLHUaeKrZzzuZbu6CZvquRgXMwLxQcvmKHmV/xE81Fxj1Mi2P2NDXNBdE/ uDXhRmKTjSzhixP+D95OafaSG1hs+0INnY+rUDx5S5oBGliHwpw7lNq4i50gfXbyIGpt mcFQ== X-Gm-Message-State: AODbwcD5n7c3XWSxSs2KtzfjjJjZXJWGJCyssvvVld7m5UrbRxI6itSG wafUUz28TvKbZA== X-Received: by 10.99.168.67 with SMTP id i3mr18055pgp.23.1496741705497; Tue, 06 Jun 2017 02:35:05 -0700 (PDT) Received: from symbol-HP-Z420-Workstation.zebra.lan ([223.31.70.102]) by smtp.googlemail.com with ESMTPSA id g27sm12195984pfd.80.2017.06.06.02.35.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 06 Jun 2017 02:35:03 -0700 (PDT) From: Arvind Yadav To: rui.zhang@intel.com, edubezval@gmail.com Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] thermal: hisilicon: Handle return value of clk_prepare_enable Date: Tue, 6 Jun 2017 15:04:46 +0530 Message-Id: <3343de0616933425916bbe0dc3359d9e3e3608a1.1496741588.git.arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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/thermal/hisi_thermal.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/thermal/hisi_thermal.c b/drivers/thermal/hisi_thermal.c index f642966..9c3ce34 100644 --- a/drivers/thermal/hisi_thermal.c +++ b/drivers/thermal/hisi_thermal.c @@ -397,8 +397,11 @@ static int hisi_thermal_suspend(struct device *dev) static int hisi_thermal_resume(struct device *dev) { struct hisi_thermal_data *data = dev_get_drvdata(dev); + int ret; - clk_prepare_enable(data->clk); + ret = clk_prepare_enable(data->clk); + if (ret) + return ret; data->irq_enabled = true; hisi_thermal_enable_bind_irq_sensor(data);