• Rafael J. Wysocki's avatar
    swsusp: remove incorrect code from user.c · 127067a9
    Rafael J. Wysocki authored
    In the face of the recent change of suspend code ordering (cf.
    http://marc.info/?l=linux-acpi&m=117938245931603&w=2) 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 remove
    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 be.
    
    The calls to the platform functions removed by this patch are incorrect.  They
    should be replaced with some other "platform" invocations that will be
    introduced in one of the subsequent patches.
    Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
    Acked-by: default avatarPavel Machek <pavel@ucw.cz>
    Cc: Nigel Cunningham <nigel@nigel.suspend2.net>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    127067a9
user.c 9.06 KB