aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorPavel Machek <pavel@ucw.cz>2005-07-07 20:56:43 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-07 21:23:43 -0400
commit3efa147ad7608196639882ba4075b376f306fe16 (patch)
treeedc1176c8af4ce97c3586382ebb7de68936f1bec /kernel
parente00d9967e3addea86dded46deefc5daec5d52e5a (diff)
[PATCH] pm: Fix resume from initrd
Move device name resolution code around so that it is not called from resume-from-initrd. name_to_dev_t may be unavailable at that point. Signed-off-by: Pavel Machek <pavel@suse.cz> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/power/disk.c10
-rw-r--r--kernel/power/swsusp.c10
2 files changed, 10 insertions, 10 deletions
diff --git a/kernel/power/disk.c b/kernel/power/disk.c
index fb8de63c2919..c51a4d96d4eb 100644
--- a/kernel/power/disk.c
+++ b/kernel/power/disk.c
@@ -234,6 +234,16 @@ static int software_resume(void)
234{ 234{
235 int error; 235 int error;
236 236
237 if (!swsusp_resume_device) {
238 if (!strlen(resume_file))
239 return -ENOENT;
240 swsusp_resume_device = name_to_dev_t(resume_file);
241 pr_debug("swsusp: Resume From Partition %s\n", resume_file);
242 } else {
243 pr_debug("swsusp: Resume From Partition %d:%d\n",
244 MAJOR(swsusp_resume_device), MINOR(swsusp_resume_device));
245 }
246
237 if (noresume) { 247 if (noresume) {
238 /** 248 /**
239 * FIXME: If noresume is specified, we need to find the partition 249 * FIXME: If noresume is specified, we need to find the partition
diff --git a/kernel/power/swsusp.c b/kernel/power/swsusp.c
index c285fc5a2320..d82c1f7d0a60 100644
--- a/kernel/power/swsusp.c
+++ b/kernel/power/swsusp.c
@@ -1356,16 +1356,6 @@ int swsusp_check(void)
1356{ 1356{
1357 int error; 1357 int error;
1358 1358
1359 if (!swsusp_resume_device) {
1360 if (!strlen(resume_file))
1361 return -ENOENT;
1362 swsusp_resume_device = name_to_dev_t(resume_file);
1363 pr_debug("swsusp: Resume From Partition %s\n", resume_file);
1364 } else {
1365 pr_debug("swsusp: Resume From Partition %d:%d\n",
1366 MAJOR(swsusp_resume_device), MINOR(swsusp_resume_device));
1367 }
1368
1369 resume_bdev = open_by_devnum(swsusp_resume_device, FMODE_READ); 1359 resume_bdev = open_by_devnum(swsusp_resume_device, FMODE_READ);
1370 if (!IS_ERR(resume_bdev)) { 1360 if (!IS_ERR(resume_bdev)) {
1371 set_blocksize(resume_bdev, PAGE_SIZE); 1361 set_blocksize(resume_bdev, PAGE_SIZE);