From 5713c48cc493c5019eabbf3cc20636624478f74c Mon Sep 17 00:00:00 2001 From: Ryan Hsu Date: Thu, 21 Jan 2016 15:22:39 -0800 Subject: [PATCH] qcacld-3.0: Remove usage of f_dentry for Kernel upgrade Commit: 78d28e6 ("kill f_dentry macro") Above commit is to remove the marco of f_dentry since Kernel 3.19. Avoid to use the Kernel version check by using the field directly. Change-Id: I7a4b45c62afed402d49d709bb1cb870db352b70e CRs-fixed: 966066 --- core/utils/pktlog/linux_ac.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/core/utils/pktlog/linux_ac.c b/core/utils/pktlog/linux_ac.c index 8ef8e0f1a2a91..cfc12bcded473 100644 --- a/core/utils/pktlog/linux_ac.c +++ b/core/utils/pktlog/linux_ac.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -823,9 +823,15 @@ pktlog_read(struct file *file, char *buf, size_t nbytes, loff_t *ppos) int rem_len; int start_offset, end_offset; int fold_offset, ppos_data, cur_rd_offset; - struct ath_pktlog_info *pl_info = (struct ath_pktlog_info *) - PDE_DATA(file->f_dentry->d_inode); - struct ath_pktlog_buf *log_buf = pl_info->buf; + struct ath_pktlog_info *pl_info; + struct ath_pktlog_buf *log_buf; + + pl_info = (struct ath_pktlog_info *) + PDE_DATA(file->f_path.dentry->d_inode); + if (!pl_info) + return 0; + + log_buf = pl_info->buf; if (log_buf == NULL) return 0; @@ -968,8 +974,10 @@ static struct vm_operations_struct pktlog_vmops = { static int pktlog_mmap(struct file *file, struct vm_area_struct *vma) { - struct ath_pktlog_info *pl_info = (struct ath_pktlog_info *) - PDE_DATA(file->f_dentry->d_inode); + struct ath_pktlog_info *pl_info; + + pl_info = (struct ath_pktlog_info *) + PDE_DATA(file->f_path.dentry->d_inode); if (vma->vm_pgoff != 0) { /* Entire buffer should be mapped */