From patchwork Tue Jun 6 09:42:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 9768375 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 49CF76035D for ; Tue, 6 Jun 2017 09:43:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2FD112679B for ; Tue, 6 Jun 2017 09:43:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 241F526E16; Tue, 6 Jun 2017 09:43:17 +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=unavailable 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 D1E642679B for ; Tue, 6 Jun 2017 09:43:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751588AbdFFJnD (ORCPT ); Tue, 6 Jun 2017 05:43:03 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:36795 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751419AbdFFJnA (ORCPT ); Tue, 6 Jun 2017 05:43:00 -0400 Received: by mail-pg0-f67.google.com with SMTP id v18so9329177pgb.3; Tue, 06 Jun 2017 02:42:59 -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=zzEgj3OHR3wFQZ3447Fb9L2SLTGvTbOgBSYPxjvJaBA=; b=VX7xQVUmoibPjhB+CmnkmfR1sUEgJUhgbRZ5q2W4jiyLcICa+kGEn2lGb4newvWB3v yrduvPLeHDyWeQxPIbQ2NF1FYSeyTnlNPelDPAdht9WXnxfMFig3Ho94tYZVMMRbMRKE bFWwwH3LpuRJQkP2OKAl7HrCS+7Bhh47kJgyXel3PiEImOcH9pjJ1rTlQZ0r01Kq7Z3Q nSsfW3BugeDNkeWdXY3PYc2gvPmFff/gFb6AiVDRjUGgmH17vASDFGojtzj2VB3YgNHY FE0Vmk3BS5fs5TPC/nczmKWhZRopM40s2JlDL6s1nFT4G6xEt6Ybh603iFkccTNaItLl 5bOQ== 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=zzEgj3OHR3wFQZ3447Fb9L2SLTGvTbOgBSYPxjvJaBA=; b=toxTE83tHcnsTg3Ey6bQodgXtkWFwA4lv3n/YW8j9G6l1hj8DPr8uKoRwXCYXs1u1P e5oYKTMLttiOel/zWdSyBlQXCq6LZdOeIJwgd5uvY+e3B1NH4i6pvsI/cvzTFhguN14d mvOoAFlmn44Yq1b2a9+xH/9hjjrmDcSbP9FRGGCyozjp+kwjNi8LuUQRJhZGrMEhIRMC t6xiKVrBchPNlOcS56bHuFhFrsj+D6XQ6BjU4yaepnzN/n2iQfXb9qvm9r9nFSBu70KG +LmFIwrJ9ZzpDj2au6pW33C8x+Edrp7sP9wXphEbwHQvvI0h+3etAS/uah38odqZa6jA p5mg== X-Gm-Message-State: AODbwcCFZZqXsRKdcw0pHHXH00c31IObdF1XJXFHNhiNfbvA6gwYZtiJ +v+YMmpZW//oWA== X-Received: by 10.101.91.197 with SMTP id o5mr18931021pgr.206.1496742179275; Tue, 06 Jun 2017 02:42:59 -0700 (PDT) Received: from symbol-HP-Z420-Workstation.zebra.lan ([223.31.70.102]) by smtp.googlemail.com with ESMTPSA id q6sm6488690pfi.129.2017.06.06.02.42.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 06 Jun 2017 02:42:58 -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: imx: Handle return value of clk_prepare_enable Date: Tue, 6 Jun 2017 15:12:37 +0530 Message-Id: <629c868baf666c464a0e39515a89eaf13a06c064.1496741979.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/imx_thermal.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c index fb648a4..1aee321 100644 --- a/drivers/thermal/imx_thermal.c +++ b/drivers/thermal/imx_thermal.c @@ -648,8 +648,11 @@ static int imx_thermal_resume(struct device *dev) { struct imx_thermal_data *data = dev_get_drvdata(dev); struct regmap *map = data->tempmon; + int ret; - clk_prepare_enable(data->thermal_clk); + ret = clk_prepare_enable(data->thermal_clk); + if (ret) + return ret; /* Enabled thermal sensor after resume */ regmap_write(map, TEMPSENSE0 + REG_CLR, TEMPSENSE0_POWER_DOWN); regmap_write(map, TEMPSENSE0 + REG_SET, TEMPSENSE0_MEASURE_TEMP);