Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp57777rwe; Fri, 26 Aug 2022 00:06:11 -0700 (PDT) X-Google-Smtp-Source: AA6agR4SINCcb9d65PfRLcJOLtoIoGDxRR2hj47rkERFOj2anmPXwLJQGVbGYs9wdYJcD408Blbw X-Received: by 2002:a17:906:7944:b0:73c:838:ac3d with SMTP id l4-20020a170906794400b0073c0838ac3dmr4561323ejo.242.1661497571643; Fri, 26 Aug 2022 00:06:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661497571; cv=none; d=google.com; s=arc-20160816; b=F8YTBoENpHh3/Bi01Brh2f9E0tpDhBMyCAdFa4rl0Q1zKuamxWIvUpUQaxAMsua9Qo Ili1a7jGzpsTBoXdbABUJFevGOGvAAPxJWYa4Y8cLkTo0wTSuGQMkyrFJD0YDcV33Tqo N/pVOc/WvUVlhKbpoxxtUaML8s47Az/PwvbtKJsldYO5BqqYqM9LDUeqV1v2LVxKZYE/ 2QdaSb5zzvWLF74sRo72DTpM87VVZ1sKtl8xQFDJunqYoFmmSNhAoYX/gXbmiEbHnRNf /Eawgz3TftmCOcseGFOZQ13dGC9HgA4UMrKEDphvVv0f56W2dJuUBeITLfe61W4/cmtd flfA== 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=9DtXL38IWg8gikkBK6DAQJQ1d+EG73q+obc+zTB/Nts=; b=k4EDJO5/A9CEEO/ih2LRVGKw6FIsKPiJ6TZQqb9tgnyS4uY9fe4+A2YuudTOSnEQ+/ qZhgnyVY9AHgbBxV8cAg1ua/GfWBdaNQz49Jgdb1VRaGb9nuPbScKwoT25WJtlcb6Yyz D2u2xHYQRQwEnPCv1FWran2Z2XajT6OPcGCweDx2HiGlfwGWi5leyrdABQqwMn8wr4Fh 192pwAAM0GYrZpn8mDLMMm2izVFEM8ztlMFoUIM1KTFGC8FICARpFwVky0D6ZO93U6qs DtCeUNikpfICeHvyKJZbl+Hitzg/RYhxTNNHI4kyzVthoQ0MGe88InLMFEV0E0vhrIGx 2woQ== 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 sc27-20020a1709078a1b00b007308ab90efbsi944402ejc.776.2022.08.26.00.05.45; Fri, 26 Aug 2022 00:06:11 -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 S245093AbiHZHDe (ORCPT + 99 others); Fri, 26 Aug 2022 03:03:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244686AbiHZHDb (ORCPT ); Fri, 26 Aug 2022 03:03:31 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8000BC6CFA; Fri, 26 Aug 2022 00:03:30 -0700 (PDT) Received: from canpemm500005.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MDW176H5mzkWNx; Fri, 26 Aug 2022 14:59:55 +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; Fri, 26 Aug 2022 15:03:28 +0800 From: Zhang Jianhua To: , CC: , , Subject: [PATCH] rtc: fsl-ftm-alarm: Use module_init and add module_exit Date: Fri, 26 Aug 2022 15:00:17 +0800 Message-ID: <20220826070017.2340617-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 --- drivers/rtc/rtc-fsl-ftm-alarm.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/rtc/rtc-fsl-ftm-alarm.c b/drivers/rtc/rtc-fsl-ftm-alarm.c index c0df49fb978c..28bdc6c97b64 100644 --- a/drivers/rtc/rtc-fsl-ftm-alarm.c +++ b/drivers/rtc/rtc-fsl-ftm-alarm.c @@ -332,7 +332,13 @@ static int __init ftm_alarm_init(void) return platform_driver_register(&ftm_rtc_driver); } -device_initcall(ftm_alarm_init); +static void __exit ftm_alarm_exit(void) +{ + platform_driver_unregister(&ftm_rtc_driver); +} + +module_init(ftm_alarm_init) +module_exit(ftm_alarm_exit) MODULE_DESCRIPTION("NXP/Freescale FlexTimer alarm driver"); MODULE_AUTHOR("Biwen Li "); -- 2.31.0