Skip to content

Commit 0ea79cd

Browse files
committed
regmap: get rid of redundant debugfs_file_{get,put}()
JIRA: https://issues.redhat.com/browse/RHEL-109251 commit 8009fb7 commit 9f711c9 Author: Al Viro <viro@zeniv.linux.org.uk> Date: Fri, 04 Jul 2025 13:18:13 +0000 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> Signed-off-by: Mark Langsdorf <mlangsdo@redhat.com>
1 parent 4f04c74 commit 0ea79cd

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

drivers/base/regmap/regmap-debugfs.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -470,10 +470,6 @@ static ssize_t regmap_cache_only_write_file(struct file *file,
470470
if (err)
471471
return count;
472472

473-
err = debugfs_file_get(file->f_path.dentry);
474-
if (err)
475-
return err;
476-
477473
map->lock(map->lock_arg);
478474

479475
if (new_val && !map->cache_only) {
@@ -486,7 +482,6 @@ static ssize_t regmap_cache_only_write_file(struct file *file,
486482
map->cache_only = new_val;
487483

488484
map->unlock(map->lock_arg);
489-
debugfs_file_put(file->f_path.dentry);
490485

491486
if (require_sync) {
492487
err = regcache_sync(map);
@@ -517,10 +512,6 @@ static ssize_t regmap_cache_bypass_write_file(struct file *file,
517512
if (err)
518513
return count;
519514

520-
err = debugfs_file_get(file->f_path.dentry);
521-
if (err)
522-
return err;
523-
524515
map->lock(map->lock_arg);
525516

526517
if (new_val && !map->cache_bypass) {
@@ -532,7 +523,6 @@ static ssize_t regmap_cache_bypass_write_file(struct file *file,
532523
map->cache_bypass = new_val;
533524

534525
map->unlock(map->lock_arg);
535-
debugfs_file_put(file->f_path.dentry);
536526

537527
return count;
538528
}

0 commit comments

Comments
 (0)