Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754647AbbLGHnU (ORCPT ); Mon, 7 Dec 2015 02:43:20 -0500 Received: from relmlor2.renesas.com ([210.160.252.172]:52336 "EHLO relmlie1.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754549AbbLGHnO (ORCPT ); Mon, 7 Dec 2015 02:43:14 -0500 X-IronPort-AV: E=Sophos;i="5.20,393,1444662000"; d="scan'";a="201249641" Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; Message-ID: <87vb8a6710.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 2/8 v3] 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 , Geert Uytterhoeven CC: Magnus , , , , "devicetree@vger.kernel.org" In-Reply-To: <87y4d6672t.wl%kuninori.morimoto.gx@renesas.com> References: <87y4d6672t.wl%kuninori.morimoto.gx@renesas.com> Content-Type: text/plain; charset="US-ASCII" Date: Mon, 7 Dec 2015 07:43:09 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OS2PR01CA0010.jpnprd01.prod.outlook.com (25.161.74.148) To SIXPR06MB1024.apcprd06.prod.outlook.com (25.160.242.28) X-Microsoft-Exchange-Diagnostics: 1;SIXPR06MB1024;2:SwJb9Zal4a3ha0Fzj/Yu2T/kHN3uA/Oepqq5FRXUQJHUrvV2S/IRtO6tC9a/P4i8ZiNQ9H83qDpiU/Z1e3J8dyuiL22C585BSpReglAgWRDxxAj5eqnprSIxTyQzco7odhSfDtLZi3GGAv1s6AznsA==;3:3zaZ0o5VYiFTpOuAi2GABgVxP3YKTwcbfqnbLsQebO7H3Hnhx7Ei52dD+/ZdoHxlOA7sX6MDOwj9x3f4Su+3OhwL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UsLVEqbQuXMbsv3fbily2oTqgavbIs3185kqrD3oZcpjWUd+JKX6oFn+JTs4guiI8VFLLyGtIwGJCdI8gpBaapaq4GM1AIUU/wNqjIVKV+IQdmWMz+Mms4h/xxyWQyUXPsneN1zX0rtw2cIUH7DMhLmdZrgOdFWVIbcODDtcSUNt36T7BziZEu5o5305w6ppzlrgd0k3zPp3oiznSUxcRmgFwhjSXEf3aPcq/myCqtuiEhHfzMPgz+T3FGuyVjyo0Tr5Jvb+D214wupwrt4TbcPoPCwv+hDXpF6lMkiHrZche4sO8XErIx0J0 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:SIXPR06MB1024;BCL:0;PCL:0;RULEID:;SRVR:SIXPR06MB1024; X-Forefront-PRVS: 078310077C X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6009001)(199003)(189002)(1096002)(5004730100002)(83506001)(97736004)(5001770100001)(4001350100001)(19580405001)(6116002)(86362001)(19580395003)(50466002)(42186005)(50986999)(76176999)(69596002)(81156007)(101416001)(77096005)(53416004)(3846002)(5008740100001)(33646002)(46406003)(66066001)(40100003)(2950100001)(23726003)(47776003)(36756003)(106356001)(54356999)(5001960100002)(229853001)(586003)(87976001)(189998001)(105586002)(92566002)(122386002);DIR:OUT;SFP:1102;SCL:1;SRVR:SIXPR06MB1024;H:morimoto-PC.renesas.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;SIXPR06MB1024;23:b5p/FAq7iFodOHAiJn32am26+AWwJ/IoZ6HEXWOjx?= =?us-ascii?Q?mGCq1sUAGkHTJe+OyDJiAo2bpLuAiFXy5qxSHNBoD4N6HBJQSuJfaCbjpgnm?= =?us-ascii?Q?0fpLih7WetJy43cBnzXTU4E0Epw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ascii?Q?r+yszZlAAV6ppTrJr70x9TvdN5lYBJ/F9hO5fgfPk9acW1z4yNx7kxsKCw0n?= =?us-ascii?Q?CzQou7aioVXSmHdngkLIbIF9xFFQxbAPKN2qJHzCDHt5pxAhig7o8Hv/2ZmB?= =?us-ascii?Q?1uklE20tp8=3D?= X-Microsoft-Exchange-Diagnostics: 1;SIXPR06MB1024;5:SH+BbGqjJ/4rTs6duS8wW+SvWXEAXFveVq2xLJWbe/+PwurP/4ONmA0WOz0p63yMB4tiaLaaI2SlXC+wOIK9RcIOHE1KYe3lEaSo9HD9WkDRPZYvCpfoYgOtcaABTDeWJpjL+XPWUHf770r7sU8hBw==;24:AkVST67ruoStxroUnFC0cbDDl2IC5TgaEDv+H4I6O/KKHy08PcbVS/4/ePIQjLIppTAUG8cft9xbE1aRY2tTWd1NhAg/Wkn6DieWcz0ft/Y=;20:7chQFs3NqIzY3p1wN7d68PvmClwlq8L9cVy4wdp8uuw1rDWwoH4NEW2u1AZgJ0mansaSjyjgJfyk5Jvh3/zyMXKr2X0KS41aZv12ZdPTnCCGInQ5TKSLOT7O4M3ZIoOWvOFdrHeW/ZasYZK30V7dv3FEYLg3jEAdUUkpOq3wRRM= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2015 07:43:09.5206 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SIXPR06MB1024 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2031 Lines: 65 From: Kuninori Morimoto Signed-off-by: Kuninori Morimoto --- v2 -> v3 - no change 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, -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/