Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp3961394rwe; Tue, 30 Aug 2022 01:53:33 -0700 (PDT) X-Google-Smtp-Source: AA6agR7yzChVWPfgBTw9HBt3bVLIjzgSwr7CAPcsJUrQ3aQh6YQabPuJsdlr90Zv8T1QbBeANsLA X-Received: by 2002:a17:907:160d:b0:741:a253:422f with SMTP id hb13-20020a170907160d00b00741a253422fmr3697655ejc.640.1661849613485; Tue, 30 Aug 2022 01:53:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661849613; cv=none; d=google.com; s=arc-20160816; b=ClwlY88LBmX+KH/g+lx70n4fO6hgjyylZtFsBpnZltRwsAkPU8nOsWfBgNd3/mE4/0 LN3eVimHwf0qpoq/6zk/v8hZN5kcvh45xa2++wJZorEMMJt0lW0xQ5PAEeVHOYafGaZQ c0MGNUeD8gDuRr9LXm6XU01UI9PkD8Uiy51MkXqsZ8fdZRELRhqKLnYNdhfhAknfBDx5 zy6vtBIcXFigxJgBcZG2Io6tBaEb8/WU/k/3VMiW1QsaA1rcJZ75uM/xt0CasrCeJ2pm uEd0+VACFo3YjRsiRxTtxT7S+YtKQwb645h0+pgLtZ/icEHrVCSTMPxE5hxmtF7FnUL5 saCQ== 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 :message-id:date:subject:cc:to:from; bh=qBR1BuSnhYebvl7NR17QSrfooYbYoonZ911GoZvhpNU=; b=EXuuS0TdamhFFz68S9ixmj6WWSRyWjQKdG6tRwrtBPDWx8/nyGNWG6aY24XFgnzAbW CW05Z9M1yOeD+itzItd3jBYYYGDzqv5QuVcm6GOEYBdzifys4YYM8vhW36deVJErEZIy Kh2I8PdNDo+l1/+lS5+0AC0a8DbpT37LFGs9oebm/V9fIdmcb5Rahfz7tYF+Qv7dLK+g 81xy9Ufqnfom1hlFzQEg2M8K7ePLHDExk5LeBKs/f8XAOzDuYT91XF/6T7pVCcs4LjfM vP/AC6yN8b/CrTkafGcaU0WmbWqijx70u6Q65d4nnb1+BN/CgSMruxojJEc5zNPwlMLt rDmw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t8-20020aa7db08000000b00447998c9b46si7443838eds.68.2022.08.30.01.53.05; Tue, 30 Aug 2022 01:53:33 -0700 (PDT) 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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229994AbiH3IKy (ORCPT + 99 others); Tue, 30 Aug 2022 04:10:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229585AbiH3IKw (ORCPT ); Tue, 30 Aug 2022 04:10:52 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F03D7392A; Tue, 30 Aug 2022 01:10:51 -0700 (PDT) Received: from canpemm500005.china.huawei.com (unknown [172.30.72.54]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4MH0M22wxWzHnYD; Tue, 30 Aug 2022 16:09:02 +0800 (CST) Received: from huawei.com (10.67.174.96) by canpemm500005.china.huawei.com (7.192.104.229) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 30 Aug 2022 16:10:48 +0800 From: Zhang Jianhua To: , , , CC: , , Subject: [PATCH -next v2] cpufreq: bmips-cpufreq: Use module_init and add module_exit Date: Tue, 30 Aug 2022 16:07:32 +0800 Message-ID: <20220830080732.3600988-1-chris.zjh@huawei.com> X-Mailer: git-send-email 2.31.0 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.67.174.96] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To canpemm500005.china.huawei.com (7.192.104.229) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 - Use module_init instead of device_initcall. - Add a function for module_exit to unregister driver. Signed-off-by: Zhang Jianhua --- v2: - add semicolon after module_exit to keep the format consistent --- drivers/cpufreq/bmips-cpufreq.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/bmips-cpufreq.c b/drivers/cpufreq/bmips-cpufreq.c index f7c23fa468f0..39221a9a187a 100644 --- a/drivers/cpufreq/bmips-cpufreq.c +++ b/drivers/cpufreq/bmips-cpufreq.c @@ -156,7 +156,7 @@ static struct cpufreq_driver bmips_cpufreq_driver = { .name = BMIPS_CPUFREQ_PREFIX, }; -static int __init bmips_cpufreq_probe(void) +static int __init bmips_cpufreq_driver_init(void) { struct cpufreq_compat *cc; struct device_node *np; @@ -176,7 +176,13 @@ static int __init bmips_cpufreq_probe(void) return cpufreq_register_driver(&bmips_cpufreq_driver); } -device_initcall(bmips_cpufreq_probe); +module_init(bmips_cpufreq_driver_init); + +static void __exit bmips_cpufreq_driver_exit(void) +{ + cpufreq_unregister_driver(&bmips_cpufreq_driver); +} +module_exit(bmips_cpufreq_driver_exit); MODULE_AUTHOR("Markus Mayer "); MODULE_DESCRIPTION("CPUfreq driver for Broadcom BMIPS SoCs"); -- 2.31.0