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: Sonal Aggarwal <quic_sonaagga@quicinc.com>
This commit is contained in:
Sonal Aggarwal
2022-06-29 15:50:56 +05:30
parent 591cc49bf4
commit f6462ea007

View File

@@ -1236,20 +1236,13 @@ 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);
else {
pr_err("%s: Seq data private null unable to proceed\n",
__func__);
return 0;
}
}
if (file->private_data)
tz_id = *(int *)(file->private_data);
else {
pr_err("%s: Seq data null unable to proceed\n", __func__);
pr_err("%s: file data private null unable to proceed\n",
__func__);
return 0;
}