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

Commit 206c3012 authored by Jilai Wang's avatar Jilai Wang
Browse files

msm: npu: Use different release function for register read node



Only register read node in debugfs needs to free buffer allocated
while reading registers in release funciton.

Change-Id: I39a3bd94e6659ba5201c0984248558bd2a3e887c
Signed-off-by: default avatarJilai Wang <jilaiw@codeaurora.org>
parent 6326bdda
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@
 */
static int npu_debug_open(struct inode *inode, struct file *file);
static int npu_debug_release(struct inode *inode, struct file *file);
static int npu_debug_reg_release(struct inode *inode, struct file *file);
static ssize_t npu_debug_reg_write(struct file *file,
		const char __user *user_buf, size_t count, loff_t *ppos);
static ssize_t npu_debug_reg_read(struct file *file,
@@ -46,7 +47,7 @@ struct npu_device *g_npu_dev;

static const struct file_operations npu_reg_fops = {
	.open = npu_debug_open,
	.release = npu_debug_release,
	.release = npu_debug_reg_release,
	.read = npu_debug_reg_read,
	.write = npu_debug_reg_write,
};
@@ -85,6 +86,11 @@ static int npu_debug_open(struct inode *inode, struct file *file)
}

static int npu_debug_release(struct inode *inode, struct file *file)
{
	return 0;
}

static int npu_debug_reg_release(struct inode *inode, struct file *file)
{
	struct npu_device *npu_dev = file->private_data;
	struct npu_debugfs_ctx *debugfs;