From patchwork Tue Dec 8 05:27:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 7794301 X-Patchwork-Delegate: eduardo.valentin@ti.com Return-Path: X-Original-To: patchwork-linux-pm@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 DAD059FC46 for ; Tue, 8 Dec 2015 05:27:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1A39B20515 for ; Tue, 8 Dec 2015 05:27:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D7B3520532 for ; Tue, 8 Dec 2015 05:27:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932862AbbLHF1i (ORCPT ); Tue, 8 Dec 2015 00:27:38 -0500 Received: from relmlor3.renesas.com ([210.160.252.173]:49394 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932723AbbLHF1g (ORCPT ); Tue, 8 Dec 2015 00:27:36 -0500 Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie2.idc.renesas.com with ESMTP; 08 Dec 2015 14:27:34 +0900 Received: from relmlac3.idc.renesas.com (relmlac3.idc.renesas.com [10.200.69.23]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id DDFDD43FD8; Tue, 8 Dec 2015 14:27:34 +0900 (JST) Received: by relmlac3.idc.renesas.com (Postfix, from userid 0) id D2DD61800A; Tue, 8 Dec 2015 14:27:34 +0900 (JST) Received: from relmlac3.idc.renesas.com (localhost [127.0.0.1]) by relmlac3.idc.renesas.com (Postfix) with ESMTP id C3E4A1806F; Tue, 8 Dec 2015 14:27:34 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac3.idc.renesas.com with ESMTP id QAA31173; Tue, 8 Dec 2015 14:27:34 +0900 X-IronPort-AV: E=Sophos;i="5.20,397,1444662000"; d="scan'";a="201319594" Received: from mail-hk2apc01lp0208.outbound.protection.outlook.com (HELO APC01-HK2-obe.outbound.protection.outlook.com) ([65.55.88.208]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 08 Dec 2015 14:27:33 +0900 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; Received: from morimoto-PC.renesas.com (211.11.155.144) by SG2PR06MB1018.apcprd06.prod.outlook.com (10.161.9.26) with Microsoft SMTP Server (TLS) id 15.1.337.19; Tue, 8 Dec 2015 05:27:31 +0000 Message-ID: <87si3d5x7g.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 2/8 v4] thermal: rcar: check every rcar_thermal_update_temp() return value User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") To: Simon , Zhang Rui , Eduardo Valentin CC: Geert Uytterhoeven , Magnus , , , , "devicetree@vger.kernel.org" In-Reply-To: <87vb895x9d.wl%kuninori.morimoto.gx@renesas.com> References: <87vb895x9d.wl%kuninori.morimoto.gx@renesas.com> Date: Tue, 8 Dec 2015 05:27:31 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: HKXPR03CA0040.apcprd03.prod.outlook.com (10.141.129.30) To SG2PR06MB1018.apcprd06.prod.outlook.com (25.161.9.26) X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB1018; 2:DfIqTcYVBQsW4tjRJzb2hZak2sKQ7KtKn+YzT+FMnLlnec5DMl1vu7x0wRF3MbkxgCcytnLh7osY+xtYu6iFtKI2cdgEQ6n/4CsFakT2pDqf+iNGu8gPkl8i5yW5glMpDmIXEcBMtVHmjgQUtyrRPg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emJyiP3u25O07EzrhprxuSsGRsJJdVSRjFpvf3zG87RY7aXzA/fHtC0E4zjkb5zP1YEx284hgR3E0N01w2CJA+arMGPKL9IUQrTLCMRW0otzgbgQJfO4woFT7tCkIQWXl4gNojqK20qgLAIF9wmCMezWlP8WH71ccLwfK2En4tD3+EBXhM9CcR9gaQ2+3N+9iddWl2WWgENLo5dR66eoa4CxbdVE2cKY3Kz0wVPU6AaUeCOGUBj/4WUqJrWhqemaBth/uE6D0aaICaUwEeJ+pAWk/4MCTdFa67maIc794aW6DcftcBTqO4vBn8CjxMdw0po6SEUs/oQcNUh9Fyk5JXygxN4rOUdD6ZPhcAVFSHtN9M 4Cr4Gq8j8qzqdMUfFw/zgVWdTN X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(85106069007906); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(520078)(5005006)(8121501046)(3002001)(10201501046); SRVR:SG2PR06MB1018; BCL:0; PCL:0; RULEID:; SRVR:SG2PR06MB1018; X-Forefront-PRVS: 0784C803FD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(979002)(6009001)(199003)(189002)(6116002)(19580405001)(19580395003)(97736004)(36756003)(50466002)(5001770100001)(69596002)(81156007)(83506001)(87976001)(105586002)(4001350100001)(66066001)(101416001)(5001960100002)(77096005)(92566002)(33646002)(46406003)(40100003)(23726003)(106356001)(586003)(3846002)(2950100001)(229853001)(189998001)(1096002)(5008740100001)(50986999)(122386002)(5004730100002)(86362001)(47776003)(42186005)(76176999)(53416004)(54356999)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1102; SCL:1; SRVR:SG2PR06MB1018; H:morimoto-PC.renesas.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SG2PR06MB1018; 23:VMtQFXzi+HKI4tKXr6LONovefOJ8kY53geKInFKxj?= =?us-asc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0SElXI711+qa?= =?us-ascii?Q?8CvTeoHjBc4svqR8UgbNRsTxJ2xcxopFw8G0m1syFZFUnaHy8sjPDuoKQOyS?= =?us-ascii?Q?u/1WBzQZH7PDG2pEiTl4GomxbJInJSHmNJuRNWwfd10RpnpLhwUMbo9mrkXq?= =?us-ascii?Q?mJkvndST6YWEHucl154xfYcMcdF/SLhskGX5gjnMew/El8/dGXm73fB8Kpuz?= =?us-ascii?Q?JFqBhRYuVNSJzv0fiBSmFurbBQjNXjUU4pIdcR07xVLZ7ybkNdl4kNCOPyjW?= =?us-ascii?Q?LbJ9qvxnfNOQeV9PDhl3X/jCs2SYwdPn1Tx?= X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB1018; 5:IZGPbv+YU4sTPilQPY3wW5sSiykXJeLnp19v333p03ydkc05iIpsgiPejO1fR7d5Yq43mrV1VctnAHWVrGYsv4ShOSxO2UPSl8rsBh8fNwY/EqOgrcU3pGgqiHR7UWfrVuPQbWmQhls+9kCWOV/wWg==; 24:Db3PMw8zCTH5Ii/isyqNHbnbQZtv892JLa31MVrAfhxROyOWYDkrU+YSo/TReHQQSc0zE+ibGeALuHC7V2IvRk/UhBTTBbZb5Y/8GL8a3/g=; 20:hS6Sk7u2GyzkhzOfb5KdOJGnkQvaYqRsifh05MkEvfMNpX0FEwzmxHhd4ZEwKvHil9iOoR8eBFQO6DAVPbyQ/V2cgnlVjlPtugId5ftJTDBx8lM13Y96HXHOvtD2+KMeXqTjCLytm2L34nkbTQJB0+WGtt3x6q/E+NN0q8wHyPM= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Dec 2015 05:27:31.4435 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB1018 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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=unavailable 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 From: Kuninori Morimoto Signed-off-by: Kuninori Morimoto --- v3 -> v4 - add 1line between int <-> return drivers/thermal/rcar_thermal.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c index ac8d1eb..a1a93f3 100644 --- a/drivers/thermal/rcar_thermal.c +++ b/drivers/thermal/rcar_thermal.c @@ -210,8 +210,12 @@ static int rcar_thermal_get_temp(struct thermal_zone_device *zone, int *temp) { struct rcar_thermal_priv *priv = rcar_zone_to_priv(zone); - if (!rcar_has_irq_support(priv) || rcar_force_update_temp(priv)) - rcar_thermal_update_temp(priv); + if (!rcar_has_irq_support(priv) || rcar_force_update_temp(priv)) { + int ret = rcar_thermal_update_temp(priv); + + if (ret < 0) + return ret; + } mutex_lock(&priv->lock); *temp = MCELSIUS((priv->ctemp * 5) - 65); @@ -305,11 +309,15 @@ static void rcar_thermal_work(struct work_struct *work) { struct rcar_thermal_priv *priv; int cctemp, nctemp; + int ret; priv = container_of(work, struct rcar_thermal_priv, work.work); rcar_thermal_get_temp(priv->zone, &cctemp); - rcar_thermal_update_temp(priv); + ret = rcar_thermal_update_temp(priv); + if (ret < 0) + return; + rcar_thermal_irq_enable(priv); rcar_thermal_get_temp(priv->zone, &nctemp); @@ -427,7 +435,9 @@ static int rcar_thermal_probe(struct platform_device *pdev) mutex_init(&priv->lock); INIT_LIST_HEAD(&priv->list); INIT_DELAYED_WORK(&priv->work, rcar_thermal_work); - rcar_thermal_update_temp(priv); + ret = rcar_thermal_update_temp(priv); + if (ret < 0) + goto error_unregister; priv->zone = thermal_zone_device_register("rcar_thermal", 1, 0, priv,