Commit:     127067a9c994dff16b280f409cc7b18a54a63719
Parent:     a0349828d6d6f95c445674c2953ee9db75c11f8f
Author:     Rafael J. Wysocki <[EMAIL PROTECTED]>
AuthorDate: Thu Jul 19 01:47:28 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Thu Jul 19 10:04:42 2007 -0700

    swsusp: remove incorrect code from user.c
    In the face of the recent change of suspend code ordering (cf. we should also modify
    the code ordering in swsusp so that hibernation_ops->prepare() is executed
    after device_suspend().
    However, for this purpose it seems reasonable to eliminate the code
    duplication between kernel/power/disk.c and kernel/power/user.c first.  By
    eliminating it we can reduce the size of user.c quite substantially and 
    the maintenance difficulty with making essentially the same changes in two
    different places.
    Moreover, we should also remove the calls to "platform" functions from the
    restore code path, since it doesn't carry out any power transition of the
    system, but we generally need to disable the GPEs before the restore if the
    'platform' hibernation mode has been used.  To do this, we can introduce two
    new hibernation_ops to be used in the restore code.
    This patch:
    Make the code hibernation code in kernel/power/user.c be functionally
    equivalent to the corresponding code in kernel/power/disk.c , as it should 
    The calls to the platform functions removed by this patch are incorrect.  
    should be replaced with some other "platform" invocations that will be
    introduced in one of the subsequent patches.
    Signed-off-by: Rafael J. Wysocki <[EMAIL PROTECTED]>
    Acked-by: Pavel Machek <[EMAIL PROTECTED]>
    Cc: Nigel Cunningham <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
 kernel/power/user.c |   17 ++++-------------
 1 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/kernel/power/user.c b/kernel/power/user.c
index d65305b..09468ec 100644
--- a/kernel/power/user.c
+++ b/kernel/power/user.c
@@ -181,34 +181,25 @@ static inline int snapshot_suspend(int platform_suspend)
        return error;
-static inline int snapshot_restore(int platform_suspend)
+static inline int snapshot_restore(void)
        int error;
-       if (platform_suspend) {
-               error = platform_prepare();
-               if (error)
-                       goto Finish;
-       }
        error = device_suspend(PMSG_PRETHAW);
        if (error)
-               goto Resume_devices;
+               goto Finish;
        error = disable_nonboot_cpus();
        if (!error)
                error = swsusp_resume();
- Resume_devices:
-       if (platform_suspend)
-               platform_finish();
+ Finish:
- Finish:
        return error;
@@ -274,7 +265,7 @@ static int snapshot_ioctl(struct inode *inode, struct file 
                        error = -EPERM;
-               error = snapshot_restore(data->platform_suspend);
+               error = snapshot_restore();
        case SNAPSHOT_FREE:
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to