[PATCH v3 03/10] erofs: convert to kobject_del_and_put()
Yangtao Li
frank.li at vivo.com
Thu Mar 23 03:58:58 AEDT 2023
Use kobject_del_and_put() to simplify code.
Cc: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
Cc: "Rafael J. Wysocki" <rafael at kernel.org>
Cc: Damien Le Moal <damien.lemoal at opensource.wdc.com>
Signed-off-by: Yangtao Li <frank.li at vivo.com>
---
fs/erofs/sysfs.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/erofs/sysfs.c b/fs/erofs/sysfs.c
index 435e515c0792..9ed7d6552155 100644
--- a/fs/erofs/sysfs.c
+++ b/fs/erofs/sysfs.c
@@ -241,8 +241,7 @@ void erofs_unregister_sysfs(struct super_block *sb)
struct erofs_sb_info *sbi = EROFS_SB(sb);
if (sbi->s_kobj.state_in_sysfs) {
- kobject_del(&sbi->s_kobj);
- kobject_put(&sbi->s_kobj);
+ kobject_del_and_put(&sbi->s_kobj);
wait_for_completion(&sbi->s_kobj_unregister);
}
}
--
2.35.1
More information about the Linux-erofs
mailing list