From patchwork Fri Aug 29 16:16:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ga=C3=ABl_PORTAY?= X-Patchwork-Id: 4811741 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 42DC69F37E for ; Fri, 29 Aug 2014 16:23:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 592B820117 for ; Fri, 29 Aug 2014 16:23:10 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 48A092010E for ; Fri, 29 Aug 2014 16:23:09 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XNOvL-0005Za-O2; Fri, 29 Aug 2014 16:21:15 +0000 Received: from 6.mo69.mail-out.ovh.net ([46.105.50.107] helo=mo69.mail-out.ovh.net) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XNOvJ-0005MN-Mv for linux-arm-kernel@lists.infradead.org; Fri, 29 Aug 2014 16:21:14 +0000 Received: from mail619.ha.ovh.net (gw6.ovh.net [213.251.189.206]) by mo69.mail-out.ovh.net (Postfix) with SMTP id BF144FFC0A0 for ; Fri, 29 Aug 2014 18:20:51 +0200 (CEST) Received: from b0.ovh.net (HELO queueout) (213.186.33.50) by b0.ovh.net with SMTP; 29 Aug 2014 18:20:51 +0200 Received: from 19-157-190-109.dsl.ovh.fr (HELO localhost.localdomain) (g.portay@overkiz.com@109.190.157.19) by ns0.ovh.net with SMTP; 29 Aug 2014 18:20:50 +0200 From: =?UTF-8?q?Ga=C3=ABl=20PORTAY?= To: Arnd Bergmann , Daniel Lezcano , Greg Kroah-Hartman , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pwm@vger.kernel.org, Nicolas Ferre , Thomas Gleixner , Thierry Reding , Boris Brezillon , Alexandre Belloni , Jean-Christophe PLAGNIOL-VILLARD Subject: [PATCHv2 4/4] clocksource: tcb_clksrc: unprepare clock in case of failure Date: Fri, 29 Aug 2014 18:16:43 +0200 Message-Id: <1409329003-17252-5-git-send-email-g.portay@overkiz.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1409329003-17252-1-git-send-email-g.portay@overkiz.com> References: <1409329003-17252-1-git-send-email-g.portay@overkiz.com> MIME-Version: 1.0 X-Ovh-Tracer-Id: 12121719872784624392 X-Ovh-Remote: 109.190.157.19 (19-157-190-109.dsl.ovh.fr) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-OVH-SPAMSTATE: OK X-OVH-SPAMSCORE: -100 X-OVH-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeejgedrtdeiucdltddurdefjeefrddttddmucetufdoteggodetrfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-Spam-Check: DONE|U 0.5/N X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeejgedrtdeiucdltddurdefjeefrddttddmucetufdoteggodetrfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140829_092113_894928_E2C68426 X-CRM114-Status: GOOD ( 13.94 ) X-Spam-Score: -0.1 (/) Cc: =?utf-8?q?Ga=C3=ABl=20PORTAY?= X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, 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 The clock is not unprepared in case of the request IRQ fails. Also update to request_irq. Signed-off-by: Gaƫl PORTAY Acked-by: Daniel Lezcano Acked-by: Boris Brezillon --- drivers/clocksource/tcb_clksrc.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/clocksource/tcb_clksrc.c b/drivers/clocksource/tcb_clksrc.c index f922e81..8bdbc45 100644 --- a/drivers/clocksource/tcb_clksrc.c +++ b/drivers/clocksource/tcb_clksrc.c @@ -178,12 +178,6 @@ static irqreturn_t ch2_irq(int irq, void *handle) return IRQ_NONE; } -static struct irqaction tc_irqaction = { - .name = "tc_clkevt", - .flags = IRQF_TIMER, - .handler = ch2_irq, -}; - static int __init setup_clkevents(struct atmel_tc *tc, int clk32k_divisor_idx) { int ret; @@ -198,15 +192,16 @@ static int __init setup_clkevents(struct atmel_tc *tc, int clk32k_divisor_idx) clkevt.regs = tc->regs; clkevt.clk = t2_clk; - tc_irqaction.dev_id = &clkevt; timer_clock = clk32k_divisor_idx; clkevt.clkevt.cpumask = cpumask_of(0); - ret = setup_irq(irq, &tc_irqaction); - if (ret) + ret = request_irq(irq, ch2_irq, IRQF_TIMER, "tc_clkevt", &clkevt); + if (ret) { + clk_disable_unprepare(t2_clk); return ret; + } clockevents_config_and_register(&clkevt.clkevt, 32768, 1, 0xffff);