Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 16293
b: refs/heads/master
c: a576219
h: refs/heads/master
i:
  16291: 37c0878
v: v3
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed Jan 6, 2006
1 parent 8814ced commit ab2f8cd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 817c41d76e9eaf72044268b0e545a547abadc0bb
refs/heads/master: a576219aca70e6700705a9836e098dbecd25fb56
34 changes: 16 additions & 18 deletions trunk/kernel/power/disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,30 +363,28 @@ static ssize_t resume_show(struct subsystem * subsys, char *buf)
MINOR(swsusp_resume_device));
}

static ssize_t resume_store(struct subsystem * subsys, const char * buf, size_t n)
static ssize_t resume_store(struct subsystem *subsys, const char *buf, size_t n)
{
int len;
char *p;
unsigned int maj, min;
int error = -EINVAL;
dev_t res;
int ret = -EINVAL;

p = memchr(buf, '\n', n);
len = p ? p - buf : n;
if (sscanf(buf, "%u:%u", &maj, &min) != 2)
goto out;

if (sscanf(buf, "%u:%u", &maj, &min) == 2) {
res = MKDEV(maj,min);
if (maj == MAJOR(res) && min == MINOR(res)) {
down(&pm_sem);
swsusp_resume_device = res;
up(&pm_sem);
printk("Attempting manual resume\n");
noresume = 0;
software_resume();
}
}
res = MKDEV(maj,min);
if (maj != MAJOR(res) || min != MINOR(res))
goto out;

return error >= 0 ? n : error;
down(&pm_sem);
swsusp_resume_device = res;
up(&pm_sem);
printk("Attempting manual resume\n");
noresume = 0;
software_resume();
ret = n;
out:
return ret;
}

power_attr(resume);
Expand Down

0 comments on commit ab2f8cd

Please sign in to comment.