Skip to content

Commit 8830280

Browse files
watologo1rafaeljw
authored andcommitted
ACPI: procfs: Remove last dirs after being marked deprecated for a decade
This code is outdated and has been deprecated for a long time, so user space is not expected to rely on it any more on any systems that are up to date by any reasonable measure. Remove it. Signed-off-by: Thomas Renninger <[email protected]> [ rjw: Subject / changelog ] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 4877846 commit 8830280

File tree

5 files changed

+0
-466
lines changed

5 files changed

+0
-466
lines changed

drivers/acpi/Kconfig

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -99,23 +99,6 @@ config ACPI_SLEEP
9999
depends on ACPI_SYSTEM_POWER_STATES_SUPPORT
100100
default y
101101

102-
config ACPI_PROCFS_POWER
103-
bool "Deprecated power /proc/acpi directories"
104-
depends on X86 && PROC_FS
105-
help
106-
For backwards compatibility, this option allows
107-
deprecated power /proc/acpi/ directories to exist, even when
108-
they have been replaced by functions in /sys.
109-
The deprecated directories (and their replacements) include:
110-
/proc/acpi/battery/* (/sys/class/power_supply/*) and
111-
/proc/acpi/ac_adapter/* (sys/class/power_supply/*).
112-
This option has no effect on /proc/acpi/ directories
113-
and functions which do not yet exist in /sys.
114-
This option, together with the proc directories, will be
115-
deleted in the future.
116-
117-
Say N to delete power /proc/acpi/ directories that have moved to /sys.
118-
119102
config ACPI_REV_OVERRIDE_POSSIBLE
120103
bool "Allow supported ACPI revision to be overridden"
121104
depends on X86

drivers/acpi/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ acpi-$(CONFIG_X86) += acpi_cmos_rtc.o
5555
acpi-$(CONFIG_X86) += x86/apple.o
5656
acpi-$(CONFIG_X86) += x86/utils.o
5757
acpi-$(CONFIG_DEBUG_FS) += debugfs.o
58-
acpi-$(CONFIG_ACPI_PROCFS_POWER) += cm_sbs.o
5958
acpi-y += acpi_lpat.o
6059
acpi-$(CONFIG_ACPI_LPIT) += acpi_lpit.o
6160
acpi-$(CONFIG_ACPI_GENERIC_GSI) += irq.o

drivers/acpi/ac.c

Lines changed: 0 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@
1313
#include <linux/types.h>
1414
#include <linux/dmi.h>
1515
#include <linux/delay.h>
16-
#ifdef CONFIG_ACPI_PROCFS_POWER
17-
#include <linux/proc_fs.h>
18-
#include <linux/seq_file.h>
19-
#endif
2016
#include <linux/platform_device.h>
2117
#include <linux/power_supply.h>
2218
#include <linux/acpi.h>
@@ -66,12 +62,6 @@ static int acpi_ac_resume(struct device *dev);
6662
#endif
6763
static SIMPLE_DEV_PM_OPS(acpi_ac_pm, NULL, acpi_ac_resume);
6864

69-
#ifdef CONFIG_ACPI_PROCFS_POWER
70-
extern struct proc_dir_entry *acpi_lock_ac_dir(void);
71-
extern void *acpi_unlock_ac_dir(struct proc_dir_entry *acpi_ac_dir);
72-
#endif
73-
74-
7565
static int ac_sleep_before_get_state_ms;
7666
static int ac_check_pmic = 1;
7767

@@ -150,77 +140,6 @@ static enum power_supply_property ac_props[] = {
150140
POWER_SUPPLY_PROP_ONLINE,
151141
};
152142

153-
#ifdef CONFIG_ACPI_PROCFS_POWER
154-
/* --------------------------------------------------------------------------
155-
FS Interface (/proc)
156-
-------------------------------------------------------------------------- */
157-
158-
static struct proc_dir_entry *acpi_ac_dir;
159-
160-
static int acpi_ac_seq_show(struct seq_file *seq, void *offset)
161-
{
162-
struct acpi_ac *ac = seq->private;
163-
164-
165-
if (!ac)
166-
return 0;
167-
168-
if (acpi_ac_get_state(ac)) {
169-
seq_puts(seq, "ERROR: Unable to read AC Adapter state\n");
170-
return 0;
171-
}
172-
173-
seq_puts(seq, "state: ");
174-
switch (ac->state) {
175-
case ACPI_AC_STATUS_OFFLINE:
176-
seq_puts(seq, "off-line\n");
177-
break;
178-
case ACPI_AC_STATUS_ONLINE:
179-
seq_puts(seq, "on-line\n");
180-
break;
181-
default:
182-
seq_puts(seq, "unknown\n");
183-
break;
184-
}
185-
186-
return 0;
187-
}
188-
189-
static int acpi_ac_add_fs(struct acpi_ac *ac)
190-
{
191-
struct proc_dir_entry *entry = NULL;
192-
193-
printk(KERN_WARNING PREFIX "Deprecated procfs I/F for AC is loaded,"
194-
" please retry with CONFIG_ACPI_PROCFS_POWER cleared\n");
195-
if (!acpi_device_dir(ac->device)) {
196-
acpi_device_dir(ac->device) =
197-
proc_mkdir(acpi_device_bid(ac->device), acpi_ac_dir);
198-
if (!acpi_device_dir(ac->device))
199-
return -ENODEV;
200-
}
201-
202-
/* 'state' [R] */
203-
entry = proc_create_single_data(ACPI_AC_FILE_STATE, S_IRUGO,
204-
acpi_device_dir(ac->device), acpi_ac_seq_show, ac);
205-
if (!entry)
206-
return -ENODEV;
207-
return 0;
208-
}
209-
210-
static int acpi_ac_remove_fs(struct acpi_ac *ac)
211-
{
212-
213-
if (acpi_device_dir(ac->device)) {
214-
remove_proc_entry(ACPI_AC_FILE_STATE,
215-
acpi_device_dir(ac->device));
216-
remove_proc_entry(acpi_device_bid(ac->device), acpi_ac_dir);
217-
acpi_device_dir(ac->device) = NULL;
218-
}
219-
220-
return 0;
221-
}
222-
#endif
223-
224143
/* --------------------------------------------------------------------------
225144
Driver Model
226145
-------------------------------------------------------------------------- */
@@ -348,11 +267,6 @@ static int acpi_ac_add(struct acpi_device *device)
348267
psy_cfg.drv_data = ac;
349268

350269
ac->charger_desc.name = acpi_device_bid(device);
351-
#ifdef CONFIG_ACPI_PROCFS_POWER
352-
result = acpi_ac_add_fs(ac);
353-
if (result)
354-
goto end;
355-
#endif
356270
ac->charger_desc.type = POWER_SUPPLY_TYPE_MAINS;
357271
ac->charger_desc.properties = ac_props;
358272
ac->charger_desc.num_properties = ARRAY_SIZE(ac_props);
@@ -372,9 +286,6 @@ static int acpi_ac_add(struct acpi_device *device)
372286
register_acpi_notifier(&ac->battery_nb);
373287
end:
374288
if (result) {
375-
#ifdef CONFIG_ACPI_PROCFS_POWER
376-
acpi_ac_remove_fs(ac);
377-
#endif
378289
kfree(ac);
379290
}
380291

@@ -418,10 +329,6 @@ static int acpi_ac_remove(struct acpi_device *device)
418329
power_supply_unregister(ac->charger);
419330
unregister_acpi_notifier(&ac->battery_nb);
420331

421-
#ifdef CONFIG_ACPI_PROCFS_POWER
422-
acpi_ac_remove_fs(ac);
423-
#endif
424-
425332
kfree(ac);
426333

427334
return 0;
@@ -447,18 +354,8 @@ static int __init acpi_ac_init(void)
447354
}
448355
}
449356

450-
#ifdef CONFIG_ACPI_PROCFS_POWER
451-
acpi_ac_dir = acpi_lock_ac_dir();
452-
if (!acpi_ac_dir)
453-
return -ENODEV;
454-
#endif
455-
456-
457357
result = acpi_bus_register_driver(&acpi_ac_driver);
458358
if (result < 0) {
459-
#ifdef CONFIG_ACPI_PROCFS_POWER
460-
acpi_unlock_ac_dir(acpi_ac_dir);
461-
#endif
462359
return -ENODEV;
463360
}
464361

@@ -468,9 +365,6 @@ static int __init acpi_ac_init(void)
468365
static void __exit acpi_ac_exit(void)
469366
{
470367
acpi_bus_unregister_driver(&acpi_ac_driver);
471-
#ifdef CONFIG_ACPI_PROCFS_POWER
472-
acpi_unlock_ac_dir(acpi_ac_dir);
473-
#endif
474368
}
475369
module_init(acpi_ac_init);
476370
module_exit(acpi_ac_exit);

0 commit comments

Comments
 (0)