aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-01-30 21:17:57 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2013-02-26 02:46:05 -0500
commit8add862fad426469a04c879bf5bb01f666a3c58e (patch)
tree3e6a25a2ef5a35a5d32bdc8d7386a9db60bb1314
parent0990a97a1fc649bf9a7e6057c326a835d1520847 (diff)
tegra: don't wank with d_find_alias()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--drivers/iommu/tegra-smmu.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c
index 7db150ca163e..9a09274d15a7 100644
--- a/drivers/iommu/tegra-smmu.c
+++ b/drivers/iommu/tegra-smmu.c
@@ -1026,15 +1026,11 @@ static ssize_t smmu_debugfs_stats_write(struct file *file,
1026 1026
1027static int smmu_debugfs_stats_show(struct seq_file *s, void *v) 1027static int smmu_debugfs_stats_show(struct seq_file *s, void *v)
1028{ 1028{
1029 struct smmu_debugfs_info *info; 1029 struct smmu_debugfs_info *info = s->private;
1030 struct smmu_device *smmu; 1030 struct smmu_device *smmu = info->smmu;
1031 struct dentry *dent;
1032 int i; 1031 int i;
1033 const char * const stats[] = { "hit", "miss", }; 1032 const char * const stats[] = { "hit", "miss", };
1034 1033
1035 dent = d_find_alias(s->private);
1036 info = dent->d_inode->i_private;
1037 smmu = info->smmu;
1038 1034
1039 for (i = 0; i < ARRAY_SIZE(stats); i++) { 1035 for (i = 0; i < ARRAY_SIZE(stats); i++) {
1040 u32 val; 1036 u32 val;
@@ -1048,14 +1044,12 @@ static int smmu_debugfs_stats_show(struct seq_file *s, void *v)
1048 stats[i], val, offs); 1044 stats[i], val, offs);
1049 } 1045 }
1050 seq_printf(s, "\n"); 1046 seq_printf(s, "\n");
1051 dput(dent);
1052
1053 return 0; 1047 return 0;
1054} 1048}
1055 1049
1056static int smmu_debugfs_stats_open(struct inode *inode, struct file *file) 1050static int smmu_debugfs_stats_open(struct inode *inode, struct file *file)
1057{ 1051{
1058 return single_open(file, smmu_debugfs_stats_show, inode); 1052 return single_open(file, smmu_debugfs_stats_show, inode->i_private);
1059} 1053}
1060 1054
1061static const struct file_operations smmu_debugfs_stats_fops = { 1055static const struct file_operations smmu_debugfs_stats_fops = {