aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power/disk.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/power/disk.c')
-rw-r--r--kernel/power/disk.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/kernel/power/disk.c b/kernel/power/disk.c
index 9e51cdf7b78d..e24446f8d8cd 100644
--- a/kernel/power/disk.c
+++ b/kernel/power/disk.c
@@ -365,9 +365,29 @@ out:
365 365
366power_attr(resume); 366power_attr(resume);
367 367
368static ssize_t image_size_show(struct subsystem * subsys, char *buf)
369{
370 return sprintf(buf, "%u\n", image_size);
371}
372
373static ssize_t image_size_store(struct subsystem * subsys, const char * buf, size_t n)
374{
375 unsigned int size;
376
377 if (sscanf(buf, "%u", &size) == 1) {
378 image_size = size;
379 return n;
380 }
381
382 return -EINVAL;
383}
384
385power_attr(image_size);
386
368static struct attribute * g[] = { 387static struct attribute * g[] = {
369 &disk_attr.attr, 388 &disk_attr.attr,
370 &resume_attr.attr, 389 &resume_attr.attr,
390 &image_size_attr.attr,
371 NULL, 391 NULL,
372}; 392};
373 393