From patchwork Tue Feb 14 10:53:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?V2FsdGVyIENoYW5nICjlvLXntq3lk7Ip?= X-Patchwork-Id: 56862 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2899526wrn; Tue, 14 Feb 2023 03:02:00 -0800 (PST) X-Google-Smtp-Source: AK7set9A/ve1oJW7ZpyCZ1DYTdvP9wKSKitLttg0zgyFO3n+5105+/2B2XAtUE2ABXxjH2kzaP4I X-Received: by 2002:a17:902:c944:b0:196:191b:6b22 with SMTP id i4-20020a170902c94400b00196191b6b22mr2579835pla.59.1676372520475; Tue, 14 Feb 2023 03:02:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676372520; cv=none; d=google.com; s=arc-20160816; b=FSuXdgX4tVC1uSwbKIGui0YBg7hxA9T4jVpy8q2QzvrK5JG63ikqZeN9Uqkp8T6aSX 57Zg6umdgVWENTmzhgeR8477ZySyeX3D6D3YnyBSCI71THFYw3w4XPBK8PH9WADdMg92 TQ+9PoDUjoQ3136GC1CuYl+ItXB1WAmVaBPdV26hhXO5dgLURqqOR5hnqkx1/sReYi2o VdaTRas37zKrOfjx2omi/yCCb8fgDJHXOgOPpV5ii8bLqlwpeaCLJAVfmzy+o1ZZRGb7 kPy7BTMobLJZdC+kpzd9dZbZiNk/9Fyc9XfwFyAJy1Z7KJGUMxMaiDzJBmkBDPQIlpha Db5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=VDM/X9Rv4Dnk0OZyDBmi3fSTCK369lUNj0HJzi93FoY=; b=HlCN29ACnPhdbBpThG7w6SNH/m07ELhvjVTDTUGgq9zPX3HKnu9iF2wJSh5iz5SakV u6d+v5GQ5LB7J8DpxTjBYBSuSrslMPxrN/IrR0GVsiEBdQeOje7+a59SmLgagJgXPV++ v9eos9BmS27nFPAGdV4+Z2JihCAJ2ERQ+TEd8kAtatgL3AGhHX8NJSNjRoAkcZdjQBQt qmQZTq+45THdxf+mQ34lf56VKPnHy6mswDXZWbQgzRE7/Tdp3IbY8eM3EvcodXb213mS nbRRCKAgMEfSYevIXq7qEzB83RaYUemUqrG8CMejbF9yTiGzwvX7EhRIAhKlPchFxtmp HKmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=R8jNUMUi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e1-20020a170902b78100b0019a9d83f8d9si5550575pls.458.2023.02.14.03.01.48; Tue, 14 Feb 2023 03:02:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=R8jNUMUi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232382AbjBNK6c (ORCPT + 99 others); Tue, 14 Feb 2023 05:58:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229508AbjBNK6a (ORCPT ); Tue, 14 Feb 2023 05:58:30 -0500 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8645E22789 for ; Tue, 14 Feb 2023 02:58:28 -0800 (PST) X-UUID: 798a1e64ac5611ed945fc101203acc17-20230214 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=VDM/X9Rv4Dnk0OZyDBmi3fSTCK369lUNj0HJzi93FoY=; b=R8jNUMUirQEa5FpHn+sxhkUMBEHkni8O+0vPtmBbo7oateGQW05d4oU3r4WhaTOxFYg1OHil2j3eF8zD7ipLXY619I2kIWQ0B1Op8pS1KFzqZ49pLk9AWB2lmSvLLBo22flHkl82CzGDPj/xA5ECvCnNLIIBWRtuzvFMSFsu5eg=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.19,REQID:05c2e37e-409b-406a-9784-cb33fc571f03,IP:0,U RL:0,TC:0,Content:-5,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:90 X-CID-INFO: VERSION:1.1.19,REQID:05c2e37e-409b-406a-9784-cb33fc571f03,IP:0,URL :0,TC:0,Content:-5,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Spam_GS981B3D,ACTIO N:quarantine,TS:90 X-CID-META: VersionHash:885ddb2,CLOUDID:cd218925-564d-42d9-9875-7c868ee415ec,B ulkID:230214185814PHV5GKMY,BulkQuantity:0,Recheck:0,SF:38|29|28|17|19|48,T C:nil,Content:0,EDM:-3,IP:nil,URL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 ,OSI:0,OSA:0,AV:0 X-CID-BVR: 0,NGT X-UUID: 798a1e64ac5611ed945fc101203acc17-20230214 Received: from mtkmbs13n1.mediatek.inc [(172.21.101.193)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 2048553882; Tue, 14 Feb 2023 18:58:12 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.3; Tue, 14 Feb 2023 18:58:11 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Tue, 14 Feb 2023 18:58:11 +0800 From: To: Daniel Lezcano , Thomas Gleixner , Matthias Brugger , AngeloGioacchino Del Regno , "Maciej W . Rozycki" , John Stultz , "Krzysztof Kozlowski" CC: , , , , Chun-Hung Wu , , , Subject: [PATCH v2 3/4] clocksource/drivers/timer-of: Remove __init markings Date: Tue, 14 Feb 2023 18:53:13 +0800 Message-ID: <20230214105412.5856-4-walter.chang@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230214105412.5856-1-walter.chang@mediatek.com> References: <20230214105412.5856-1-walter.chang@mediatek.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,RDNS_NONE, SPF_HELO_PASS,SPF_PASS,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757803992084341783?= X-GMAIL-MSGID: =?utf-8?q?1757803992084341783?= From: Chun-Hung Wu Remove __init markings to allow timer drivers can be compiled as modules. Signed-off-by: Chun-Hung Wu --- drivers/clocksource/timer-of.c | 23 ++++++++++++----------- drivers/clocksource/timer-of.h | 6 +++--- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/drivers/clocksource/timer-of.c b/drivers/clocksource/timer-of.c index c3f54d9912be..59bc5921acad 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,8 +47,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 = container_of(of_irq, struct timer_of, of_irq); @@ -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,8 +107,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; @@ -146,13 +146,13 @@ 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, - 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 = of_base->name ? of_io_request_and_map(np, of_base->index, 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..5d1472846346 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, - struct timer_of *to); +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