From patchwork Mon Dec 7 07:43:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 7781181 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 C84FD9F350 for ; Mon, 7 Dec 2015 07:43:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F12D520380 for ; Mon, 7 Dec 2015 07:43:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0743E20376 for ; Mon, 7 Dec 2015 07:43:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753220AbbLGHni (ORCPT ); Mon, 7 Dec 2015 02:43:38 -0500 Received: from relmlor4.renesas.com ([210.160.252.174]:55507 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753282AbbLGHnf (ORCPT ); Mon, 7 Dec 2015 02:43:35 -0500 Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie3.idc.renesas.com with ESMTP; 07 Dec 2015 16:43:32 +0900 Received: from relmlac2.idc.renesas.com (relmlac2.idc.renesas.com [10.200.69.22]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id D6B434C89C; Mon, 7 Dec 2015 16:43:32 +0900 (JST) Received: by relmlac2.idc.renesas.com (Postfix, from userid 0) id C2A352806E; Mon, 7 Dec 2015 16:43:32 +0900 (JST) Received: from relmlac2.idc.renesas.com (localhost [127.0.0.1]) by relmlac2.idc.renesas.com (Postfix) with ESMTP id B98D12806D; Mon, 7 Dec 2015 16:43:32 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac2.idc.renesas.com with ESMTP id SAN19866; Mon, 7 Dec 2015 16:43:32 +0900 X-IronPort-AV: E=Sophos;i="5.20,393,1444662000"; d="scan'";a="200013655" Received: from mail-sg2apc01lp0245.outbound.protection.outlook.com (HELO APC01-SG2-obe.outbound.protection.outlook.com) ([65.55.88.245]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 07 Dec 2015 16:43:31 +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 HKXPR06MB1016.apcprd06.prod.outlook.com (10.161.181.156) with Microsoft SMTP Server (TLS) id 15.1.337.19; Mon, 7 Dec 2015 07:43:28 +0000 Message-ID: <87twnu670f.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 3/8 v3] 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 , 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> Date: Mon, 7 Dec 2015 07:43:28 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OS2PR01CA0018.jpnprd01.prod.outlook.com (25.161.74.156) To HKXPR06MB1016.apcprd06.prod.outlook.com (25.161.181.156) X-Microsoft-Exchange-Diagnostics: 1; HKXPR06MB1016; 2:ZWfs2lHRVc3Ik9U+3+Q9NgK6bjYN6iwMTdD2479NQ7XlkFImxyIGookLhQV0q9/MQEWwO3kScLT+DENqnC53vuI2tda07tGMjhF8cG3gLKU+8i9Tr8qy0M0bp8NQ44Z7pFs6h3nohRIUN5NqklMBIw==; 3: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EpaKviO7Z0/yLZVU08yW1KFuaSkJk4bLY+sadUv2Zdg/S/87jHTsSOj8HkGSBV2sKYlEV9xFsj/vbjBqPlejFYqt35+I/PgFi5c8QqgHOp5E/bXzUkxUCUEv1K8Zj7vHFkApD4dEDrmyUqvq1OUlCmxxtFAwbXULGnlukdih1/UlL1MV3waqmv7Ua4DdYrz0jqHQ8sVt0IOFGyJAhtvKkMF6y5NTvCdMuL1wtU8ZDHbZ18F/wlFn8tS+E7BYC9PfbA3nQjs231v7InozOvWXOL5ctvdhHXplboOgNC8+/1KBJ+rDk5M7spF0Vk74ygRGjxuioNU7S5n5RPdU6q1yC24H2iQUgNe9oHnLdPz6vxmmYyCZa1 mprrxAyXXTyZ9CXAo/VkiNVpCX 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:HKXPR06MB1016; BCL:0; PCL:0; RULEID:; SRVR:HKXPR06MB1016; X-Forefront-PRVS: 078310077C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(199003)(189002)(586003)(86362001)(6116002)(105586002)(42186005)(69596002)(3846002)(5004730100002)(5008740100001)(19580395003)(23726003)(53416004)(40100003)(106356001)(1096002)(19580405001)(92566002)(122386002)(33646002)(76176999)(97736004)(81156007)(36756003)(77096005)(50986999)(4001350100001)(5001770100001)(46406003)(229853001)(189998001)(54356999)(5001960100002)(87976001)(47776003)(2950100001)(101416001)(83506001)(50466002)(66066001); DIR:OUT; SFP:1102; SCL:1; SRVR:HKXPR06MB1016; H:morimoto-PC.renesas.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HKXPR06MB1016; 23:86o3i8uAyuPQLVRjO+RpsJ06SrTVvaqBWnt79aWvb?= =?us-ascii?Q?91B6H4UZ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?us-ascii?Q?ApUCk0lRPrMohQXVBum1ghyxAgQFe8N5b9rh66PbIO5loP52Tddrg9xF8T2D?= =?us-ascii?Q?ex2xgaq+knfF8uBP4gJLuURIPlLfGLy+eoARiPhTJg1dLWeOpVuRmh5rnKro?= =?us-ascii?Q?Em144GIH8y53F2uasiSG6X8/hCNXks4PR8q1QjvO36tjXtDiTYXCUQZEwgnT?= =?us-ascii?Q?QKBK/hQDaU=3D?= X-Microsoft-Exchange-Diagnostics: 1; HKXPR06MB1016; 5:BP2s9FZwfrvzNYK+iKlH4EJdUKFC8htpIXWMb84WKs7RLtKJmVKralrePu5GVaXgJjKllX259evgk+Pj6cu8oOBcwUXTnGlejqOuyJ2E/2TSEc7og1ldWxUSmICftIajApmCpmhSWfyDOJ6R7Hkssg==; 24:zt2T3ioe8riE3jAq9ZUed16mG2CnqLjAOvXqMdx4VmYXkPLqha87TARrw52chvrKkkrpt1Z8TCQRShfoJLbv9vWohA7wsbSW6PbUMrb0xH8=; 20:5VpTLnHtay0huDAStp2tipFB+Xsc836/3WxOljT9D17rehBIFI5KVE8GoB1pxO2yxUCNPC/BivJl8EuH9ti79UIFsVJMs6SqGOIozwFynNijhT7bZ8nbv4RrN50Azdc5SPGQMOywTfBkK9x/XXSBrAa/oOs/9G5HO7EREZGb3oc= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2015 07:43:28.9795 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HKXPR06MB1016 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 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 --- v2 -> v3 - 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 4d1bc2b..aaedf37 100644 --- a/drivers/thermal/rcar_thermal.c +++ b/drivers/thermal/rcar_thermal.c @@ -297,6 +297,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); @@ -381,8 +384,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); } @@ -468,8 +470,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);