Skip to content

Commit 062e52a

Browse files
TinyWindzzjoergroedel
authored andcommitted
iommu/tegra: Change to use DEFINE_SHOW_ATTRIBUTE macro
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li <[email protected]> Acked-by: Thierry Reding <[email protected]> Signed-off-by: Joerg Roedel <[email protected]>
1 parent 9ff0119 commit 062e52a

File tree

1 file changed

+2
-22
lines changed

1 file changed

+2
-22
lines changed

drivers/iommu/tegra-smmu.c

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -926,17 +926,7 @@ static int tegra_smmu_swgroups_show(struct seq_file *s, void *data)
926926
return 0;
927927
}
928928

929-
static int tegra_smmu_swgroups_open(struct inode *inode, struct file *file)
930-
{
931-
return single_open(file, tegra_smmu_swgroups_show, inode->i_private);
932-
}
933-
934-
static const struct file_operations tegra_smmu_swgroups_fops = {
935-
.open = tegra_smmu_swgroups_open,
936-
.read = seq_read,
937-
.llseek = seq_lseek,
938-
.release = single_release,
939-
};
929+
DEFINE_SHOW_ATTRIBUTE(tegra_smmu_swgroups);
940930

941931
static int tegra_smmu_clients_show(struct seq_file *s, void *data)
942932
{
@@ -964,17 +954,7 @@ static int tegra_smmu_clients_show(struct seq_file *s, void *data)
964954
return 0;
965955
}
966956

967-
static int tegra_smmu_clients_open(struct inode *inode, struct file *file)
968-
{
969-
return single_open(file, tegra_smmu_clients_show, inode->i_private);
970-
}
971-
972-
static const struct file_operations tegra_smmu_clients_fops = {
973-
.open = tegra_smmu_clients_open,
974-
.read = seq_read,
975-
.llseek = seq_lseek,
976-
.release = single_release,
977-
};
957+
DEFINE_SHOW_ATTRIBUTE(tegra_smmu_clients);
978958

979959
static void tegra_smmu_debugfs_init(struct tegra_smmu *smmu)
980960
{

0 commit comments

Comments
 (0)