Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932936AbbLHF2G (ORCPT ); Tue, 8 Dec 2015 00:28:06 -0500 Received: from relmlor2.renesas.com ([210.160.252.172]:51186 "EHLO relmlie1.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751517AbbLHF2C (ORCPT ); Tue, 8 Dec 2015 00:28:02 -0500 X-IronPort-AV: E=Sophos;i="5.20,398,1444662000"; d="scan'";a="200082780" Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; Message-ID: <87r3ix5x6y.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 3/8 v4] thermal: rcar: check irq possibility in rcar_thermal_irq_xxx() 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:56 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OS1PR01CA0024.jpnprd01.prod.outlook.com (25.161.225.162) To HKXPR06MB1015.apcprd06.prod.outlook.com (25.161.180.156) X-Microsoft-Exchange-Diagnostics: 1;HKXPR06MB1015;2:+2gylb9JbN/R7GZMoFYlzx5xYUIrczuiyrlM0SUX6vG1sPpN7/VSTxnSEuO1rdlYvRMiCoZ+nle7vdIEf4MdIgbO0y6BuW7wtlF2CbADkTdXg16wnH3vffY4oOnYvglY53wFSaE9MrHTJl7ussl+kQ==;3:WtDoyi9+zDdVvhSSITQurCn5ECVCX2FRrtPyZXQjJZ7V3sPu84YU7fWBvK+KMyoW0tUuvq3F6bTrmV+caFZcF93UF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1xUOAAm0UVhRjMIWCjs/rp+Du1ZNa4jOFvTrwPDD11lqdtalMrtpVQwRV8qR1iglzLrEBwi8R4sG2H7uqvU6iiQZZgNZsHClZPfyUqkEy+53sTEVgHzmXg8+mjKqr29I5rM3VWMXUVVMog4iI/z+gQiaPkyDN4bjJ2SOHfos32I22F/Ve7joQHmMQ/4Mp0n/LsrTrOgMbBEu9habm64MZmExVeHn9YMXnTQPpUscvqhk/YNfG+Wsp5FHd5dMOUk9myUdv8H/PDnBGeE= 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:HKXPR06MB1015;BCL:0;PCL:0;RULEID:;SRVR:HKXPR06MB1015; X-Forefront-PRVS: 0784C803FD X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6009001)(189002)(199003)(229853001)(5004730100002)(101416001)(40100003)(54356999)(122386002)(69596002)(33646002)(47776003)(19580395003)(46406003)(50466002)(66066001)(5008740100001)(76176999)(86362001)(1096002)(23726003)(106356001)(586003)(3846002)(105586002)(4001350100001)(92566002)(87976001)(53416004)(19580405001)(50986999)(42186005)(6116002)(83506001)(189998001)(5001770100001)(77096005)(97736004)(2950100001)(36756003)(5001960100002)(81156007);DIR:OUT;SFP:1102;SCL:1;SRVR:HKXPR06MB1015;H:morimoto-PC.renesas.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;HKXPR06MB1015;23:71QxqMLzuGgvCseoydBRrA5bl3HEwxhvw6KO8ZEjR?= =?us-ascii?Q?ha+5gfCS2aBgKbAVBBN2BJz2mWfRNusvCijK65V2QF2Mnec57/jSKjVNIecb?= =?us-ascii?Q?z4E0q9OK61/GCVxfp8FdNteTSinDcckstEfgqg6Mh8TAn8tUOTALrcubuhwF?= =?us-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lu25GRrkUXGkO?= =?us-ascii?Q?JCUwo0M4iXvk5eYUbppAheXQfjz4GB3PnUzH9KJK9wh7t3wFGIgYclH32fuo?= =?us-ascii?Q?zTOOQtuMsY=3D?= X-Microsoft-Exchange-Diagnostics: 1;HKXPR06MB1015;5:NAPQjaUFTun/ybC1BUcXv7qG377g25XokqLcsX6yYm4XydNZtzYFi3fIK+ewlH4F7FbFA9xWcH2L2woYwznj2t53AmdtERVio11v12S5Bpf4S3GdgXrKpGT7aUhD6qH+wned2uwWwyVMoMaxQf/tGw==;24:hGOpMU76UyBPKkVZCVn/lbBn0tQferWZN5gWdMmTcAP7IeGbiPLZGnAS33sgFwEAyqfvqCywXvWAiooQ1Eyp6kwp7oJxAUACLcQaRqo1Ivs=;20:PO82OUnwa36V+UD/Fel2aQrmW4vE1uCaMtHL2nem67yZ5BKImiUZfvWJOIiFEDMNsxDmJDbfEJnqmUfk9FYP/T4Umu3iSAfOHJ22HMSNs1j6sjImkeXoPvSdhMX2jMv88G4K2+kknwyreldgaY1GFCqqIQqGPzEx3r3M1Z/j0No= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Dec 2015 05:27:56.6017 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HKXPR06MB1015 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1830 Lines: 57 From: Kuninori Morimoto Current rcar thermal driver sometimes checks irq possibility when it calls rcar_thermal_irq_enable/disable(), but sometimes not. This patch checks it inside rcar_thermal_irq_enable/disable(). Signed-off-by: Kuninori Morimoto --- v3 -> v4 - no change drivers/thermal/rcar_thermal.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c index a1a93f3..67b5216 100644 --- a/drivers/thermal/rcar_thermal.c +++ b/drivers/thermal/rcar_thermal.c @@ -298,6 +298,9 @@ static void _rcar_thermal_irq_ctrl(struct rcar_thermal_priv *priv, int enable) unsigned long flags; u32 mask = 0x3 << rcar_id_to_shift(priv); /* enable Rising/Falling */ + if (!rcar_has_irq_support(priv)) + return; + spin_lock_irqsave(&common->lock, flags); rcar_thermal_common_bset(common, INTMSK, mask, enable ? 0 : mask); @@ -449,8 +452,7 @@ static int rcar_thermal_probe(struct platform_device *pdev) goto error_unregister; } - if (rcar_has_irq_support(priv)) - rcar_thermal_irq_enable(priv); + rcar_thermal_irq_enable(priv); list_move_tail(&priv->list, &common->head); @@ -496,8 +498,7 @@ static int rcar_thermal_remove(struct platform_device *pdev) struct rcar_thermal_priv *priv; rcar_thermal_for_each_priv(priv, common) { - if (rcar_has_irq_support(priv)) - rcar_thermal_irq_disable(priv); + rcar_thermal_irq_disable(priv); thermal_zone_device_unregister(priv->zone); } -- 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/