From patchwork Sun Oct 29 21:20:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 117426 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp1854116qgn; Sun, 29 Oct 2017 14:25:20 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QrDlUuMufWpMWqEj7Kr2Zho2Gc99rKKe2ymCtaAkK/+FEdsFGZyfYJjdw9slcppHUAz3qu X-Received: by 10.98.217.2 with SMTP id s2mr6741426pfg.298.1509312320792; Sun, 29 Oct 2017 14:25:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509312320; cv=none; d=google.com; s=arc-20160816; b=EmYOgRtzyCpgconylGzVcMdzHorDwlrGDCPpR0HOq9cmi26TmBOgKLGaNDX8bgo6vJ FWeHGVxWQ0d8gb4pnVm4s0Ez0Yiigt06rmVbO2I/lLenK3vH18ZEUL0cCsKseOMzWO3B Oc/qfjsoPNBC+Gd2UCEgO9UlMZtI4rd7m70PLiAHziyWlWdPVXx9NtSYHH2eYwMTd4qR Db8v6DkA6hJNvS/BWS8IJGhlEwGb9pldEkbiIdgpXPlpztLxUlWLycZn+Kg26g6waueN jQWQ6sgO0MM9pd4jIfgiLRlb7LDo+dJMwAYjYRFaX7iAilWKMR+v/NiWN7wzlAjA8ddT dQSw== 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=hYdPsu97qH6V+e4dz9c/3xKmmJE4+9WCmAKlWKNZGvI=; b=b+nckezNz1Crdni8JjVgsX/p3Hndp+IimUxUsFghvCFQfXZXMMUY3y+qUNpGiqsxv8 uQyBSmdJElTJ4EQr4l4ZsO+lv9zOHyLg6KyNtIZOeA6o0BsMYzNAJQPKi7CtZxM1a8lR Tgw0Tq78BhUWCPe/uu7z6bs/MRaUDiUGqGzyagCDL/oed5dzVfYAUm6AifdouP7VBPAY KUs2rULfZhV2MCKzfqVJvjGAjaItRb6JDbcS56SvJIJNw72SZp+RWdC/VocAnUVxnTrz Tv7pjuFPotl2qPRtVRX0FEf8fwo9/db4vUuC+a7rBI+7SUOSbG44D/ZDLKdJMxfmoIA5 TBEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RFBYrCl0; 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 x136si8512975pgx.750.2017.10.29.14.25.20; Sun, 29 Oct 2017 14:25:20 -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=RFBYrCl0; 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 S932415AbdJ2VZT (ORCPT + 27 others); Sun, 29 Oct 2017 17:25:19 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:47074 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932381AbdJ2VZB (ORCPT ); Sun, 29 Oct 2017 17:25:01 -0400 Received: by mail-wr0-f194.google.com with SMTP id l1so10718226wrc.3 for ; Sun, 29 Oct 2017 14:25:01 -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=hYdPsu97qH6V+e4dz9c/3xKmmJE4+9WCmAKlWKNZGvI=; b=RFBYrCl00Y/XYZCFgrnUijp7BTRu0ooYHkrOoRR3j4AQ57xD4D0LBzeP0vqd+KXgiT gR8abilanQDlu4+JddrTaMlcaWs0cIstWEc2rPc+FIKACT8hqfsQQuwSdFSXOBtbXG9S uxKY99y86d4nNe9CBtSxicdTTH55L7zclSb2g= 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=hYdPsu97qH6V+e4dz9c/3xKmmJE4+9WCmAKlWKNZGvI=; b=KK4t2QTqQc+OdzVT0I4Vcad4TuH/FR7gCQj2gOmVNlEP0iO0SuAjWTBnzdfnUAiwlC 1dwJIld2s0Ac/FnJt8gfzM9i1o1L5R+z44zaKvn+nyznfgmfWq8c9airpVgiNKER3nh1 KIyRnfswmJn5eHaTHrDjfTOZODJbR7C9HmFi0s/gd9U7w6TLELxrfjP8btBbmZErxr+G MyTvuv0TKYOPfLcXjrkm4WxeCaCSpSz73XFvHaJM1Q1iOd44+pGWEh31fcNGkhbBvbSC qVnW8GAZkW7c0BCfb3p1U7kupgyRHhwc9mMlCuRNNAUhc/sriqaBAg+K693IgmxxXd0c ggiA== X-Gm-Message-State: AMCzsaVQSyA/ILSE7Gic1dgLtwpWV5emVtgtjWHFpZJ6Hm2UqMmTOOv9 mz4GgHf5iw3aqFvZyGcLN3zm3mT5ZOk= X-Received: by 10.223.197.141 with SMTP id m13mr6111920wrg.203.1509312300335; Sun, 29 Oct 2017 14:25:00 -0700 (PDT) Received: from localhost.localdomain ([2a01:e35:879a:6cd0:2c92:b7e6:9f71:ab86]) by smtp.gmail.com with ESMTPSA id z20sm10067264wrz.62.2017.10.29.14.24.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 29 Oct 2017 14:24:59 -0700 (PDT) From: Daniel Lezcano To: tglx@linutronix.de, daniel.lezcano@linaro.org Cc: linux-kernel@vger.kernel.org, Benjamin Gaignard Subject: [PATCH 17/17] clocksource/drivers/timer-of: Add timer_of_exit function Date: Sun, 29 Oct 2017 22:20:34 +0100 Message-Id: <1509312035-17368-17-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1509312035-17368-1-git-send-email-daniel.lezcano@linaro.org> References: <1509312035-17368-1-git-send-email-daniel.lezcano@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Benjamin Gaignard The timer-of API does not provide a function to undo what has been done by the timer_of_init() function. Add a timer_of_exit() function. Signed-off-by: Benjamin Gaignard Signed-off-by: Daniel Lezcano --- 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