summaryrefslogtreecommitdiff
path: root/drivers/md/dm-dust.c
diff options
context:
space:
mode:
authorYangtao Li <frank.li@vivo.com>2023-04-09 19:43:37 +0300
committerMike Snitzer <snitzer@kernel.org>2023-04-11 19:09:08 +0300
commit3664ff82dae1ef9f14f7763d3dd30565e7ef9e14 (patch)
treeb18b6bec1dd93c543024e7943349fb3e239767d7 /drivers/md/dm-dust.c
parent306fbc2e041c227be7c934efe8a49ddb87bd31f1 (diff)
downloadlinux-3664ff82dae1ef9f14f7763d3dd30565e7ef9e14.tar.xz
dm: add helper macro for simple DM target module init and exit
Eliminate duplicate boilerplate code for simple modules that contain a single DM target driver without any additional setup code. Add a new module_dm() macro, which replaces the module_init() and module_exit() with template functions that call dm_register_target() and dm_unregister_target() respectively. Signed-off-by: Yangtao Li <frank.li@vivo.com> Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Diffstat (limited to 'drivers/md/dm-dust.c')
-rw-r--r--drivers/md/dm-dust.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/md/dm-dust.c b/drivers/md/dm-dust.c
index 9bf3cdf548de..12a377e06d02 100644
--- a/drivers/md/dm-dust.c
+++ b/drivers/md/dm-dust.c
@@ -570,19 +570,7 @@ static struct target_type dust_target = {
.status = dust_status,
.prepare_ioctl = dust_prepare_ioctl,
};
-
-static int __init dm_dust_init(void)
-{
- return dm_register_target(&dust_target);
-}
-
-static void __exit dm_dust_exit(void)
-{
- dm_unregister_target(&dust_target);
-}
-
-module_init(dm_dust_init);
-module_exit(dm_dust_exit);
+module_dm(dust);
MODULE_DESCRIPTION(DM_NAME " dust test target");
MODULE_AUTHOR("Bryan Gurney <dm-devel@redhat.com>");