mirror of https://gitee.com/openkylin/linux.git
s390/xpram: Remove power management support
Power management support was removed for s390 with
commit 394216275c
("s390: remove broken hibernate / power management
support").
Remove leftover xpram-related power management code.
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
This commit is contained in:
parent
e2f4d7b55b
commit
28ac9b195d
|
@ -39,8 +39,6 @@
|
|||
#include <linux/hdreg.h> /* HDIO_GETGEO */
|
||||
#include <linux/device.h>
|
||||
#include <linux/bio.h>
|
||||
#include <linux/suspend.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/gfp.h>
|
||||
#include <linux/uaccess.h>
|
||||
|
||||
|
@ -141,7 +139,7 @@ static long xpram_page_out (unsigned long page_addr, unsigned int xpage_index)
|
|||
/*
|
||||
* Check if xpram is available.
|
||||
*/
|
||||
static int xpram_present(void)
|
||||
static int __init xpram_present(void)
|
||||
{
|
||||
unsigned long mem_page;
|
||||
int rc;
|
||||
|
@ -157,7 +155,7 @@ static int xpram_present(void)
|
|||
/*
|
||||
* Return index of the last available xpram page.
|
||||
*/
|
||||
static unsigned long xpram_highest_page_index(void)
|
||||
static unsigned long __init xpram_highest_page_index(void)
|
||||
{
|
||||
unsigned int page_index, add_bit;
|
||||
unsigned long mem_page;
|
||||
|
@ -390,42 +388,6 @@ static int __init xpram_setup_blkdev(void)
|
|||
return rc;
|
||||
}
|
||||
|
||||
/*
|
||||
* Resume failed: Print error message and call panic.
|
||||
*/
|
||||
static void xpram_resume_error(const char *message)
|
||||
{
|
||||
pr_err("Resuming the system failed: %s\n", message);
|
||||
panic("xpram resume error\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if xpram setup changed between suspend and resume.
|
||||
*/
|
||||
static int xpram_restore(struct device *dev)
|
||||
{
|
||||
if (!xpram_pages)
|
||||
return 0;
|
||||
if (xpram_present() != 0)
|
||||
xpram_resume_error("xpram disappeared");
|
||||
if (xpram_pages != xpram_highest_page_index() + 1)
|
||||
xpram_resume_error("Size of xpram changed");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct dev_pm_ops xpram_pm_ops = {
|
||||
.restore = xpram_restore,
|
||||
};
|
||||
|
||||
static struct platform_driver xpram_pdrv = {
|
||||
.driver = {
|
||||
.name = XPRAM_NAME,
|
||||
.pm = &xpram_pm_ops,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device *xpram_pdev;
|
||||
|
||||
/*
|
||||
* Finally, the init/exit functions.
|
||||
*/
|
||||
|
@ -438,8 +400,6 @@ static void __exit xpram_exit(void)
|
|||
put_disk(xpram_disks[i]);
|
||||
}
|
||||
unregister_blkdev(XPRAM_MAJOR, XPRAM_NAME);
|
||||
platform_device_unregister(xpram_pdev);
|
||||
platform_driver_unregister(&xpram_pdrv);
|
||||
}
|
||||
|
||||
static int __init xpram_init(void)
|
||||
|
@ -457,24 +417,7 @@ static int __init xpram_init(void)
|
|||
rc = xpram_setup_sizes(xpram_pages);
|
||||
if (rc)
|
||||
return rc;
|
||||
rc = platform_driver_register(&xpram_pdrv);
|
||||
if (rc)
|
||||
return rc;
|
||||
xpram_pdev = platform_device_register_simple(XPRAM_NAME, -1, NULL, 0);
|
||||
if (IS_ERR(xpram_pdev)) {
|
||||
rc = PTR_ERR(xpram_pdev);
|
||||
goto fail_platform_driver_unregister;
|
||||
}
|
||||
rc = xpram_setup_blkdev();
|
||||
if (rc)
|
||||
goto fail_platform_device_unregister;
|
||||
return 0;
|
||||
|
||||
fail_platform_device_unregister:
|
||||
platform_device_unregister(xpram_pdev);
|
||||
fail_platform_driver_unregister:
|
||||
platform_driver_unregister(&xpram_pdrv);
|
||||
return rc;
|
||||
return xpram_setup_blkdev();
|
||||
}
|
||||
|
||||
module_init(xpram_init);
|
||||
|
|
Loading…
Reference in New Issue