Skip to content

Commit 96c6935

Browse files
TinyWindzzrafaeljw
authored andcommitted
PM / QoS: Change to use DEFINE_SHOW_ATTRIBUTE macro
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li <tiny.windzz@gmail.com> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 2e6e902 commit 96c6935

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

kernel/power/qos.c

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ static inline void pm_qos_set_value(struct pm_qos_constraints *c, s32 value)
184184
c->target_value = value;
185185
}
186186

187-
static int pm_qos_dbg_show_requests(struct seq_file *s, void *unused)
187+
static int pm_qos_debug_show(struct seq_file *s, void *unused)
188188
{
189189
struct pm_qos_object *qos = (struct pm_qos_object *)s->private;
190190
struct pm_qos_constraints *c;
@@ -245,18 +245,7 @@ static int pm_qos_dbg_show_requests(struct seq_file *s, void *unused)
245245
return 0;
246246
}
247247

248-
static int pm_qos_dbg_open(struct inode *inode, struct file *file)
249-
{
250-
return single_open(file, pm_qos_dbg_show_requests,
251-
inode->i_private);
252-
}
253-
254-
static const struct file_operations pm_qos_debug_fops = {
255-
.open = pm_qos_dbg_open,
256-
.read = seq_read,
257-
.llseek = seq_lseek,
258-
.release = single_release,
259-
};
248+
DEFINE_SHOW_ATTRIBUTE(pm_qos_debug);
260249

261250
/**
262251
* pm_qos_update_target - manages the constraints list and calls the notifiers

0 commit comments

Comments
 (0)