diff options
author | Yangtao Li <frank.li@vivo.com> | 2023-04-10 00:43:37 +0800 |
---|---|---|
committer | Mike Snitzer <snitzer@kernel.org> | 2023-04-11 12:09:08 -0400 |
commit | 3664ff82dae1ef9f14f7763d3dd30565e7ef9e14 (patch) | |
tree | b18b6bec1dd93c543024e7943349fb3e239767d7 /drivers/md/dm-ebs-target.c | |
parent | 306fbc2e041c227be7c934efe8a49ddb87bd31f1 (diff) | |
download | linux-stable-3664ff82dae1ef9f14f7763d3dd30565e7ef9e14.tar.gz linux-stable-3664ff82dae1ef9f14f7763d3dd30565e7ef9e14.tar.bz2 linux-stable-3664ff82dae1ef9f14f7763d3dd30565e7ef9e14.zip |
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-ebs-target.c')
-rw-r--r-- | drivers/md/dm-ebs-target.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/md/dm-ebs-target.c b/drivers/md/dm-ebs-target.c index 38da4de3ecbf..435b45201f4d 100644 --- a/drivers/md/dm-ebs-target.c +++ b/drivers/md/dm-ebs-target.c @@ -452,19 +452,7 @@ static struct target_type ebs_target = { .prepare_ioctl = ebs_prepare_ioctl, .iterate_devices = ebs_iterate_devices, }; - -static int __init dm_ebs_init(void) -{ - return dm_register_target(&ebs_target); -} - -static void dm_ebs_exit(void) -{ - dm_unregister_target(&ebs_target); -} - -module_init(dm_ebs_init); -module_exit(dm_ebs_exit); +module_dm(ebs); MODULE_AUTHOR("Heinz Mauelshagen <dm-devel@redhat.com>"); MODULE_DESCRIPTION(DM_NAME " emulated block size target"); |