Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ed33bef3 authored by Raghavendra Rao Ananta's avatar Raghavendra Rao Ananta Committed by Gerrit - the friendly Code Review server
Browse files

trace: convert to debugfs_file_get() and -put()



Convert the depreciated calls, debugfs_use_file_start() and
debugfs_use_file_finish() to debugfs_file_get() and debugfs_file_put()
respectively.

Change-Id: Ifdf214d4274a4062d7a077fdc94a9528d960eed6
Signed-off-by: default avatarRaghavendra Rao Ananta <rananta@codeaurora.org>
Signed-off-by: default avatarChris Lew <clew@codeaurora.org>
parent 344a903f
Loading
Loading
Loading
Loading
+10 −8
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (c) 2012-2015, 2017, The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2015, 2017-2018, The Linux Foundation. All rights reserved.
 */

#include <linux/slab.h>
@@ -70,17 +70,18 @@ static ssize_t debug_read_helper(struct file *file, char __user *buff,
	struct dentry *d = file->f_path.dentry;
	char *buffer;
	int bsize;
	int srcu_idx;
	int r;

	r = debugfs_use_file_start(d, &srcu_idx);
	if (!r) {
	r = debugfs_file_get(d);
	if (r)
		return r;

	ilctxt = file->private_data;
	r = kref_get_unless_zero(&ilctxt->refcount) ? 0 : -EIO;
	}
	debugfs_use_file_finish(srcu_idx);
	if (r)
	if (r) {
		debugfs_file_put(d);
		return r;
	}

	buffer = kmalloc(count, GFP_KERNEL);
	if (!buffer) {
@@ -102,6 +103,7 @@ static ssize_t debug_read_helper(struct file *file, char __user *buff,

done:
	ipc_log_context_put(ilctxt);
	debugfs_file_put(d);
	return bsize;
}