media: cec: core: Use DEFINE_SHOW_STORE_ATTRIBUTE() helper for debugfs

Use DEFINE_SHOW_STORE_ATTRIBUTE() helper for read-write file to reduce some
duplicated code.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
This commit is contained in:
Andy Shevchenko
2026-07-09 10:20:55 +02:00
committed by Hans Verkuil
parent b2b9a296b7
commit dbcaf39698

View File

@@ -205,19 +205,7 @@ static int cec_error_inj_show(struct seq_file *sf, void *unused)
return call_op(adap, error_inj_show, sf);
}
static int cec_error_inj_open(struct inode *inode, struct file *file)
{
return single_open(file, cec_error_inj_show, inode->i_private);
}
static const struct file_operations cec_error_inj_fops = {
.open = cec_error_inj_open,
.write = cec_error_inj_write,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
DEFINE_SHOW_STORE_ATTRIBUTE(cec_error_inj);
#endif
struct cec_adapter *cec_allocate_adapter(const struct cec_adap_ops *ops,