Commit 93e8f330 authored by Patrick Mochel's avatar Patrick Mochel

remove kernel/platform.c

This was never used, and a bad idea to begin with. 
parent d977f5ed
......@@ -3,13 +3,13 @@
#
export-objs = signal.o sys.o kmod.o workqueue.o ksyms.o pm.o exec_domain.o \
printk.o platform.o suspend.o dma.o module.o cpufreq.o \
printk.o suspend.o dma.o module.o cpufreq.o \
profile.o rcupdate.o intermodule.o params.o
obj-y = sched.o fork.o exec_domain.o panic.o printk.o profile.o \
exit.o itimer.o time.o softirq.o resource.o \
sysctl.o capability.o ptrace.o timer.o user.o \
signal.o sys.o kmod.o workqueue.o futex.o platform.o pid.o \
signal.o sys.o kmod.o workqueue.o futex.o pid.o \
rcupdate.o intermodule.o extable.o params.o
obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o
......
/*
* platform driver support
*/
#include <linux/platform.h>
#include <linux/module.h>
#include <linux/errno.h>
void default_reboot(char * cmd)
{
/* nothing */
}
void default_halt(void)
{
/* nothing */
}
int default_suspend(int state, int flags)
{
return -ENOSYS;
}
static struct platform_t default_platform = {
.name = "Default Platform",
.suspend_states = 0,
.reboot = default_reboot,
.halt = default_halt,
.power_off = default_halt,
.suspend = default_suspend,
.idle = default_idle,
};
struct platform_t * platform = &default_platform;
static spinlock_t platform_lock = SPIN_LOCK_UNLOCKED;
/**
* set_platform_driver - set the platform driver.
* @pf: driver to set it to
*
* Return -EEXIST if someone else already owns it.
*/
int set_platform_driver(struct platform_t * pf)
{
if (!pf)
return -EINVAL;
spin_lock(&platform_lock);
if (platform != &default_platform) {
spin_unlock(&platform_lock);
return -EEXIST;
}
platform = pf;
spin_unlock(&platform_lock);
return 0;
}
void remove_platform_driver(struct platform_t * pf)
{
spin_lock(&platform_lock);
if (platform == pf)
platform = &default_platform;
spin_unlock(&platform_lock);
}
EXPORT_SYMBOL(default_reboot);
EXPORT_SYMBOL(default_halt);
EXPORT_SYMBOL(default_suspend);
EXPORT_SYMBOL(platform);
EXPORT_SYMBOL(set_platform_driver);
EXPORT_SYMBOL(remove_platform_driver);
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