Skip to content

Commit a624bd9

Browse files
Liu Shixinthierryreding
authored andcommitted
gpu: host1x: Use DEFINE_SHOW_ATTRIBUTE to simplify debugfs code
Use DEFINE_SHOW_ATTRIBUTE helper macro to simplify the debugfs code for the status and status_all entries. No functional change. Signed-off-by: Liu Shixin <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
1 parent de383d8 commit a624bd9

File tree

1 file changed

+3
-25
lines changed

1 file changed

+3
-25
lines changed

drivers/gpu/host1x/debug.c

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ static void show_all(struct host1x *m, struct output *o, bool show_fifo)
140140
}
141141
}
142142

143-
static int host1x_debug_show_all(struct seq_file *s, void *unused)
143+
static int host1x_debug_all_show(struct seq_file *s, void *unused)
144144
{
145145
struct output o = {
146146
.fn = write_to_seqfile,
@@ -151,6 +151,7 @@ static int host1x_debug_show_all(struct seq_file *s, void *unused)
151151

152152
return 0;
153153
}
154+
DEFINE_SHOW_ATTRIBUTE(host1x_debug_all);
154155

155156
static int host1x_debug_show(struct seq_file *s, void *unused)
156157
{
@@ -163,30 +164,7 @@ static int host1x_debug_show(struct seq_file *s, void *unused)
163164

164165
return 0;
165166
}
166-
167-
static int host1x_debug_open_all(struct inode *inode, struct file *file)
168-
{
169-
return single_open(file, host1x_debug_show_all, inode->i_private);
170-
}
171-
172-
static const struct file_operations host1x_debug_all_fops = {
173-
.open = host1x_debug_open_all,
174-
.read = seq_read,
175-
.llseek = seq_lseek,
176-
.release = single_release,
177-
};
178-
179-
static int host1x_debug_open(struct inode *inode, struct file *file)
180-
{
181-
return single_open(file, host1x_debug_show, inode->i_private);
182-
}
183-
184-
static const struct file_operations host1x_debug_fops = {
185-
.open = host1x_debug_open,
186-
.read = seq_read,
187-
.llseek = seq_lseek,
188-
.release = single_release,
189-
};
167+
DEFINE_SHOW_ATTRIBUTE(host1x_debug);
190168

191169
static void host1x_debugfs_init(struct host1x *host1x)
192170
{

0 commit comments

Comments
 (0)