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: 116291 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp6034896qgn; Wed, 18 Oct 2017 05:58:47 -0700 (PDT) X-Received: by 10.99.52.194 with SMTP id b185mr13546337pga.170.1508331527237; Wed, 18 Oct 2017 05:58:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508331527; cv=none; d=google.com; s=arc-20160816; b=GOO21dfH1ei1z9eIt+mHRLhRCvpuq4pG+inqA+ka/wG9jYro4gtr5PbW/pw/5nnbbt +HraZqCI1iIYMfPHNuFX2N1ydSvczRED/3vaqOfKb/OjIxOmsGvn7+RC+iPyPqWmS+rO VR5AhTb6bRCB2YV7F6mUlLGEI1skrzKBPG39LQaKA+BfxqtQ+UgHwHmQA4qdPM6RFVWA Qm2MCEn8A2V4lA4JCrSPuvIst/v695JNCx53nkj/Rig7tRKDxnacACz4WfNIRtmRxeft tLrru7XqvUfC9TMltgj0ai/3zbK+kLOWhG/OhGos6Tx5yeKVryMRvGe/3GfMG6x6B+0x B1XA== 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=od9nt3TZLoey7ZnzBpSvV/zjEzuYhIahtFPf0ZLNM/8=; b=Woi9SIrJpGc2ApPfeMrpiO9tjlwYTnOssx3hLnc3HZ0Sx4uBr6pekJq80h6cbEL/M7 YsVEEbhlGVkzASMcbgR8fsaMM0Sh31H6Una6AJ9SvYaSlFTkxCCIFIBuiGhM9T38ISUz FPaOjPeQzMGy9N/VhMpv0cZwJC8dVr0OzYhkCsGiYOKpCBtONHmTB8I48mFVR8+UOgOc zCJXS7bsaBtRb8pHx9aH1mHP6dm70LGDw0xw+kk8vm6CzN7YNYUtCo56wu16hZ+4VIF1 4T6WdMLZC2IHWtqlDJDB0DbfB2b9gJzK5geIBU3M30ODvoKOkEzwd9IBNRwncSzxMqlg klpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Yk2fLTl8; 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 n1si6914790pge.830.2017.10.18.05.58.46; Wed, 18 Oct 2017 05:58:47 -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=Yk2fLTl8; 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 S1752409AbdJRM6l (ORCPT + 27 others); Wed, 18 Oct 2017 08:58:41 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:48002 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752347AbdJRM6h (ORCPT ); Wed, 18 Oct 2017 08:58:37 -0400 Received: by mail-wr0-f195.google.com with SMTP id y39so4934848wrd.4 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=bHjBNP9lQYoGekFISR/DsepGu4aZ8HLzKNp/H+x3dnAvrFlGEoqTp4RXHMHydTqLyi 4SWP1SQFm++AN2WYmjtePaWnVgcjUrrpjCxV4P4mHkXzLOfwyJfnh/ldn6vhdZtqik3M UzqgXrl5SmeOnuz92zM3alb1LP02ZqbKZ6YrNOP5hKatRNRdG9vz56JJnw3jsMlxslyr itBlb1bUD/FVVC9slCgvKOUlLKHiBWXu0v1h5hjswGM5zy24+II0vsnySpO8cC6hkK8e UpaOPMQVXgO1O/3vdCLPg61RZYNgoM3HT3NIW3i0TKDacQoqz4QjJv3JGPtvFWH4/jQL YJbw== X-Gm-Message-State: AMCzsaXQG7Ey+JSFyN4SfyeiSf5RRkKdkzehDMmBdVpyxlCk+084WqeL suxasHUe9Tqv/AVqF9fhHE6X6w== 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 Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Benjamin Gaignard 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(+) -- 2.7.4 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