@@ -706,11 +706,22 @@ cur_state_store(struct device *dev, struct device_attribute *attr,
unsigned long state;
int result;
- if (sscanf(buf, "%ld\n", &state) != 1)
+ dump_stack();
+
+ printk(KERN_INFO "%s:%d:%s buf = \"%s\", count = %zu\n",
+ __FILE__, __LINE__, __func__, buf, count);
+
+ if (sscanf(buf, "%ld\n", &state) != 1) {
+ printk(KERN_INFO "%s:%d:%s\n",
+ __FILE__, __LINE__, __func__);
return -EINVAL;
+ }
- if ((long)state < 0)
+ if ((long)state < 0) {
+ printk(KERN_INFO "%s:%d:%s\n",
+ __FILE__, __LINE__, __func__);
return -EINVAL;
+ }
mutex_lock(&cdev->lock);
@@ -719,9 +730,14 @@ cur_state_store(struct device *dev, struct device_attribute *attr,
thermal_cooling_device_stats_update(cdev, state);
mutex_unlock(&cdev->lock);
+
+ printk(KERN_INFO "%s:%d:%s result = %d, count = %zu\n",
+ __FILE__, __LINE__, __func__, result, count);
+
return result ? result : count;
}
+
static struct device_attribute
dev_attr_cdev_type = __ATTR(type, 0444, cdev_type_show, NULL);
static DEVICE_ATTR_RO(max_state);