+#ifndef pr_warn
+/* pr_warn macro not introduced until 2.6.35 */
+#define pr_warn pr_warning
+#endif
+#ifndef pr_warn_ratelimited
+#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
+