From nobody Thu Apr 2 17:10:00 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7ABD33FFAB8 for ; Fri, 27 Mar 2026 17:56:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774634165; cv=none; b=pATbGKHrgktPhFlx7o5mQbjq0N5V2E2OFYnOp036zCVg/xp78DPfJGEZiDcIhJPN5zfXQL30e24eux1/dKJM1Htz9+tbJu1Mv1KlxSzkkKMqP3Qi238QuyOfnfmqnEOsx5YTYt+w6gzSDk1Zn38cmPxjwGTAU5UTUmf++hSxi9U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774634165; c=relaxed/simple; bh=Z2BA3YqAghsU/JejqCzKkjwpMzA7NGZMhKsDjlTJIog=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AgWBvmDm6D2U57MSW+tiMOkJj6ghwWCWW4sCCHDZtFf++KHKw49vgE34gwXPv4v559nHxK/LQT0sP1OvsN81XpOdOWE697eTefpshM+KPQ/xzDypaaPvdon3xc5Vyz1hAjDNsnR63WJwImy8tT4tsFwdpafMzUnR4oFPQA6cXIA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Gxi8gXhl; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Gxi8gXhl" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BDAFFC2BCB0; Fri, 27 Mar 2026 17:56:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1774634165; bh=Z2BA3YqAghsU/JejqCzKkjwpMzA7NGZMhKsDjlTJIog=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Gxi8gXhlolXeMflMMlGQ2L3CT/hC44QFjy3SSMD4IHVkt3CFrkBNeO+9UuyfkhtBh EG9E0OS2ro6TZEmD0QaL1cSZ5bsUMQKOkqqGpn2id7n9yIklRRAn5ojZvStt2INGUk 8Zv+vHQ3C0pI2JzLsT0N1j4HquLu6hCNWh8AvqkEnK+H0uib40zNJnadKm2WrvXSoL 6RMmEffHWO/wLaUlqZrsE+VW5RB6e6tYSgbPkx6ZlS+d2Un9GxwCndmI7jwh39yv1y vX9vwfA0psCgXd40RZxQi44FdNa11vgQUKapFzdE74X0zkmfVu2sX9b2A7T51XPOqG jaMiODd54vOLA== From: Daniel Lezcano To: daniel.lezcano@kernel.org, tglx@kernel.org, zhipeng.wang_1@nxp.com Cc: shawnguo@kernel.org, jstultz@google.com, linux-kernel@vger.kernel.org Subject: [PATCH v1 4/7] clocksource/drivers/timer-of: Make the code compatible with modules Date: Fri, 27 Mar 2026 18:55:27 +0100 Message-ID: <20260327175533.3044-7-daniel.lezcano@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260327175533.3044-1-daniel.lezcano@kernel.org> References: <20260327175533.3044-1-daniel.lezcano@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Signed-off-by: Daniel Lezcano --- drivers/clocksource/timer-of.c | 24 +++++++++++++----------- drivers/clocksource/timer-of.h | 5 ++--- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/drivers/clocksource/timer-of.c b/drivers/clocksource/timer-of.c index 420202bf76e4..ba63433211b0 100644 --- a/drivers/clocksource/timer-of.c +++ b/drivers/clocksource/timer-of.c @@ -19,7 +19,7 @@ * * Free the irq resource */ -static __init void timer_of_irq_exit(struct of_timer_irq *of_irq) +static void timer_of_irq_exit(struct of_timer_irq *of_irq) { struct timer_of *to =3D container_of(of_irq, struct timer_of, of_irq); =20 @@ -41,8 +41,8 @@ static __init void timer_of_irq_exit(struct of_timer_irq = *of_irq) * * Returns 0 on success, < 0 otherwise */ -static __init int timer_of_irq_init(struct device_node *np, - struct of_timer_irq *of_irq) +static int timer_of_irq_init(struct device_node *np, + struct of_timer_irq *of_irq) { int ret; struct timer_of *to =3D container_of(of_irq, struct timer_of, of_irq); @@ -82,7 +82,7 @@ static __init int timer_of_irq_init(struct device_node *n= p, * * Disables and releases the refcount on the clk */ -static __init void timer_of_clk_exit(struct of_timer_clk *of_clk) +static void timer_of_clk_exit(struct of_timer_clk *of_clk) { of_clk->rate =3D 0; clk_disable_unprepare(of_clk->clk); @@ -98,8 +98,8 @@ static __init void timer_of_clk_exit(struct of_timer_clk = *of_clk) * * Returns 0 on success, < 0 otherwise */ -static __init int timer_of_clk_init(struct device_node *np, - struct of_timer_clk *of_clk) +static int timer_of_clk_init(struct device_node *np, + struct of_timer_clk *of_clk) { int ret; =20 @@ -137,13 +137,13 @@ static __init int timer_of_clk_init(struct device_nod= e *np, goto out; } =20 -static __init void timer_of_base_exit(struct of_timer_base *of_base) +static void timer_of_base_exit(struct of_timer_base *of_base) { iounmap(of_base->base); } =20 -static __init int timer_of_base_init(struct device_node *np, - struct of_timer_base *of_base) +static int timer_of_base_init(struct device_node *np, + struct of_timer_base *of_base) { of_base->base =3D of_base->name ? of_io_request_and_map(np, of_base->index, of_base->name) : @@ -156,7 +156,7 @@ static __init int timer_of_base_init(struct device_node= *np, return 0; } =20 -int __init timer_of_init(struct device_node *np, struct timer_of *to) +int timer_of_init(struct device_node *np, struct timer_of *to) { int ret =3D -EINVAL; int flags =3D 0; @@ -200,6 +200,7 @@ int __init timer_of_init(struct device_node *np, struct= timer_of *to) timer_of_base_exit(&to->of_base); return ret; } +EXPORT_SYMBOL_GPL(timer_of_init); =20 /** * timer_of_cleanup - release timer_of resources @@ -208,7 +209,7 @@ int __init timer_of_init(struct device_node *np, struct= timer_of *to) * Release the resources that has been used in timer_of_init(). * This function should be called in init error cases */ -void __init timer_of_cleanup(struct timer_of *to) +void timer_of_cleanup(struct timer_of *to) { if (to->flags & TIMER_OF_IRQ) timer_of_irq_exit(&to->of_irq); @@ -219,3 +220,4 @@ void __init timer_of_cleanup(struct timer_of *to) if (to->flags & TIMER_OF_BASE) timer_of_base_exit(&to->of_base); } +EXPORT_SYMBOL_GPL(timer_of_cleanup); diff --git a/drivers/clocksource/timer-of.h b/drivers/clocksource/timer-of.h index 01a2c6b7db06..74a632b85b47 100644 --- a/drivers/clocksource/timer-of.h +++ b/drivers/clocksource/timer-of.h @@ -65,9 +65,8 @@ static inline unsigned long timer_of_period(struct timer_= of *to) return to->of_clk.period; } =20 -extern int __init timer_of_init(struct device_node *np, - struct timer_of *to); +int timer_of_init(struct device_node *np, struct timer_of *to); =20 -extern void __init timer_of_cleanup(struct timer_of *to); +void timer_of_cleanup(struct timer_of *to); =20 #endif --=20 2.43.0