summaryrefslogtreecommitdiff
path: root/drivers/md/dm-snap.c
diff options
context:
space:
mode:
authorYangtao Li <frank.li@vivo.com>2023-03-18 21:16:33 +0800
committerMike Snitzer <snitzer@kernel.org>2023-04-11 12:01:01 -0400
commitb362c733ed7bf312ed729847bc26ba89febc556e (patch)
tree3aca88e86af3babc68dbdc97eaf13fad0e569efe /drivers/md/dm-snap.c
parent6b79a428c02769f2a11f8ae76bf866226d134887 (diff)
downloadlwn-b362c733ed7bf312ed729847bc26ba89febc556e.tar.gz
lwn-b362c733ed7bf312ed729847bc26ba89febc556e.zip
dm: push error reporting down to dm_register_target()
Simplifies each DM target's init method by making dm_register_target() responsible for its error reporting (on behalf of targets). Signed-off-by: Yangtao Li <frank.li@vivo.com> Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Diffstat (limited to 'drivers/md/dm-snap.c')
-rw-r--r--drivers/md/dm-snap.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
index f766c21408f1..9c49f53760d0 100644
--- a/drivers/md/dm-snap.c
+++ b/drivers/md/dm-snap.c
@@ -2815,22 +2815,16 @@ static int __init dm_snapshot_init(void)
}
r = dm_register_target(&snapshot_target);
- if (r < 0) {
- DMERR("snapshot target register failed %d", r);
+ if (r < 0)
goto bad_register_snapshot_target;
- }
r = dm_register_target(&origin_target);
- if (r < 0) {
- DMERR("Origin target register failed %d", r);
+ if (r < 0)
goto bad_register_origin_target;
- }
r = dm_register_target(&merge_target);
- if (r < 0) {
- DMERR("Merge target register failed %d", r);
+ if (r < 0)
goto bad_register_merge_target;
- }
return 0;