From patchwork Mon Oct 23 09:58:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 10022293 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DE4ED601E8 for ; Mon, 23 Oct 2017 10:02:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF1432818A for ; Mon, 23 Oct 2017 10:02:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C203728824; Mon, 23 Oct 2017 10:02:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 555E12818A for ; Mon, 23 Oct 2017 10:02:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=EIELIFeDAwXbr0AeqYV3+FAwHR4/8hNJoU+ROGj47DA=; b=ldcp9LhDy8IHMFWr4eR8Acnl6t N05GB8HLgE2VrbJf83ndCPxvATfxVvEcu00lSlQ3UBr0xQ+mbowUxwjc/qI05yMus6JfqsQze6m5j faxZLTyU2kpbuL5tcjFW1WSKGwZISMj8yuuoYe0z+j/9SOy1+V80Eq590cN5/CvesFhura2sq9HTw xUMCyu+v82AsD6wnUBMGm2De9y99ILZzoGqtM8iGbOgq6CcAKtCBGTP3XLZAfIycRK4C7x3+Pk8Wc PesKJlr11NOLxrHI9Ie/tjKLGAbpY5gaKNaP9TTtPp/9HSwGnKyj8fymcGelzpCWM0wHj/N69YVpT dvfy9QCw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e6ZYm-0002CW-5A; Mon, 23 Oct 2017 10:02:16 +0000 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e6ZWb-0007fO-UD for linux-arm-kernel@lists.infradead.org; Mon, 23 Oct 2017 10:00:10 +0000 Received: by mail-wr0-x244.google.com with SMTP id w105so7388494wrc.0 for ; Mon, 23 Oct 2017 02:59:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=QHCzf9adhk7AuaHsf/ymE9R7gEgRKGYhfjgDQTNByDw=; b=Spe5xnSVx5J8gZHYBcNuX2jLD7iGW82jEritK9AGXdBViY+onTc8Z1AViicy17VgV6 sgowJRiSi/rs2+vffHLi/g6f6LqwRuYgUJODXTm1g1uUtkrPUFuqW4fxtH/EwwtH11ZZ xSo2XwQ1swQiqAgxqmB0ppqUvUkhaKTb2bgR0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=QHCzf9adhk7AuaHsf/ymE9R7gEgRKGYhfjgDQTNByDw=; b=m76mvAkg7ZKVGTCK8nXMasKLwteKDBINZVgU25z4hJgVkBPfrFf6Pc5xftHEes4Dds Vv8qjEUJvPgCV31iwqZF8Nd8flHimjp7Q6B4gRS6UFS+ODCny7SwraquRWFPhfHE5rS2 Aq5S/GZJI+uagr3Jpy41tk6uGEgBOY8UqVY03wpQot5HYsw7Dh692kv891+7uCLNjzeS bdn48sP2DqKv0GdDEIu9yw5It8mdZaqacp58ZFqxLukI4RGRHtzQIDDsXkTaXxJywHkP 4Rx6fCHpaseZmeKSUec8d8NRfOx5EciJua48ktMnPkwbD64sfDBIMJ54AnZ04FyHdRWb lzGQ== X-Gm-Message-State: AMCzsaXk/bdSWocgE3IU3tmdCuAN/f39rXMYYSu7B5enAWr5to1LCJo8 JyQyx1NhHz7hZFGQKss1yjp3vQ== X-Google-Smtp-Source: ABhQp+TyWNoviOcw78krslydlsrmvfoEinvkgGNrFaJI4EyMi2y32jwRYKv964w7r7QhzyEunh6fCg== X-Received: by 10.223.201.8 with SMTP id m8mr2761741wrh.260.1508752780114; Mon, 23 Oct 2017 02:59:40 -0700 (PDT) Received: from lmecxl0911.lme.st.com ([80.214.127.33]) by smtp.gmail.com with ESMTPSA id q188sm3626900wmb.43.2017.10.23.02.59.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 23 Oct 2017 02:59:39 -0700 (PDT) From: Benjamin Gaignard To: robh+dt@kernel.org, mark.rutland@arm.com, linux@armlinux.org.uk, mcoquelin.stm32@gmail.com, alexandre.torgue@st.com, daniel.lezcano@linaro.org, tglx@linutronix.de, ludovic.barre@st.com, julien.thierry@arm.com Subject: [PATCH v7 1/6] timer: add timer_of_exit function Date: Mon, 23 Oct 2017 11:58:37 +0200 Message-Id: <1508752722-4489-2-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1508752722-4489-1-git-send-email-benjamin.gaignard@linaro.org> References: <1508752722-4489-1-git-send-email-benjamin.gaignard@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171023_030002_290648_534640C1 X-CRM114-Status: GOOD ( 10.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Benjamin Gaignard , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add this exit function to be able to undo what have been done in timer_of_init(). Signed-off-by: Benjamin Gaignard --- drivers/clocksource/timer-of.c | 12 ++++++++++++ drivers/clocksource/timer-of.h | 3 +++ 2 files changed, 15 insertions(+) diff --git a/drivers/clocksource/timer-of.c b/drivers/clocksource/timer-of.c index c79122d..7c64a5c1 100644 --- a/drivers/clocksource/timer-of.c +++ b/drivers/clocksource/timer-of.c @@ -176,3 +176,15 @@ int __init timer_of_init(struct device_node *np, struct timer_of *to) timer_base_exit(&to->of_base); return ret; } + +void timer_of_exit(struct timer_of *to) +{ + if (to->flags & TIMER_OF_IRQ) + timer_irq_exit(&to->of_irq); + + if (to->flags & TIMER_OF_CLOCK) + timer_clk_exit(&to->of_clk); + + if (to->flags & TIMER_OF_BASE) + timer_base_exit(&to->of_base); +} diff --git a/drivers/clocksource/timer-of.h b/drivers/clocksource/timer-of.h index e0d7272..44f57e0 100644 --- a/drivers/clocksource/timer-of.h +++ b/drivers/clocksource/timer-of.h @@ -66,4 +66,7 @@ static inline unsigned long timer_of_period(struct timer_of *to) extern int __init timer_of_init(struct device_node *np, struct timer_of *to); + +extern void timer_of_exit(struct timer_of *to); + #endif