From patchwork Wed Oct 18 12:58:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 10014647 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 BC9A060215 for ; Wed, 18 Oct 2017 12:59:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A838A282EC for ; Wed, 18 Oct 2017 12:59:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9B7F3283CB; Wed, 18 Oct 2017 12:59:28 +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 31CBF282EC for ; Wed, 18 Oct 2017 12:59:28 +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=dnF6RTMxkPx9LNk+OOxFMI+B8RT/cmiJJ7DqiyM4xlI=; b=Lae3gilaYajIqvWUSI4ET8N+EA i1wQ6ad2sDIszHjj9RLujYY9aH+Qfa2ePM/YRsbdMKS8AfOpI0s0x+IJ2HqIVdO15j0yOvpYvl5tr 1nI+IG4Ir5c42klbbZY+75A/PfMZOuJzh+9xahadKOz5Jsyo/BjlQTe+cIQ8jZS4U+Lz8qC2GQmbd UYbV1nacfXLxbNLNjiHtYmnYyYYiMhu3b7Qw19tFFJnxXZTky9wWfz9fm7rM2BctMgls/iiShyUTD rZRPzU9KMIhxUIHn5TtkYFw5VD9w2f1rqOU79wKI+qroVyT2NUNw3eil3Ij1s5403i8Ov53EWSZCS 6a9MIPrw==; 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 1e4nwU-0005pK-18; Wed, 18 Oct 2017 12:59:26 +0000 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e4nw2-0005S2-6u for linux-arm-kernel@lists.infradead.org; Wed, 18 Oct 2017 12:59:00 +0000 Received: by mail-wr0-x243.google.com with SMTP id u5so4930247wrc.5 for ; Wed, 18 Oct 2017 05:58:37 -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=od9nt3TZLoey7ZnzBpSvV/zjEzuYhIahtFPf0ZLNM/8=; b=Yk2fLTl8DVe7AQTsHJyPvTGaHtEdmCz99T1LdfCU+68FtnLQ8yBbdtX58gf+gEqCkN 9QWPSrNr55MbeVV9afnT2P21QIW5YzfBZ6awNEqnJiVtppKIxxTzqJXy89oJ8pUAzcXd EMXhBI/jzMlWlAm46H2WkpYIVModf7Tt8VD9c= 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=od9nt3TZLoey7ZnzBpSvV/zjEzuYhIahtFPf0ZLNM/8=; b=IV4W1O5LVY4+F36yh95MkRFmuGF55klyuPzpPzXONz0705kwYH+Jlycv2ztO3wW7nt jBz5VMrbItTLzM1w8X6OJaJQvYS3qbGRw4GO/9QkbJmijmMrfReZIxRSaY8LAK/yAR/u qN0fOMqquHyzJEzlyQA0VF5/b2j0U4JR2BJqZ6M3Vo3aAGDNIBTRD8DtlJ2JtvpWHYTF xz36vsPmyGR4baQpE7Xx5j5DGTbpoOVsCzHBGOAyWPFspb1gXkhovtOzdx9sDqX3cce/ wITf/E4S8uSb5SmnC8xQ7DqYl4Kqc7BftR45F/wTk2Zfu44yNqO2pXg1xojaN4DK3568 AcJg== X-Gm-Message-State: AMCzsaXzkB3kjI/JlXCPNz2biV3Z65hZ6ImKEAOH0fX2gtbvypht7OcF iS7nBtS+aCPwpyNCVKQhh3oalQ== X-Google-Smtp-Source: ABhQp+QnLD7eofUJmN1KBhpctrkMnQefYodERPwfuUHtwNjkXlKes/nAwc7A/SUxedDvpSuJ7t4oJA== X-Received: by 10.223.128.3 with SMTP id 3mr6275553wrk.196.1508331516459; Wed, 18 Oct 2017 05:58:36 -0700 (PDT) Received: from lmecxl0911.lme.st.com ([80.215.70.168]) by smtp.gmail.com with ESMTPSA id m23sm14169908wrm.75.2017.10.18.05.58.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Oct 2017 05:58:35 -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 v6 1/5] timer: add timer_of_deinit function Date: Wed, 18 Oct 2017 14:58:22 +0200 Message-Id: <1508331506-23782-2-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1508331506-23782-1-git-send-email-benjamin.gaignard@linaro.org> References: <1508331506-23782-1-git-send-email-benjamin.gaignard@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171018_055858_428963_90AD6F91 X-CRM114-Status: GOOD ( 10.10 ) 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 deinit 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..14404a0 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_deinit(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..3833ab1 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_deinit(struct timer_of *to); + #endif