From patchwork Mon Sep 29 00:23:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 38055 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 07713202DB for ; Mon, 29 Sep 2014 00:25:49 +0000 (UTC) Received: by mail-la0-f71.google.com with SMTP id gi9sf4372365lab.6 for ; Sun, 28 Sep 2014 17:25:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type :content-transfer-encoding; bh=LUTnzZQejW+yidMumGTjb9zXXCV2XboT/TSXPQTJ2h8=; b=aSPg4MEYXjiDRxJA0/h8dRDxN7/FMWOGYtjJG4j3yCXQ3YLFTwMCNrFZrJsH4UeeWI 1J2yZmnmscgnZV/nxI2EvdxIlYW+0LyFnryqYGxR4T94fGVfBPv0aKp6qv2KGd7AC9lK 3aIntyJnyftxxOwaSKzFRHA2B62VLaoYsoQTxfoDrooUjWdEDdiYmkV/gNqLfehpHGyZ iVFYOAvC97Agc04hXg4cnhMiNuca2W+lu/36G1Q11K7Xddp5wOAbUTdDzTMRx8AC9CDD vFsPHRcd/y9bD3pNABaY7lEomApFrfceS84tTZJUFaHsTC77qoxqa2k4Ab/d1qepKb4B +I0A== X-Gm-Message-State: ALoCoQlubgCq7gsQMswQo4AR8YmOh5YBNdBKPRhountjy73usRfKnP8yNsx+K4p73dZya0uF3ryB X-Received: by 10.112.184.197 with SMTP id ew5mr5228007lbc.0.1411950348843; Sun, 28 Sep 2014 17:25:48 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.42.171 with SMTP id p11ls450036lal.68.gmail; Sun, 28 Sep 2014 17:25:48 -0700 (PDT) X-Received: by 10.112.158.170 with SMTP id wv10mr33717325lbb.66.1411950348122; Sun, 28 Sep 2014 17:25:48 -0700 (PDT) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com [209.85.217.170]) by mx.google.com with ESMTPS id iq2si15298154lac.77.2014.09.28.17.25.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 28 Sep 2014 17:25:48 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by mail-lb0-f170.google.com with SMTP id n15so5288948lbi.15 for ; Sun, 28 Sep 2014 17:25:48 -0700 (PDT) X-Received: by 10.152.198.204 with SMTP id je12mr36550262lac.52.1411950348017; Sun, 28 Sep 2014 17:25:48 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.130.169 with SMTP id of9csp98674lbb; Sun, 28 Sep 2014 17:25:47 -0700 (PDT) X-Received: by 10.68.132.164 with SMTP id ov4mr3985013pbb.99.1411950346563; Sun, 28 Sep 2014 17:25:46 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ud2si19999786pac.18.2014.09.28.17.25.45 for ; Sun, 28 Sep 2014 17:25:46 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754345AbaI2AYQ (ORCPT + 27 others); Sun, 28 Sep 2014 20:24:16 -0400 Received: from mail-we0-f179.google.com ([74.125.82.179]:57183 "EHLO mail-we0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753926AbaI2AX7 (ORCPT ); Sun, 28 Sep 2014 20:23:59 -0400 Received: by mail-we0-f179.google.com with SMTP id u56so4152548wes.38 for ; Sun, 28 Sep 2014 17:23:58 -0700 (PDT) X-Received: by 10.180.97.98 with SMTP id dz2mr43253103wib.26.1411950238676; Sun, 28 Sep 2014 17:23:58 -0700 (PDT) Received: from localhost.localdomain (AToulouse-656-1-925-235.w90-55.abo.wanadoo.fr. [90.55.46.235]) by mx.google.com with ESMTPSA id h5sm14014311wje.8.2014.09.28.17.23.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 28 Sep 2014 17:23:57 -0700 (PDT) From: Daniel Lezcano To: tglx@linutronix.de, mingo@kernel.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH 08/13] clocksource: tcb_clksrc: Sanitize IRQ request Date: Mon, 29 Sep 2014 02:23:41 +0200 Message-Id: <1411950226-21598-8-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1411950226-21598-1-git-send-email-daniel.lezcano@linaro.org> References: <5428A559.5050908@linaro.org> <1411950226-21598-1-git-send-email-daniel.lezcano@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: daniel.lezcano@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Gael Portay 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 Signed-off-by: Daniel Lezcano --- 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 a8d7ea1..c0b56ea 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);