]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
regmap: get rid of redundant debugfs_file_{get,put}()
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 2 Jul 2025 21:16:02 +0000 (22:16 +0100)
committerMark Brown <broonie@kernel.org>
Fri, 4 Jul 2025 12:18:13 +0000 (13:18 +0100)
pointless in ->read()/->write() of file_operations used only via
debugfs_create_file()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Link: https://patch.msgid.link/20250702211602.GC3406663@ZenIV
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/base/regmap/regmap-debugfs.c

index fb84cda92a753fc49f57cb557fb65d6212222b74..c9b4c04b1cf608ad7d398fafc0304a13ce59e315 100644 (file)
@@ -470,10 +470,6 @@ static ssize_t regmap_cache_only_write_file(struct file *file,
        if (err)
                return count;
 
-       err = debugfs_file_get(file->f_path.dentry);
-       if (err)
-               return err;
-
        map->lock(map->lock_arg);
 
        if (new_val && !map->cache_only) {
@@ -486,7 +482,6 @@ static ssize_t regmap_cache_only_write_file(struct file *file,
        map->cache_only = new_val;
 
        map->unlock(map->lock_arg);
-       debugfs_file_put(file->f_path.dentry);
 
        if (require_sync) {
                err = regcache_sync(map);
@@ -517,10 +512,6 @@ static ssize_t regmap_cache_bypass_write_file(struct file *file,
        if (err)
                return count;
 
-       err = debugfs_file_get(file->f_path.dentry);
-       if (err)
-               return err;
-
        map->lock(map->lock_arg);
 
        if (new_val && !map->cache_bypass) {
@@ -532,7 +523,6 @@ static ssize_t regmap_cache_bypass_write_file(struct file *file,
        map->cache_bypass = new_val;
 
        map->unlock(map->lock_arg);
-       debugfs_file_put(file->f_path.dentry);
 
        return count;
 }