From patchwork Fri Dec 4 08:32:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 7766031 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 B2E8A9F7B5 for ; Fri, 4 Dec 2015 08:33:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E01AF204A0 for ; Fri, 4 Dec 2015 08:33:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D7102204E0 for ; Fri, 4 Dec 2015 08:33:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755333AbbLDIdH (ORCPT ); Fri, 4 Dec 2015 03:33:07 -0500 Received: from relmlor4.renesas.com ([210.160.252.174]:56677 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755275AbbLDIdC (ORCPT ); Fri, 4 Dec 2015 03:33:02 -0500 Received: from unknown (HELO relmlir2.idc.renesas.com) ([10.200.68.152]) by relmlie3.idc.renesas.com with ESMTP; 04 Dec 2015 17:33:00 +0900 Received: from relmlac1.idc.renesas.com (relmlac1.idc.renesas.com [10.200.69.21]) by relmlir2.idc.renesas.com (Postfix) with ESMTP id CCFC762CFA; Fri, 4 Dec 2015 17:33:00 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id BE0198002E; Fri, 4 Dec 2015 17:33:00 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id B583A8002D; Fri, 4 Dec 2015 17:33:00 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac1.idc.renesas.com with ESMTP id TAB03530; Fri, 4 Dec 2015 17:33:00 +0900 X-IronPort-AV: E=Sophos;i="5.20,380,1444662000"; d="scan'";a="199892136" Received: from mail-pu1apc01lp0024.outbound.protection.outlook.com (HELO APC01-PU1-obe.outbound.protection.outlook.com) ([65.55.88.24]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 04 Dec 2015 17:32:59 +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 SG2PR06MB1017.apcprd06.prod.outlook.com (10.161.9.25) with Microsoft SMTP Server (TLS) id 15.1.337.19; Fri, 4 Dec 2015 08:32:57 +0000 Message-ID: <87d1umfwf6.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 3/8 v2] thermal: rcar: check irq possibility in rcar_thermal_irq_xxx() User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Simon , Zhang Rui , Eduardo Valentin CC: Magnus , , , In-Reply-To: <87h9jyfwj7.wl%kuninori.morimoto.gx@renesas.com> References: <87h9jyfwj7.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Fri, 4 Dec 2015 08:32:57 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: KAWPR01CA0004.jpnprd01.prod.outlook.com (25.161.24.14) To SG2PR06MB1017.apcprd06.prod.outlook.com (25.161.9.25) X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB1017; 2:OMUwJcMKRm3WKBpUq6m6XTEmozE7hmZRZLZ4oUkUIo/cb4C+5CZCemKikNlRCp8QVfymSNO5dzdiltk7mahz5trwQSOquKFiMZu8vmr8tNNxsnuymY/1L2IcQ0/pMlwHm4KBOR0lcCpzMIy5ERWnWw==; 3:KG+dBHbamypoUouBTycprT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U09CDOzi0k6mDqkpAZFbrrbTAnsQmKel9pUnZoRrxKgYHJwQ0ENWBbP3L6E/VBex1wlBalmjMEwFgLXoVX6YJYZcKH8DVe/XeJ174/bENHpKXuEUAT1f87zdH+Pr6vIsjF71qkukKMW12objz9w5Picr2PhNkqpXYGeb2gcXYxxCICiOd4ds/c/9RavoE5SdacGImzvcOoOMtgb+7wvGbuX/7o7B2J7/McnWRVh3SIqxPTxHBWWH/BjNUdqHJBVqFZ7W65saxRV7FGLtMB2I54sSpCxju4FrFPuXUQUPC2XOm8Jve35RnuKjhoOgkC5xZ2yD3rDPDqCUR m4ANSM22aQUdN95GM4RvwT4A/i 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)(8121501046)(5005006)(10201501046)(3002001); SRVR:SG2PR06MB1017; BCL:0; PCL:0; RULEID:; SRVR:SG2PR06MB1017; X-Forefront-PRVS: 07807C55DC X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(199003)(189002)(1096002)(189998001)(3846002)(101416001)(23726003)(36756003)(97736004)(2950100001)(586003)(81156007)(5001960100002)(6116002)(77096005)(92566002)(5004730100002)(5008740100001)(42186005)(50466002)(69596002)(50986999)(106356001)(53416004)(122386002)(40100003)(54356999)(66066001)(19580395003)(229853001)(47776003)(19580405001)(76176999)(87976001)(105586002)(46406003)(86362001)(5001770100001)(33646002)(83506001)(4001350100001); DIR:OUT; SFP:1102; SCL:1; SRVR:SG2PR06MB1017; H:morimoto-PC.renesas.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SG2PR06MB1017; 23:zmE0AZr2V29yPXjZr8u5DKQolVB1KghD8KOPJGe8s?= =?us-ascii?Q?chCjfYZFm2J5TaGz23fqTcOIpr0bAqNxTLTa6Arc5aN1HQgBymJmw0O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+u4Ld0+mLaX1KtDGiFwL8jAiBtkk72uZUDK8?= =?us-ascii?Q?Dxbc261XrFqWvMuCyt77+O6+TBYozGlQKO6Uw9m37z32ImXw/ZnnFBgVwgC0?= =?us-ascii?Q?NkrrHoqktuYQHW5Bb/bPp6qE+HR5OpD1MT0hgbhcVAKoqQ21Wu5zpZB0GycK?= =?us-ascii?Q?0TtLI7gYWo=3D?= X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB1017; 5:ZObig+MwxNdSaEr53u1yMwat3MChZ7ObkanH92a+0hi4yWnoixocOrwNKsoz9qTYbKrv5V98DrmyV6N+hjg/b8383bOOKycnPzH9iyKAVPRX46Y6drnBt1SAUMnDx7mUrodQ9XKG1dQkKVn6/jbNWw==; 24:8TGByNFqeemVpXyd0kSguqr1RRBmdxTR0neDjX3uoB0KnNQ7j6M9EP4icqWeTYhHFC3QOxBI0V/oHtzRCJkwBv69+Tnw9Ao/l+XnlaspNvU=; 20:62pnncFqg3jt9DRs/I9OmWrfz6SH9hefr/bc03t6OTdx6i60/fqN7GEgwhCFnu29+u5+DH4t4QdmMBHyUi4bJvF57FtlIlSWkMdQDEj4lHDWoNq1A42aOW7SzfI3I8iMRtOo864tpybuvwnce6oIuDskZxJjLUUJtPRjGIzb/As= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Dec 2015 08:32:57.5374 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB1017 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 --- v1 -> v2 - new patch 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);