Skip to content

Commit

Permalink
drm/i915/display: Introduce DEFINE_SHOW_STORE_ATTRIBUTE for debugfs
Browse files Browse the repository at this point in the history
Seq introduce a new helper macro DEFINE_SHOW_STORE_ATTRIBUTE for
Read-Write file, so we apply it at drm/i915/display to reduce some
duplicated code.

Signed-off-by: Luo Jiaxing <luojiaxing@huawei.com>
  • Loading branch information
Luojiaxing1991 authored and intel-lab-lkp committed Nov 12, 2020
1 parent 63f19cb commit c5417f3
Showing 1 changed file with 4 additions and 51 deletions.
55 changes: 4 additions & 51 deletions drivers/gpu/drm/i915/display/intel_display_debugfs.c
Expand Up @@ -1329,21 +1329,7 @@ static int i915_displayport_test_active_show(struct seq_file *m, void *data)
return 0;
}

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

static const struct file_operations i915_displayport_test_active_fops = {
.owner = THIS_MODULE,
.open = i915_displayport_test_active_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
.write = i915_displayport_test_active_write
};
DEFINE_SHOW_STORE_ATTRIBUTE(i915_displayport_test_active);

static int i915_displayport_test_data_show(struct seq_file *m, void *data)
{
Expand Down Expand Up @@ -1733,19 +1719,7 @@ static ssize_t i915_hpd_storm_ctl_write(struct file *file,
return len;
}

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

static const struct file_operations i915_hpd_storm_ctl_fops = {
.owner = THIS_MODULE,
.open = i915_hpd_storm_ctl_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
.write = i915_hpd_storm_ctl_write
};
DEFINE_SHOW_STORE_ATTRIBUTE(i915_hpd_storm_ctl);

static int i915_hpd_short_storm_ctl_show(struct seq_file *m, void *data)
{
Expand Down Expand Up @@ -1811,14 +1785,7 @@ static ssize_t i915_hpd_short_storm_ctl_write(struct file *file,
return len;
}

static const struct file_operations i915_hpd_short_storm_ctl_fops = {
.owner = THIS_MODULE,
.open = i915_hpd_short_storm_ctl_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
.write = i915_hpd_short_storm_ctl_write,
};
DEFINE_SHOW_STORE_ATTRIBUTE(i915_hpd_short_storm_ctl);

static int i915_drrs_ctl_set(void *data, u64 val)
{
Expand Down Expand Up @@ -2181,21 +2148,7 @@ static ssize_t i915_dsc_fec_support_write(struct file *file,
return len;
}

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

static const struct file_operations i915_dsc_fec_support_fops = {
.owner = THIS_MODULE,
.open = i915_dsc_fec_support_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
.write = i915_dsc_fec_support_write
};
DEFINE_SHOW_STORE_ATTRIBUTE(i915_dsc_fec_support);

/**
* intel_connector_debugfs_add - add i915 specific connector debugfs files
Expand Down

0 comments on commit c5417f3

Please sign in to comment.