Merge tag 'driver-core-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
[muen/linux.git] / drivers / infiniband / hw / hfi1 / debugfs.c
index 76157cc03ecaf453eaf0eefa265f8a8827e91b13..2e6e0c51604185e835f9eb2347825e4eeb96eb7f 100644 (file)
@@ -71,13 +71,13 @@ static ssize_t hfi1_seq_read(
        loff_t *ppos)
 {
        struct dentry *d = file->f_path.dentry;
-       int srcu_idx;
        ssize_t r;
 
-       r = debugfs_use_file_start(d, &srcu_idx);
-       if (likely(!r))
-               r = seq_read(file, buf, size, ppos);
-       debugfs_use_file_finish(srcu_idx);
+       r = debugfs_file_get(d);
+       if (unlikely(r))
+               return r;
+       r = seq_read(file, buf, size, ppos);
+       debugfs_file_put(d);
        return r;
 }
 
@@ -87,13 +87,13 @@ static loff_t hfi1_seq_lseek(
        int whence)
 {
        struct dentry *d = file->f_path.dentry;
-       int srcu_idx;
        loff_t r;
 
-       r = debugfs_use_file_start(d, &srcu_idx);
-       if (likely(!r))
-               r = seq_lseek(file, offset, whence);
-       debugfs_use_file_finish(srcu_idx);
+       r = debugfs_file_get(d);
+       if (unlikely(r))
+               return r;
+       r = seq_lseek(file, offset, whence);
+       debugfs_file_put(d);
        return r;
 }