diff mbox series

[65/75] header Add SENSOR_DEVICE_ATTR_RO

Message ID 20240627234808.1253337-66-hauke@hauke-m.de (mailing list archive)
State New, archived
Headers show
Series backports: Update to kernel 6.1.95 | expand

Commit Message

Hauke Mehrtens June 27, 2024, 11:47 p.m. UTC
These new attributes are used by the mt76 driver.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/hwmon-sysfs.h | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 backport/backport-include/linux/hwmon-sysfs.h
diff mbox series

Patch

diff --git a/backport/backport-include/linux/hwmon-sysfs.h b/backport/backport-include/linux/hwmon-sysfs.h
new file mode 100644
index 00000000..84a4e149
--- /dev/null
+++ b/backport/backport-include/linux/hwmon-sysfs.h
@@ -0,0 +1,15 @@ 
+#ifndef __BACKPORT_LINUX_HWMON_SYSFS_H
+#define __BACKPORT_LINUX_HWMON_SYSFS_H
+#include_next <linux/hwmon-sysfs.h>
+
+#ifndef SENSOR_DEVICE_ATTR_RO
+#define SENSOR_DEVICE_ATTR_RO(_name, _func, _index)		\
+	SENSOR_DEVICE_ATTR(_name, 0444, _func##_show, NULL, _index)
+#endif
+
+#ifndef SENSOR_DEVICE_ATTR_RW
+#define SENSOR_DEVICE_ATTR_RW(_name, _func, _index)		\
+	SENSOR_DEVICE_ATTR(_name, 0644, _func##_show, _func##_store, _index)
+#endif
+
+#endif /* __BACKPORT_LINUX_HWMON_SYSFS_H */