Commit f670dfba authored by Patrick Mochel's avatar Patrick Mochel

[power] Move pm.c and mark functions depcrecated.

- Move kernel/pm.c to kernel/power/pm.c 
- Move poweroff sysrq registration to kernel/power/poweroff.c
- Mark pm_* functions deprecated to prevent new uers. 
parent 49bb8042
......@@ -118,29 +118,29 @@ extern int pm_active;
/*
* Register a device with power management
*/
struct pm_dev *pm_register(pm_dev_t type,
struct pm_dev __deprecated *pm_register(pm_dev_t type,
unsigned long id,
pm_callback callback);
/*
* Unregister a device with power management
*/
void pm_unregister(struct pm_dev *dev);
void __deprecated pm_unregister(struct pm_dev *dev);
/*
* Unregister all devices with matching callback
*/
void pm_unregister_all(pm_callback callback);
void __deprecated pm_unregister_all(pm_callback callback);
/*
* Send a request to a single device
*/
int pm_send(struct pm_dev *dev, pm_request_t rqst, void *data);
int __deprecated pm_send(struct pm_dev *dev, pm_request_t rqst, void *data);
/*
* Send a request to all devices
*/
int pm_send_all(pm_request_t rqst, void *data);
int __deprecated pm_send_all(pm_request_t rqst, void *data);
/*
* Find a device
......
......@@ -14,7 +14,7 @@ obj-$(CONFIG_SMP) += cpu.o
obj-$(CONFIG_UID16) += uid16.o
obj-$(CONFIG_MODULES) += ksyms.o module.o
obj-$(CONFIG_KALLSYMS) += kallsyms.o
obj-$(CONFIG_PM) += pm.o power/
obj-$(CONFIG_PM) += power/
obj-$(CONFIG_CPU_FREQ) += cpufreq.o
obj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o
obj-$(CONFIG_COMPAT) += compat.o
......
obj-y := process.o console.o
obj-y := process.o console.o pm.o
obj-$(CONFIG_SOFTWARE_SUSPEND) += swsusp.o
obj-$(CONFIG_MAGIC_SYSRQ) += poweroff.o
......@@ -24,7 +24,6 @@
#include <linux/slab.h>
#include <linux/pm.h>
#include <linux/interrupt.h>
#include <linux/sysrq.h>
int pm_active;
......@@ -295,39 +294,3 @@ EXPORT_SYMBOL(pm_find);
EXPORT_SYMBOL(pm_active);
#ifdef CONFIG_MAGIC_SYSRQ
/**
* handle_poweroff - sysrq callback for power down
* @key: key pressed (unused)
* @pt_regs: register state (unused)
* @kbd: keyboard state (unused)
* @tty: tty involved (unused)
*
* When the user hits Sys-Rq o to power down the machine this is the
* callback we use.
*/
static void handle_poweroff (int key, struct pt_regs *pt_regs,
struct tty_struct *tty)
{
if (pm_power_off)
pm_power_off();
}
static struct sysrq_key_op sysrq_poweroff_op = {
.handler = handle_poweroff,
.help_msg = "powerOff",
.action_msg = "Power Off\n"
};
#endif /* CONFIG_MAGIC_SYSRQ */
static int pm_init(void)
{
register_sysrq_key('o', &sysrq_poweroff_op);
return 0;
}
subsys_initcall(pm_init);
/*
* poweroff.c - sysrq handler to gracefully power down machine.
*
* This file is released under the GPL v2
*/
#include <linux/kernel.h>
#include <linux/sysrq.h>
#include <linux/init.h>
#include <linux/pm.h>
/**
* handle_poweroff - sysrq callback for power down
* @key: key pressed (unused)
* @pt_regs: register state (unused)
* @kbd: keyboard state (unused)
* @tty: tty involved (unused)
*
* When the user hits Sys-Rq o to power down the machine this is the
* callback we use.
*/
static void handle_poweroff (int key, struct pt_regs *pt_regs,
struct tty_struct *tty)
{
if (pm_power_off)
pm_power_off();
}
static struct sysrq_key_op sysrq_poweroff_op = {
.handler = handle_poweroff,
.help_msg = "powerOff",
.action_msg = "Power Off\n"
};
static int pm_sysrq_init(void)
{
register_sysrq_key('o', &sysrq_poweroff_op);
return 0;
}
subsys_initcall(pm_sysrq_init);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment