new file mode 100644
@@ -0,0 +1,10 @@
+#ifndef __BACKPORT_DEVICE_H_
+#define __BACKPORT_DEVICE_H_
+#include_next <linux/device.h>
+
+#ifndef DEVICE_ATTR_ADMIN_RW
+#define DEVICE_ATTR_ADMIN_RW(_name) \
+ struct device_attribute dev_attr_##_name = __ATTR_RW_MODE(_name, 0600)
+#endif
+
+#endif /* __BACKPORT_DEVICE_H_ */
@@ -22,4 +22,13 @@ static inline int sysfs_emit(char *buf, const char *fmt, ...)
#endif /* CONFIG_SYSFS */
#endif /* < 5.10 */
+#ifndef __ATTR_RW_MODE
+#define __ATTR_RW_MODE(_name, _mode) { \
+ .attr = { .name = __stringify(_name), \
+ .mode = VERIFY_OCTAL_PERMISSIONS(_mode) }, \
+ .show = _name##_show, \
+ .store = _name##_store, \
+}
+#endif
+
#endif /* __BACKPORT_LINUX_SYSFS_H */
The DEVICE_ATTR_ADMIN_RW define was added with kernel 5.9 and is now used by ssb. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> --- backport/backport-include/linux/device.h | 10 ++++++++++ backport/backport-include/linux/sysfs.h | 9 +++++++++ 2 files changed, 19 insertions(+) create mode 100644 backport/backport-include/linux/device.h