drivers core: Miscellaneous changes for sysfs_emit
[linux-2.6-microblaze.git] / drivers / base / power / wakeup_stats.c
index 5568e25..d638259 100644 (file)
@@ -26,7 +26,7 @@ static ssize_t _name##_show(struct device *dev,                               \
 {                                                                      \
        struct wakeup_source *ws = dev_get_drvdata(dev);                \
                                                                        \
-       return sprintf(buf, "%lu\n", ws->_name);                        \
+       return sysfs_emit(buf, "%lu\n", ws->_name);                     \
 }                                                                      \
 static DEVICE_ATTR_RO(_name)
 
@@ -57,6 +57,7 @@ static ssize_t total_time_ms_show(struct device *dev,
                active_time = ktime_sub(ktime_get(), ws->last_time);
                total_time = ktime_add(total_time, active_time);
        }
+
        return sysfs_emit(buf, "%lld\n", ktime_to_ms(total_time));
 }
 static DEVICE_ATTR_RO(total_time_ms);
@@ -73,6 +74,7 @@ static ssize_t max_time_ms_show(struct device *dev,
                if (active_time > max_time)
                        max_time = active_time;
        }
+
        return sysfs_emit(buf, "%lld\n", ktime_to_ms(max_time));
 }
 static DEVICE_ATTR_RO(max_time_ms);
@@ -106,6 +108,7 @@ static ssize_t prevent_suspend_time_ms_show(struct device *dev,
                prevent_sleep_time = ktime_add(prevent_sleep_time,
                        ktime_sub(ktime_get(), ws->start_prevent_time));
        }
+
        return sysfs_emit(buf, "%lld\n", ktime_to_ms(prevent_sleep_time));
 }
 static DEVICE_ATTR_RO(prevent_suspend_time_ms);