Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1463718pxb; Sun, 12 Sep 2021 20:29:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+Pg6hb6XvXz5+dyjzXyr2xtd2kIlQmXYBzI1H4aOhCz60yNswnjYeUa2cILgVZRhRi7o8 X-Received: by 2002:a05:6e02:148c:: with SMTP id n12mr6657677ilk.36.1631503797090; Sun, 12 Sep 2021 20:29:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631503797; cv=none; d=google.com; s=arc-20160816; b=NDs1MRaQaDTpt0aX0gZSUMBJunZuwXGwCfMQOpNMvtrglAwDErkgCgcaPYgnPG4VBZ TuLlf1cKwr/YWOfcjM30e58oFa/hKzMXlC3yhYB3AoYeA9tWL7GumNVpc53Dayf04Qeb 0wrJIPfTbMkf5GNtaLVGub+QLVAd8USi+Kf3/XnOJPq15lMi9acbunpEF+2DsU4pytX7 oZS3JHA+DloJttG8ZteS5yUKEpTR0Ftht22H0Q5/brkXuKYZPFU6AP/pMpSqHgeyk5Oo JnfefcKzKrbBWgWorXFpysZT2DJDnSciUkHqwx+qxmZWP0sj18BRrTRn3Ha/FKpkTOeM T0yA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=iViKe5K3OqUUSjVw078CMVuYB4UJnlNbs8QNGz+R2bk=; b=fbxULSGY/ATJPA/cVoSx4TtHIpu3dpNMTeC+q2K+9AONE95a7xLGWgGqLORyogYp3l h5R/AGtiYMnEzjxiWOZHzV+qjImwTu3jBkvXI5GroWA8DUl+Ny7/v9Ym1dlB+lWNLOkC GLohs5Lf1clsXtP9hiA8Icq1k1Gk4ew7lZ+Q3drv8qlcemmYW/enIl+/TqqXpJz3A7JX UY11VeJicynnIhvdTU0wc42sOIeXBe7r1HQXrtVUAsxzTWHkGMqflhdTyicYbXMcrcqS bGgiH446WQyDiE3kDzmBWDFdn4ri9YnuRF4H+vJD5i9fwZie/vsJB33b8+OQC9604Noh fuDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=QuvrONoc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e2si5599427jaa.68.2021.09.12.20.29.45; Sun, 12 Sep 2021 20:29:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=QuvrONoc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238533AbhIMDaO (ORCPT + 99 others); Sun, 12 Sep 2021 23:30:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238149AbhIMDaM (ORCPT ); Sun, 12 Sep 2021 23:30:12 -0400 Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0649C061574 for ; Sun, 12 Sep 2021 20:28:57 -0700 (PDT) Received: by mail-pg1-x532.google.com with SMTP id g184so8098661pgc.6 for ; Sun, 12 Sep 2021 20:28:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iViKe5K3OqUUSjVw078CMVuYB4UJnlNbs8QNGz+R2bk=; b=QuvrONocgrdG2UW5id/w9e+Zg+OK6huNOHJCs5CQO8CBcP0vNlFWRGMOvhG535fUYw bEapnFXia2rdEQ/C9Kkhj0V0ktPKm5xbFIjD5F1M947KkfDbjSFU4iuwIiaC6WtC4bdw xeryu0CN2Fb9fnnmDB1rUJCAjSZM6GAa0K1ZVNEFBSjaGzpEkeXBh+k0rk1+VPfGnOsm Kxv0XrSQOakLGjq9cU9c/gScE1E8Fcqm0Xmrxowfm5wktenTjjzr8zThEAhR/sA0+zfM mvhSII69GupQsYh9+4a9fJ4L2K6eNE6OUHQsFFV5Wfvir/jKsAZhbsgqMqTDONRfGOB3 1nUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iViKe5K3OqUUSjVw078CMVuYB4UJnlNbs8QNGz+R2bk=; b=MAeGUlM1DqH9SNS1pjaIu8qnqO1E8c4Q0g6nL60GlL4ajyUI7bJLn0VNAM/kvuygo7 OI8atdz+jD6UXdxWWUELhO+VsOV/bcDi07bXTU67zUuZQeE4Fytl/BNWCCkhu3COgetr fu/y2Y5ZqRv2bYAeowF2IAzUx3I78ROog94gLE5poYjU42J9YuSODTMmhGX9hGsanrSS ITbMpGsl4IdoBURoDDfO0UREO4OeLwsX6dAPIL9Sec6HC00dHHvbNZOLtSb48xk/yE57 1XwqLO50JoIVCe+U0W7QkdvdLMmWV/Zz99Icpzv150KB8WU5JEnXBf6IjVXTzVIZdTkq eUhQ== X-Gm-Message-State: AOAM531xfboTaQ4YgIb5N2M5T9dWUKVrFppErueyYr/q9ZgUycAHN/Qm J3AgbHSdqughAd2DVPI12uo= X-Received: by 2002:aa7:99de:0:b0:43c:92ed:305b with SMTP id v30-20020aa799de000000b0043c92ed305bmr5048177pfi.86.1631503737211; Sun, 12 Sep 2021 20:28:57 -0700 (PDT) Received: from ubt.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id m12sm665109pjv.29.2021.09.12.20.28.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Sep 2021 20:28:56 -0700 (PDT) From: Chunyan Zhang To: Daniel Lezcano , Thomas Gleixner Cc: Saravana Kannan , Baolin Wang , Orson Zhai , Chunyan Zhang , Chunyan Zhang , LKML Subject: [RESEND PATCH v3 1/3] drivers/clocksource/timer-of: Remove __init markings Date: Mon, 13 Sep 2021 11:28:32 +0800 Message-Id: <20210913032834.147237-2-zhang.lyra@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210913032834.147237-1-zhang.lyra@gmail.com> References: <20210913032834.147237-1-zhang.lyra@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Saravana Kannan This allows timer drivers to be compiled as modules which can be a platform-level devices, so the timer_of_init()/_cleanup() should able to be called from platform_driver_register() which support deferred probing. Signed-off-by: Saravana Kannan Signed-off-by: Chunyan Zhang --- drivers/clocksource/timer-of.c | 17 +++++++++-------- drivers/clocksource/timer-of.h | 4 ++-- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/clocksource/timer-of.c b/drivers/clocksource/timer-of.c index 529cc6a51cdb..7f108978fd51 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 = container_of(of_irq, struct timer_of, of_irq); @@ -47,7 +47,7 @@ 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, +static int timer_of_irq_init(struct device_node *np, struct of_timer_irq *of_irq) { int ret; @@ -91,7 +91,7 @@ static __init int timer_of_irq_init(struct device_node *np, * * 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 = 0; clk_disable_unprepare(of_clk->clk); @@ -107,7 +107,7 @@ 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, +static int timer_of_clk_init(struct device_node *np, struct of_timer_clk *of_clk) { int ret; @@ -146,12 +146,12 @@ static __init int timer_of_clk_init(struct device_node *np, goto out; } -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); } -static __init int timer_of_base_init(struct device_node *np, +static int timer_of_base_init(struct device_node *np, struct of_timer_base *of_base) { of_base->base = of_base->name ? @@ -165,7 +165,7 @@ static __init int timer_of_base_init(struct device_node *np, return 0; } -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 = -EINVAL; int flags = 0; @@ -209,6 +209,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); /** * timer_of_cleanup - release timer_of resources @@ -217,7 +218,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); diff --git a/drivers/clocksource/timer-of.h b/drivers/clocksource/timer-of.h index a5478f3e8589..1b8cfac5900a 100644 --- a/drivers/clocksource/timer-of.h +++ b/drivers/clocksource/timer-of.h @@ -66,9 +66,9 @@ static inline unsigned long timer_of_period(struct timer_of *to) return to->of_clk.period; } -extern int __init timer_of_init(struct device_node *np, +extern int timer_of_init(struct device_node *np, struct timer_of *to); -extern void __init timer_of_cleanup(struct timer_of *to); +extern void timer_of_cleanup(struct timer_of *to); #endif -- 2.25.1