Skip to content

Commit

Permalink
PM / QoS: Change to use DEFINE_SHOW_ATTRIBUTE macro
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Yangtao Li authored and Rafael J. Wysocki committed Nov 29, 2018
1 parent 2e6e902 commit 96c6935
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions kernel/power/qos.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ static inline void pm_qos_set_value(struct pm_qos_constraints *c, s32 value)
c->target_value = value;
}

static int pm_qos_dbg_show_requests(struct seq_file *s, void *unused)
static int pm_qos_debug_show(struct seq_file *s, void *unused)
{
struct pm_qos_object *qos = (struct pm_qos_object *)s->private;
struct pm_qos_constraints *c;
Expand Down Expand Up @@ -245,18 +245,7 @@ static int pm_qos_dbg_show_requests(struct seq_file *s, void *unused)
return 0;
}

static int pm_qos_dbg_open(struct inode *inode, struct file *file)
{
return single_open(file, pm_qos_dbg_show_requests,
inode->i_private);
}

static const struct file_operations pm_qos_debug_fops = {
.open = pm_qos_dbg_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
DEFINE_SHOW_ATTRIBUTE(pm_qos_debug);

/**
* pm_qos_update_target - manages the constraints list and calls the notifiers
Expand Down

0 comments on commit 96c6935

Please sign in to comment.