]> git.sur5r.net Git - groeck-nct6775/blobdiff - compat.h
Add driver removal notice
[groeck-nct6775] / compat.h
index 691d73057869c10560dbae4a8e9b80f310415b7c..de03ccbc560c4a434d5927c174f1d80e1b302207 100644 (file)
--- a/compat.h
+++ b/compat.h
@@ -230,4 +230,20 @@ module_exit(__driver##_exit);
 #define pr_warn_ratelimited pr_warning_ratelimited
 #endif
 
+#ifndef sysfs_attr_init
+#define sysfs_attr_init(attr) do {} while (0)
+#endif
+
+#ifndef __ATTR_RO
+#define __ATTR_RO(_name) {                                             \
+       .attr   = { .name = __stringify(_name), .mode = 0444 },         \
+       .show   = _name##_show,                                         \
+}
+#endif
+
+#ifndef DEVICE_ATTR_RO
+#define DEVICE_ATTR_RO(_name) \
+       struct device_attribute dev_attr_##_name = __ATTR_RO(_name)
+#endif
+
 #endif /* __COMPAT_H */