mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
linuxkpi: Fix __ATTR_RO() in <linux/sysfs.h>
[Why] The passed structure may not have a `.store` field. This is the case in the amdgpu DRM driver starting with Linux 5.18. Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D43023 (cherry picked from commit d752a5e82ac92603fadf82e7de75878e1f5d054a)
This commit is contained in:
parent
af41c1bee4
commit
0b3e4b3cc9
1 changed files with 4 additions and 1 deletions
|
|
@ -54,7 +54,10 @@ struct attribute_group {
|
|||
.attr = { .name = __stringify(_name), .mode = _mode }, \
|
||||
.show = _show, .store = _store, \
|
||||
}
|
||||
#define __ATTR_RO(_name) __ATTR(_name, 0444, _name##_show, NULL)
|
||||
#define __ATTR_RO(_name) { \
|
||||
.attr = { .name = __stringify(_name), .mode = 0444 }, \
|
||||
.show = _name##_show, \
|
||||
}
|
||||
#define __ATTR_WO(_name) __ATTR(_name, 0200, NULL, _name##_store)
|
||||
#define __ATTR_RW(_name) __ATTR(_name, 0644, _name##_show, _name##_store)
|
||||
#define __ATTR_NULL { .attr = { .name = NULL } }
|
||||
|
|
|
|||
Loading…
Reference in a new issue