diff options
Diffstat (limited to 'kernel/power/hibernate.c')
-rw-r--r-- | kernel/power/hibernate.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c index e09dfbfeecee..238025f5472e 100644 --- a/kernel/power/hibernate.c +++ b/kernel/power/hibernate.c | |||
@@ -25,7 +25,8 @@ | |||
25 | #include <linux/freezer.h> | 25 | #include <linux/freezer.h> |
26 | #include <linux/gfp.h> | 26 | #include <linux/gfp.h> |
27 | #include <linux/syscore_ops.h> | 27 | #include <linux/syscore_ops.h> |
28 | #include <scsi/scsi_scan.h> | 28 | #include <linux/ctype.h> |
29 | #include <linux/genhd.h> | ||
29 | 30 | ||
30 | #include "power.h" | 31 | #include "power.h" |
31 | 32 | ||
@@ -722,6 +723,17 @@ static int software_resume(void) | |||
722 | 723 | ||
723 | /* Check if the device is there */ | 724 | /* Check if the device is there */ |
724 | swsusp_resume_device = name_to_dev_t(resume_file); | 725 | swsusp_resume_device = name_to_dev_t(resume_file); |
726 | |||
727 | /* | ||
728 | * name_to_dev_t is ineffective to verify parition if resume_file is in | ||
729 | * integer format. (e.g. major:minor) | ||
730 | */ | ||
731 | if (isdigit(resume_file[0]) && resume_wait) { | ||
732 | int partno; | ||
733 | while (!get_gendisk(swsusp_resume_device, &partno)) | ||
734 | msleep(10); | ||
735 | } | ||
736 | |||
725 | if (!swsusp_resume_device) { | 737 | if (!swsusp_resume_device) { |
726 | /* | 738 | /* |
727 | * Some device discovery might still be in progress; we need | 739 | * Some device discovery might still be in progress; we need |
@@ -735,13 +747,6 @@ static int software_resume(void) | |||
735 | async_synchronize_full(); | 747 | async_synchronize_full(); |
736 | } | 748 | } |
737 | 749 | ||
738 | /* | ||
739 | * We can't depend on SCSI devices being available after loading | ||
740 | * one of their modules until scsi_complete_async_scans() is | ||
741 | * called and the resume device usually is a SCSI one. | ||
742 | */ | ||
743 | scsi_complete_async_scans(); | ||
744 | |||
745 | swsusp_resume_device = name_to_dev_t(resume_file); | 750 | swsusp_resume_device = name_to_dev_t(resume_file); |
746 | if (!swsusp_resume_device) { | 751 | if (!swsusp_resume_device) { |
747 | error = -ENODEV; | 752 | error = -ENODEV; |