|
@@ -1038,19 +1038,25 @@ static ssize_t show_sys_hwmon(int (*get)(void), char *buf)
|
|
return sprintf(buf, "%d\n", get());
|
|
return sprintf(buf, "%d\n", get());
|
|
}
|
|
}
|
|
|
|
|
|
-#define EEEPC_CREATE_SENSOR_ATTR(_name, _mode, _get, _set) \
|
|
|
|
|
|
+#define EEEPC_SENSOR_SHOW_FUNC(_name, _get) \
|
|
static ssize_t show_##_name(struct device *dev, \
|
|
static ssize_t show_##_name(struct device *dev, \
|
|
struct device_attribute *attr, \
|
|
struct device_attribute *attr, \
|
|
char *buf) \
|
|
char *buf) \
|
|
{ \
|
|
{ \
|
|
return show_sys_hwmon(_get, buf); \
|
|
return show_sys_hwmon(_get, buf); \
|
|
- } \
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+#define EEEPC_SENSOR_STORE_FUNC(_name, _set) \
|
|
static ssize_t store_##_name(struct device *dev, \
|
|
static ssize_t store_##_name(struct device *dev, \
|
|
struct device_attribute *attr, \
|
|
struct device_attribute *attr, \
|
|
const char *buf, size_t count) \
|
|
const char *buf, size_t count) \
|
|
{ \
|
|
{ \
|
|
return store_sys_hwmon(_set, buf, count); \
|
|
return store_sys_hwmon(_set, buf, count); \
|
|
- } \
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+#define EEEPC_CREATE_SENSOR_ATTR(_name, _mode, _get, _set) \
|
|
|
|
+ EEEPC_SENSOR_SHOW_FUNC(_name, _get) \
|
|
|
|
+ EEEPC_SENSOR_STORE_FUNC(_name, _set) \
|
|
static DEVICE_ATTR(_name, _mode, show_##_name, store_##_name)
|
|
static DEVICE_ATTR(_name, _mode, show_##_name, store_##_name)
|
|
|
|
|
|
EEEPC_CREATE_SENSOR_ATTR(fan1_input, S_IRUGO, eeepc_get_fan_rpm, NULL);
|
|
EEEPC_CREATE_SENSOR_ATTR(fan1_input, S_IRUGO, eeepc_get_fan_rpm, NULL);
|