Skip to content

Commit 9f711c9

Browse files
Al Virobroonie
authored andcommitted
regmap: get rid of redundant debugfs_file_{get,put}()
pointless in ->read()/->write() of file_operations used only via debugfs_create_file() Signed-off-by: Al Viro <[email protected]> Link: https://patch.msgid.link/20250702211602.GC3406663@ZenIV Signed-off-by: Mark Brown <[email protected]>
1 parent c8c4694 commit 9f711c9

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)