aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iommu
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/tegra-smmu.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c
index eb0109f98946..b34e5fd7fd9e 100644
--- a/drivers/iommu/tegra-smmu.c
+++ b/drivers/iommu/tegra-smmu.c
@@ -968,7 +968,6 @@ static ssize_t smmu_debugfs_stats_write(struct file *file,
968{ 968{
969 struct smmu_debugfs_info *info; 969 struct smmu_debugfs_info *info;
970 struct smmu_device *smmu; 970 struct smmu_device *smmu;
971 struct dentry *dent;
972 int i; 971 int i;
973 enum { 972 enum {
974 _OFF = 0, 973 _OFF = 0,
@@ -996,8 +995,7 @@ static ssize_t smmu_debugfs_stats_write(struct file *file,
996 if (i == ARRAY_SIZE(command)) 995 if (i == ARRAY_SIZE(command))
997 return -EINVAL; 996 return -EINVAL;
998 997
999 dent = file->f_dentry; 998 info = file_inode(file)->i_private;
1000 info = dent->d_inode->i_private;
1001 smmu = info->smmu; 999 smmu = info->smmu;
1002 1000
1003 offs = SMMU_CACHE_CONFIG(info->cache); 1001 offs = SMMU_CACHE_CONFIG(info->cache);
@@ -1032,15 +1030,11 @@ static ssize_t smmu_debugfs_stats_write(struct file *file,
1032 1030
1033static int smmu_debugfs_stats_show(struct seq_file *s, void *v) 1031static int smmu_debugfs_stats_show(struct seq_file *s, void *v)
1034{ 1032{
1035 struct smmu_debugfs_info *info; 1033 struct smmu_debugfs_info *info = s->private;
1036 struct smmu_device *smmu; 1034 struct smmu_device *smmu = info->smmu;
1037 struct dentry *dent;
1038 int i; 1035 int i;
1039 const char * const stats[] = { "hit", "miss", }; 1036 const char * const stats[] = { "hit", "miss", };
1040 1037
1041 dent = d_find_alias(s->private);
1042 info = dent->d_inode->i_private;
1043 smmu = info->smmu;
1044 1038
1045 for (i = 0; i < ARRAY_SIZE(stats); i++) { 1039 for (i = 0; i < ARRAY_SIZE(stats); i++) {
1046 u32 val; 1040 u32 val;
@@ -1054,14 +1048,12 @@ static int smmu_debugfs_stats_show(struct seq_file *s, void *v)
1054 stats[i], val, offs); 1048 stats[i], val, offs);
1055 } 1049 }
1056 seq_printf(s, "\n"); 1050 seq_printf(s, "\n");
1057 dput(dent);
1058
1059 return 0; 1051 return 0;
1060} 1052}
1061 1053
1062static int smmu_debugfs_stats_open(struct inode *inode, struct file *file) 1054static int smmu_debugfs_stats_open(struct inode *inode, struct file *file)
1063{ 1055{
1064 return single_open(file, smmu_debugfs_stats_show, inode); 1056 return single_open(file, smmu_debugfs_stats_show, inode->i_private);
1065} 1057}
1066 1058
1067static const struct file_operations smmu_debugfs_stats_fops = { 1059static const struct file_operations smmu_debugfs_stats_fops = {