Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933156AbbLOBSG (ORCPT ); Mon, 14 Dec 2015 20:18:06 -0500 Received: from relmlor3.renesas.com ([210.160.252.173]:42410 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932994AbbLOBSB (ORCPT ); Mon, 14 Dec 2015 20:18:01 -0500 X-IronPort-AV: E=Sophos;i="5.20,429,1444662000"; d="scan'";a="201809412" Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; Message-ID: <878u4wqzq9.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 3/8 v5] 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: <87d1u8qzsy.wl%kuninori.morimoto.gx@renesas.com> References: <87d1u8qzsy.wl%kuninori.morimoto.gx@renesas.com> Content-Type: text/plain; charset="US-ASCII" Date: Tue, 15 Dec 2015 01:17:56 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: HKXPR02CA0057.apcprd02.prod.outlook.com (25.161.48.42) To SIXPR06MB1023.apcprd06.prod.outlook.com (25.160.240.28) X-Microsoft-Exchange-Diagnostics: 1;SIXPR06MB1023;2:c3PujABTjLlPn5K8+wSKo+5PXggr2bpSRz1nwRjG729+hfHWWxM2+Z5m0sSLHk4NeED+kzF6SC4kdjW/6WNE1OsPhWloYt36iao/9Lt+ioxaoW1aklobmVrvJ09PhY15AJhTLa3eATIskiN8Q+I4ug==;3:NFi9CrdfNkPrVTI8I6FfYbkOUv9pH0FxTwuIB86JwL/pY/x24an7tSRLsLzDZOajAggtgRDg9Sb2aDX3eK9VLgB1BjL7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kmArTgOLvcCQhkIyvWdUFsoS+wGv3AOJBB0cmiH29jOQimOjEUrO278lg+0Kw2WqTnhS1+1heOe8BU8Z1yySY0yxW5fArDHwGMTpkUuSkRhTZgVw4a0r27f1HOn12OVFl6yF50Kxi8rTaIsUX9/+d4VEdo22zfMvNDO1aN0ckQDsMzOxFCc14ol4wOww2FtYmzIYIl0wIRJ0hHBvm2/VaT1vHqxLcpJkNVbINyvRtPLbU1zukTJRK67q1P1u4KoWXikDHp3mdec1BVZflhGMvuOyV8mJfZ/AIYs2mBHvchoWO0W X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(85106069007906); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(8121501046)(520078)(5005006)(3002001)(10201501046);SRVR:SIXPR06MB1023;BCL:0;PCL:0;RULEID:;SRVR:SIXPR06MB1023; X-Forefront-PRVS: 07915F544A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6009001)(199003)(189002)(5001770100001)(66066001)(92566002)(54356999)(46406003)(5008740100001)(36756003)(87976001)(47776003)(586003)(1096002)(6116002)(122386002)(3846002)(40100003)(23726003)(50986999)(19580395003)(105586002)(69596002)(81156007)(50466002)(106356001)(53416004)(5001960100002)(189998001)(77096005)(229853001)(2950100001)(5004730100002)(19580405001)(83506001)(76176999)(4001350100001)(42186005)(86362001)(33646002)(97736004)(101416001);DIR:OUT;SFP:1102;SCL:1;SRVR:SIXPR06MB1023;H:morimoto-PC.renesas.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;SIXPR06MB1023;23:2POxNwS0go/Gpl1ejlG1eAS1UKk4cadxH8pGYJN+B?= =?us-ascii?Q?3FjpNmle3Klfd9ZxTWZbtCL0mw54zUgVQey8qMnrabvvo0oTN3est/TPxfEy?= =?us-ascii?Q?gn4fgGu3WRUiU9pGXL5yna5/jCZgMZi4m2qYE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N4+W/WUB0Yo+AOyNYvzwOaPe3MOe7eHZ8Ioc+WD9UW44NWgTW7?= =?us-ascii?Q?SYlF6H2zziwoApWLHhCRfUa2qaxx41Cxll3XjxLgLuvD4ojl9NnRotMmum/k?= =?us-ascii?Q?kQEbcukP/Q=3D?= X-Microsoft-Exchange-Diagnostics: 1;SIXPR06MB1023;5:rA2mFuAcumT1QwTIwaNp7CXWqhQ4KYStYNJOyngxyoUIy35EBMraG5I0mYwDqaFNAMzO5IN7cG28kdzv6xu+KYrOTCk2/Ki+BKgOkxYkrHBGi56dD9THZ1ds2AmLmf1cSplqYApENI9CCW3cemNKqw==;24:meMIHXK8cBmDbQPPa9hKC+AFGq8yjO+xLCxK+Oj59FJiMAgIODKlzLLCtSScq7AF/2iQWKqZd71lN7+XjhGMFypbuo4UhoO1mZ/ZP5k/rfw=;20:rLpKggJUtiBawbdJffCNkuFM09331d2mkHN5k8mQAE12W+kO2xQ7iyaLDwWvkgOVrerFdHoCaOltVGbEmKAqg0PC3vnKn9lERX35fhXjPsdQeLpkMPhZY+vc3S2cM52z2PGFmE3LT+t7rWUVu9jf/4N+oMT94uRRllC4GABEXvc= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Dec 2015 01:17:56.8869 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SIXPR06MB1023 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 --- v4 -> v5 - 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 0b19743..e9e4e39 100644 --- a/drivers/thermal/rcar_thermal.c +++ b/drivers/thermal/rcar_thermal.c @@ -290,6 +290,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); @@ -441,8 +444,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); @@ -488,8 +490,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/