Skip to content

Commit

Permalink
linuxkpi: Fix __ATTR_RO() in <linux/sysfs.h>
Browse files Browse the repository at this point in the history
[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
  • Loading branch information
dumbbell committed Dec 13, 2023
1 parent 509707e commit d752a5e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sys/compat/linuxkpi/common/include/linux/sysfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 } }
Expand Down

0 comments on commit d752a5e

Please sign in to comment.