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: 116662 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4451780qgn; Mon, 23 Oct 2017 02:59:48 -0700 (PDT) X-Received: by 10.98.20.80 with SMTP id 77mr12749936pfu.307.1508752788524; Mon, 23 Oct 2017 02:59:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508752788; cv=none; d=google.com; s=arc-20160816; b=CeaGhEagKx1Br6KfO4dyXes1D16qD5N7hlQfbPpybeZjhJBLxBe4tq6CWw3WhN+nQO GozsnUvjGkF9KquxzmW7d0hzQL6EnIJzivs0yTi0BpXGlHT0E10pxk2ILHWpjBMbizmV 7WjQXzsnREbp1mmo/jzfeljq+mJQGgd4IHL4SiJsBxWvvpGA5FUeI52Z4ga5LPyoAmbK PMGO5q8FME/47vv/j601tpc2RPl7tMC7XKZsHME4hVc8xQc4Ty47JtX+8+4Oesn3K0Pq aHu94zC6sMWz0yA1fBN46dzZCXEG/TW8PyVX81Y0oJcu87HGh7ddyiXuhxTk/w8SV0d+ h9ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=QHCzf9adhk7AuaHsf/ymE9R7gEgRKGYhfjgDQTNByDw=; b=fXDU+tE6zVY2FEEyvEZwWJxL+CKYN//+qZ0scSCj76mXMKl5uDXhoecV9ohgO3L0WA KvCwZwfi+/4IMhD+UhFH9lD7nSv4V310W6pJOObC7mNDbeWMDoztZFbo6VGCq2sGAhj+ 6+DDBB8jG+jzNF3Gu3a5ntrTfPPwJXsd+z6qO+z+jRz8SoiN4xVxMOayMbKaXcq7CLn9 o+CnBFhogyGCDM1njAex6VFfmaom7hQ8BgLQHr2dSgS//tZN71td5ZP/z5MH1reKkrGw Chwz8N8aJK4w6kUl6dBNZ/u8MqcEVd7yqTTr9BNwlDe3ex271LONgY2L9z2c8dJuoBXM a0Iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Spe5xnSV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b89si5088218pfd.354.2017.10.23.02.59.48; Mon, 23 Oct 2017 02:59:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Spe5xnSV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751395AbdJWJ7o (ORCPT + 27 others); Mon, 23 Oct 2017 05:59:44 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:49714 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751282AbdJWJ7l (ORCPT ); Mon, 23 Oct 2017 05:59:41 -0400 Received: by mail-wr0-f193.google.com with SMTP id g90so16698211wrd.6 for ; Mon, 23 Oct 2017 02:59:40 -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=QqZ0zdJYaEJ1z5O2GK60bSELlTDit87lI5V0i+tikx7qD/N8J8qAC+uZwQAu86NgfQ sNAObYmlLfnMpfW2jyafIGHlu7sA9bA+m/z3Rc61E+/RhNqReplLQmveqAE1ATecryWx E6NfjoImYb1TD9f5MSiGKzit3spLc8za/l+DFvPTGguZ4SwphPz6J5Ys+ckQSzOrGaak lkptINqy0bsrLLa8SCkmofGSj1D6gJAsE4jXTY8rPsj0evoz7/h5qfy4cNep95AjlKYt 0UrDNJOHtoQccTWElLR3zoV0WdYDmlxUTxTzhREvMnumf78oufVi43N0AIhiHiiMQrQt Ytmw== X-Gm-Message-State: AMCzsaUipW+5DRrB6rvqo+uPDhszZn3nKqYy8IHrHeclAelHE2PGQjZP +62GxaxvXBJXaudbiYdzU5chWw== 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 Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Benjamin Gaignard 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(+) -- 2.7.4 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