mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 01:30:30 -04:00
linuxkpi: Define DEFINE_SHOW_STORE_ATTRIBUTE()
It is the same as `DEFINE_SHOW_ATTRIBUTE()` with a `write` function added. The i915 DRM driver started to use it in Linux 6.9. Reviewed by: manu Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50992
This commit is contained in:
parent
621f43ffe2
commit
cdfdafdc34
1 changed files with 15 additions and 0 deletions
|
|
@ -55,6 +55,21 @@ static const struct file_operations __name ## _fops = { \
|
|||
.release = single_release, \
|
||||
}
|
||||
|
||||
#define DEFINE_SHOW_STORE_ATTRIBUTE(__name) \
|
||||
static int __name ## _open(struct inode *inode, struct linux_file *file) \
|
||||
{ \
|
||||
return single_open(file, __name ## _show, inode->i_private); \
|
||||
} \
|
||||
\
|
||||
static const struct file_operations __name ## _fops = { \
|
||||
.owner = THIS_MODULE, \
|
||||
.open = __name ## _open, \
|
||||
.read = seq_read, \
|
||||
.write = __name ## _write, \
|
||||
.llseek = seq_lseek, \
|
||||
.release = single_release, \
|
||||
}
|
||||
|
||||
struct seq_file {
|
||||
struct sbuf *buf;
|
||||
size_t size;
|
||||
|
|
|
|||
Loading…
Reference in a new issue