Skip to content

Commit

Permalink
ACPI: remove deprecated ACPI procfs I/F
Browse files Browse the repository at this point in the history
Rmove deprecated ACPI procfs I/F, including
/proc/acpi/debug_layer
/proc/acpi/debug_level
/proc/acpi/info
/proc/acpi/dsdt
/proc/acpi/fadt
/proc/acpi/sleep

because the sysfs I/F is already available
and has been working well for years.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Zhang Rui authored and Len Brown committed Aug 15, 2010
1 parent 1c8fce2 commit 47f5c89
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 484 deletions.
6 changes: 0 additions & 6 deletions drivers/acpi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,6 @@ config ACPI_PROCFS
they have been replaced by functions in /sys.
The deprecated files (and their replacements) include:

/proc/acpi/sleep (/sys/power/state)
/proc/acpi/info (/sys/module/acpi/parameters/acpica_version)
/proc/acpi/dsdt (/sys/firmware/acpi/tables/DSDT)
/proc/acpi/fadt (/sys/firmware/acpi/tables/FACP)
/proc/acpi/debug_layer (/sys/module/acpi/parameters/debug_layer)
/proc/acpi/debug_level (/sys/module/acpi/parameters/debug_level)
/proc/acpi/processor/*/power (/sys/devices/system/cpu/*/cpuidle/*)
/proc/acpi/processor/*/performance (/sys/devices/system/cpu/*/
cpufreq/*)
Expand Down
3 changes: 1 addition & 2 deletions drivers/acpi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@ acpi-y += ec.o
acpi-$(CONFIG_ACPI_DOCK) += dock.o
acpi-y += pci_root.o pci_link.o pci_irq.o pci_bind.o
acpi-y += power.o
acpi-y += system.o event.o
acpi-y += event.o
acpi-y += sysfs.o
acpi-$(CONFIG_ACPI_DEBUG) += debug.o
acpi-$(CONFIG_DEBUG_FS) += debugfs.o
acpi-$(CONFIG_ACPI_NUMA) += numa.o
acpi-$(CONFIG_ACPI_PROCFS_POWER) += cm_sbs.o
Expand Down
2 changes: 0 additions & 2 deletions drivers/acpi/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -1034,8 +1034,6 @@ static int __init acpi_init(void)
acpi_scan_init();
acpi_ec_init();
acpi_power_init();
acpi_system_init();
acpi_debug_init();
acpi_sysfs_init();
acpi_debugfs_init();
acpi_sleep_proc_init();
Expand Down
227 changes: 0 additions & 227 deletions drivers/acpi/debug.c

This file was deleted.

7 changes: 0 additions & 7 deletions drivers/acpi/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,8 @@

int init_acpi_device_notify(void);
int acpi_scan_init(void);
int acpi_system_init(void);
int acpi_sysfs_init(void);

#ifdef CONFIG_ACPI_DEBUG
int acpi_debug_init(void);
#else
static inline int acpi_debug_init(void) { return 0; }
#endif

#ifdef CONFIG_DEBUG_FS
int acpi_debugfs_init(void);
#else
Expand Down
70 changes: 0 additions & 70 deletions drivers/acpi/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,64 +17,11 @@

/*
* this file provides support for:
* /proc/acpi/sleep
* /proc/acpi/alarm
* /proc/acpi/wakeup
*/

ACPI_MODULE_NAME("sleep")
#ifdef CONFIG_ACPI_PROCFS
static int acpi_system_sleep_seq_show(struct seq_file *seq, void *offset)
{
int i;

for (i = 0; i <= ACPI_STATE_S5; i++) {
if (sleep_states[i]) {
seq_printf(seq, "S%d ", i);
}
}

seq_puts(seq, "\n");

return 0;
}

static int acpi_system_sleep_open_fs(struct inode *inode, struct file *file)
{
return single_open(file, acpi_system_sleep_seq_show, PDE(inode)->data);
}

static ssize_t
acpi_system_write_sleep(struct file *file,
const char __user * buffer, size_t count, loff_t * ppos)
{
char str[12];
u32 state = 0;
int error = 0;

if (count > sizeof(str) - 1)
goto Done;
memset(str, 0, sizeof(str));
if (copy_from_user(str, buffer, count))
return -EFAULT;

/* Check for S4 bios request */
if (!strcmp(str, "4b")) {
error = acpi_suspend(4);
goto Done;
}
state = simple_strtoul(str, NULL, 0);
#ifdef CONFIG_HIBERNATION
if (state == 4) {
error = hibernate();
goto Done;
}
#endif
error = acpi_suspend(state);
Done:
return error ? error : count;
}
#endif /* CONFIG_ACPI_PROCFS */

#if defined(CONFIG_RTC_DRV_CMOS) || defined(CONFIG_RTC_DRV_CMOS_MODULE) || !defined(CONFIG_X86)
/* use /sys/class/rtc/rtcX/wakealarm instead; it's not ACPI-specific */
Expand Down Expand Up @@ -463,17 +410,6 @@ static const struct file_operations acpi_system_wakeup_device_fops = {
.release = single_release,
};

#ifdef CONFIG_ACPI_PROCFS
static const struct file_operations acpi_system_sleep_fops = {
.owner = THIS_MODULE,
.open = acpi_system_sleep_open_fs,
.read = seq_read,
.write = acpi_system_write_sleep,
.llseek = seq_lseek,
.release = single_release,
};
#endif /* CONFIG_ACPI_PROCFS */

#ifdef HAVE_ACPI_LEGACY_ALARM
static const struct file_operations acpi_system_alarm_fops = {
.owner = THIS_MODULE,
Expand All @@ -495,12 +431,6 @@ static u32 rtc_handler(void *context)

int __init acpi_sleep_proc_init(void)
{
#ifdef CONFIG_ACPI_PROCFS
/* 'sleep' [R/W] */
proc_create("sleep", S_IFREG | S_IRUGO | S_IWUSR,
acpi_root_dir, &acpi_system_sleep_fops);
#endif /* CONFIG_ACPI_PROCFS */

#ifdef HAVE_ACPI_LEGACY_ALARM
/* 'alarm' [R/W] */
proc_create("alarm", S_IFREG | S_IRUGO | S_IWUSR,
Expand Down
Loading

0 comments on commit 47f5c89

Please sign in to comment.