Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932906AbbLHF1j (ORCPT ); Tue, 8 Dec 2015 00:27:39 -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 X-IronPort-AV: E=Sophos;i="5.20,397,1444662000"; d="scan'";a="201319594" Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; 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> Content-Type: text/plain; charset="US-ASCII" 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==;3:H3YF80EfpSsP+G50cLO+6u7T46L7On2FvZ3zMfB/yARRksyGeA92nZVIriCbz2lYChJG8LkQVSC5xmEpUUKr31vNiajpNZs6fleYz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gbgQJfO4woFT7tCkIQWXl4gNojqK20qgLAIF9wmCMezWlP8WH71ccLwfK2En4tD3+EBXhM9CcR9gaQ2+3N+9iddWl2WWgENLo5dR66eoa4CxbdVE2cKY3Kz0wVPU6AaUeCOGUBj/4WUqJrWhqemaBth/uE6D0aaICaUwEeJ+pAWk/4MCTdFa67maIc794aW6DcftcBTqO4vBn8CjxMdw0po6SEUs/oQcNUh9Fyk5JXygxN4rOUdD6ZPhcAVFSHtN9M4Cr4Gq8j8qzqdMUfFw/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-ascii?Q?P10T9Cu5lJXWtE5N5OSwV0dJKtfOcLZ6RJ5WrzVf40C+cnV1MOd57lFNS2c8?= =?us-ascii?Q?F9ziDhlbMZ3Of9LLzpchDz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ZH7PDG2pEiTl4GomxbJInJSHmNJuRNWwfd10RpnpLhwUMbo9mrkXq?= =?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-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2057 Lines: 66 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, -- 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/