From patchwork Fri Dec 4 08:32:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 7766041 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@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 A0E769F7B5 for ; Fri, 4 Dec 2015 08:33:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CD6FA204A2 for ; Fri, 4 Dec 2015 08:33:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D3DFB204A0 for ; Fri, 4 Dec 2015 08:33:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755365AbbLDIca (ORCPT ); Fri, 4 Dec 2015 03:32:30 -0500 Received: from relmlor2.renesas.com ([210.160.252.172]:51093 "EHLO relmlie1.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755275AbbLDIc2 (ORCPT ); Fri, 4 Dec 2015 03:32:28 -0500 Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie1.idc.renesas.com with ESMTP; 04 Dec 2015 17:32:26 +0900 Received: from relmlac1.idc.renesas.com (relmlac1.idc.renesas.com [10.200.69.21]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id DCA884758F; Fri, 4 Dec 2015 17:32:26 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id CCF4F8002E; Fri, 4 Dec 2015 17:32:26 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id C7C618002D; Fri, 4 Dec 2015 17:32:26 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac1.idc.renesas.com with ESMTP id TAA03383; Fri, 4 Dec 2015 17:32:26 +0900 X-IronPort-AV: E=Sophos;i="5.20,380,1444662000"; d="scan'";a="199892103" Received: from mail-hk2apc01lp0216.outbound.protection.outlook.com (HELO APC01-HK2-obe.outbound.protection.outlook.com) ([65.55.88.216]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 04 Dec 2015 17:32:25 +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 SIXPR06MB1021.apcprd06.prod.outlook.com (10.160.238.156) with Microsoft SMTP Server (TLS) id 15.1.337.19; Fri, 4 Dec 2015 08:32:22 +0000 Message-ID: <87egf2fwg6.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 2/8 v2] thermal: rcar: check every rcar_thermal_update_temp() return value User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Simon , Zhang Rui , Eduardo Valentin CC: Magnus , , , In-Reply-To: <87h9jyfwj7.wl%kuninori.morimoto.gx@renesas.com> References: <87h9jyfwj7.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Fri, 4 Dec 2015 08:32:22 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: HKXPR03CA0032.apcprd03.prod.outlook.com (10.141.129.22) To SIXPR06MB1021.apcprd06.prod.outlook.com (25.160.238.156) X-Microsoft-Exchange-Diagnostics: 1; SIXPR06MB1021; 2:rhMxHcKRXrhnuTgxrjuslDiyL+8+pItjsiU8XkqTF3zb37gTEEpS7WHzEfH0aip1p3Ar9PEsGkJ2KRyoTzWJiEobRRHP7a+wslTnDa4aMfclV/CBa5FIV5B0q3W0cesqHqhUotC2WToVPkNC7pewvQ==; 3:8ssZOCTfRUq5bkcNC16gcyaq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DD5rI2yo0Nug/a3rUceSU+hjZvZFgB3UoVIHjRxtY/lySLwhYJYJu1gAB22uYzxyFBMWH4DImQoAdESbqmUdHGafU65OFBJHahK+MG8x+X6LSgP2d30jGFwp77vygjcRcOsw3rY0EkIGn9THQZ+Ps6aqSYJoSn1PGwME3WEZ/NaLw0UPKjggiReTrZoHwISA0iDxFGQjTY1sOIKjVEcFLWkJOKCWZS/0NZvKrIfsg0vuGfyd26cUhKKCvRlMjZUdDJOzzaMlURZ/fKBRnMEEpsQFx+iNsVlZ4+ueaMSn0dDSrG8xFUD/9ImbrVGfnmmCzSXQfEjZI78C9s0JnDEblpaQY7nvBm8DL58CXz6 Mt1d7nGpgeLEnludY8Fu0cQsP7 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(85106069007906); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(520078)(8121501046)(3002001)(10201501046); SRVR:SIXPR06MB1021; BCL:0; PCL:0; RULEID:; SRVR:SIXPR06MB1021; X-Forefront-PRVS: 07807C55DC X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(189002)(199003)(2950100001)(86362001)(189998001)(66066001)(47776003)(586003)(1096002)(3846002)(6116002)(23726003)(19580405001)(19580395003)(77096005)(36756003)(83506001)(87976001)(42186005)(53416004)(40100003)(122386002)(101416001)(92566002)(46406003)(81156007)(229853001)(5008740100001)(5001770100001)(97736004)(5004730100002)(5001960100002)(105586002)(50986999)(33646002)(69596002)(106356001)(76176999)(54356999)(4001350100001)(50466002); DIR:OUT; SFP:1102; SCL:1; SRVR:SIXPR06MB1021; H:morimoto-PC.renesas.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SIXPR06MB1021; 23:ItfC+pBGef6hJAKHU6ZJXfQcImwdDc1xsjM40rfHh?= =?us-ascii?Q?dAPbCY/CEHvtUXEOqw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-ascii?Q?ju88lDHBbc/59aX1F3er2uWPDqSRMW7Q+n/ZuMn73Y+JhKD5k/RVp/GMnuff?= =?us-ascii?Q?sJQ6tIDDdAZ1OzDx17rr/0PG4CsmFnrWH+sF+DIwXuaQjXYWjyXiPoVcR+2v?= =?us-ascii?Q?QXnja8SzNi6CUQGJWAh0/zM61pQhNQu2kSFj2dBBLIxsXuGxWVD0wE0cHW85?= =?us-ascii?Q?220xASXUNY=3D?= X-Microsoft-Exchange-Diagnostics: 1; SIXPR06MB1021; 5:0zGSEMuwDnwguaB//2zAltLc9vN7tVrHYxtm5OY6ZeNQmPKJrz03cPoYomdbBj1V7oxN4uR6+XxRIj4H7oQ11j3g7vQQ//FurBYalG85iKdpGAYWQ4e1uFPyPuXfqrzaQ64xz2yRVFNEN2Cqyw+YJw==; 24:NK6LyjuxVjEuJsILpRjZstTxzh9v/5oKsVvjdZNlmlXWEYSHEzWEMcZMB+MW5WgaW3PBy75X8WbPAW/fOJ2deZIh1GYw7YfwLwce8f0RnFk=; 20:UITC6sXOQF8dLmlQ67kbiFhxYiqXIHxzYXXXo+dADCVoCknGG76NKf6gIB0xavEWn3g7jpIdZF2bkHR9+dfGt7o4gXE6Pu1MN2kF9ogBi365+wqy+xeA//2tRLsSL/QW00uaJlssov2tJiJJGhZ9+EtZt5YzKHclj4wJIDy5WHU= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Dec 2015 08:32:22.7003 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SIXPR06MB1021 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@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 --- v1 -> v2 - new patch drivers/thermal/rcar_thermal.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c index 96707a6..4d1bc2b 100644 --- a/drivers/thermal/rcar_thermal.c +++ b/drivers/thermal/rcar_thermal.c @@ -210,8 +210,11 @@ 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 +308,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); @@ -447,7 +454,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,