]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
tpm/tpm_tis_synquacer: Use module_platform_driver macro to simplify the code
authorLi Zetao <lizetao1@huawei.com>
Tue, 15 Aug 2023 08:06:37 +0000 (16:06 +0800)
committerJarkko Sakkinen <jarkko@kernel.org>
Thu, 17 Aug 2023 20:12:41 +0000 (20:12 +0000)
Use the module_platform_driver macro to simplify the code, which is the
same as declaring with module_init() and module_exit().

Signed-off-by: Li Zetao <lizetao1@huawei.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
drivers/char/tpm/tpm_tis_synquacer.c

index 49278746b0e2f97a9b8af1331dc0530ab2a95db5..f7d5e76b505ed1c9581b38d55159530d2472f96c 100644 (file)
@@ -162,23 +162,7 @@ static struct platform_driver tis_synquacer_drv = {
        },
 };
 
-static int __init tpm_tis_synquacer_module_init(void)
-{
-       int rc;
-
-       rc = platform_driver_register(&tis_synquacer_drv);
-       if (rc)
-               return rc;
-
-       return 0;
-}
-
-static void __exit tpm_tis_synquacer_module_exit(void)
-{
-       platform_driver_unregister(&tis_synquacer_drv);
-}
+module_platform_driver(tis_synquacer_drv);
 
-module_init(tpm_tis_synquacer_module_init);
-module_exit(tpm_tis_synquacer_module_exit);
 MODULE_DESCRIPTION("TPM MMIO Driver for Socionext SynQuacer platform");
 MODULE_LICENSE("GPL");