summaryrefslogtreecommitdiff
path: root/drivers/md/dm-writecache.c
diff options
context:
space:
mode:
authorYangtao Li <frank.li@vivo.com>2023-03-18 16:16:33 +0300
committerMike Snitzer <snitzer@kernel.org>2023-04-11 19:01:01 +0300
commitb362c733ed7bf312ed729847bc26ba89febc556e (patch)
tree3aca88e86af3babc68dbdc97eaf13fad0e569efe /drivers/md/dm-writecache.c
parent6b79a428c02769f2a11f8ae76bf866226d134887 (diff)
downloadlinux-b362c733ed7bf312ed729847bc26ba89febc556e.tar.xz
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-writecache.c')
-rw-r--r--drivers/md/dm-writecache.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c
index 3aa5874f0aef..81b60b75a9fa 100644
--- a/drivers/md/dm-writecache.c
+++ b/drivers/md/dm-writecache.c
@@ -2776,15 +2776,7 @@ static struct target_type writecache_target = {
static int __init dm_writecache_init(void)
{
- int r;
-
- r = dm_register_target(&writecache_target);
- if (r < 0) {
- DMERR("register failed %d", r);
- return r;
- }
-
- return 0;
+ return dm_register_target(&writecache_target);
}
static void __exit dm_writecache_exit(void)