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

Commit f6462ea0 authored by Sonal Aggarwal's avatar Sonal Aggarwal
Browse files

tz_log : use file->private_data to get tz_id for debugfs



In msm-4.19, since we are using debugfs there is no struct
as seq_file. seq_file is introduced msm-5.4 onwards where
procfs is used.

Change-Id: I1e4571431f3847b115844e8eae41d6b559e40ef9
Signed-off-by: default avatarSonal Aggarwal <quic_sonaagga@quicinc.com>
parent 591cc49b
Loading
Loading
Loading
Loading
+4 −11
Original line number Diff line number Diff line
@@ -1236,22 +1236,15 @@ static ssize_t tzdbgfs_read_encrypted(struct file *file, char __user *buf,
static ssize_t tzdbgfs_read(struct file *file, char __user *buf,
			    size_t count, loff_t *offp)
{
	struct seq_file *seq = file->private_data;
	int tz_id = TZDBG_STATS_MAX;

	if (seq) {
		if (seq->private)
			tz_id = *(int *)(seq->private);
	if (file->private_data)
		tz_id = *(int *)(file->private_data);
	else {
			pr_err("%s: Seq data private null unable to proceed\n",
		pr_err("%s: file data private null unable to proceed\n",
			__func__);
		return 0;
	}
	}
	else {
		pr_err("%s: Seq data null unable to proceed\n", __func__);
		return 0;
	}

	if (!tzdbg.is_encrypted_log_enabled ||
	   (tz_id == TZDBG_HYP_GENERAL || tz_id == TZDBG_HYP_LOG))