diff options
| author | Yangtao Li <[email protected]> | 2023-04-09 16:43:37 +0000 |
|---|---|---|
| committer | Mike Snitzer <[email protected]> | 2023-04-11 16:09:08 +0000 |
| commit | 3664ff82dae1ef9f14f7763d3dd30565e7ef9e14 (patch) | |
| tree | b18b6bec1dd93c543024e7943349fb3e239767d7 /drivers/md/dm-raid.c | |
| parent | dm raid: remove unused d variable (diff) | |
| download | kernel-3664ff82dae1ef9f14f7763d3dd30565e7ef9e14.tar.gz kernel-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 <[email protected]>
Signed-off-by: Mike Snitzer <[email protected]>
Diffstat (limited to 'drivers/md/dm-raid.c')
| -rw-r--r-- | drivers/md/dm-raid.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c index 2dfd51509647..c8821fcb8299 100644 --- a/drivers/md/dm-raid.c +++ b/drivers/md/dm-raid.c @@ -4077,23 +4077,7 @@ static struct target_type raid_target = { .preresume = raid_preresume, .resume = raid_resume, }; - -static int __init dm_raid_init(void) -{ - DMINFO("Loading target version %u.%u.%u", - raid_target.version[0], - raid_target.version[1], - raid_target.version[2]); - return dm_register_target(&raid_target); -} - -static void __exit dm_raid_exit(void) -{ - dm_unregister_target(&raid_target); -} - -module_init(dm_raid_init); -module_exit(dm_raid_exit); +module_dm(raid); module_param(devices_handle_discard_safely, bool, 0644); MODULE_PARM_DESC(devices_handle_discard_safely, |
