Skip to content

Commit

Permalink
Merge branches 'acpi-proc', 'acpi-sysfs', 'acpi-pad', 'acpi-ec', 'acp…
Browse files Browse the repository at this point in the history
…i-pci' and 'acpi-prop'

* acpi-proc:
  ACPI: procfs: Remove last dirs after being marked deprecated for a decade

* acpi-sysfs:
  ACPI: sysfs: add newlines when printing module parameters

* acpi-pad:
  ACPI: PAD: Eliminate usage of uninitialized_var() macro

* acpi-ec:
  ACPI: EC: add newline when printing 'ec_event_clearing' module parameter

* acpi-pci:
  PCI: hotplug: ACPI: Fix context refcounting in acpiphp_grab_context()

* acpi-prop:
  ACPI: property: use cached name in acpi_fwnode_get_named_child_node()
  • Loading branch information
Rafael J. Wysocki committed Aug 3, 2020
7 parents 2861ba7 + 8830280 + da85a85 + 134043c + fc293b7 + dae68d7 + cbdd865 commit 3fa5faf
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 492 deletions.
17 changes: 0 additions & 17 deletions drivers/acpi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -99,23 +99,6 @@ config ACPI_SLEEP
depends on ACPI_SYSTEM_POWER_STATES_SUPPORT
default y

config ACPI_PROCFS_POWER
bool "Deprecated power /proc/acpi directories"
depends on X86 && PROC_FS
help
For backwards compatibility, this option allows
deprecated power /proc/acpi/ directories to exist, even when
they have been replaced by functions in /sys.
The deprecated directories (and their replacements) include:
/proc/acpi/battery/* (/sys/class/power_supply/*) and
/proc/acpi/ac_adapter/* (sys/class/power_supply/*).
This option has no effect on /proc/acpi/ directories
and functions which do not yet exist in /sys.
This option, together with the proc directories, will be
deleted in the future.

Say N to delete power /proc/acpi/ directories that have moved to /sys.

config ACPI_REV_OVERRIDE_POSSIBLE
bool "Allow supported ACPI revision to be overridden"
depends on X86
Expand Down
1 change: 0 additions & 1 deletion drivers/acpi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ acpi-$(CONFIG_X86) += acpi_cmos_rtc.o
acpi-$(CONFIG_X86) += x86/apple.o
acpi-$(CONFIG_X86) += x86/utils.o
acpi-$(CONFIG_DEBUG_FS) += debugfs.o
acpi-$(CONFIG_ACPI_PROCFS_POWER) += cm_sbs.o
acpi-y += acpi_lpat.o
acpi-$(CONFIG_ACPI_LPIT) += acpi_lpit.o
acpi-$(CONFIG_ACPI_GENERIC_GSI) += irq.o
Expand Down
106 changes: 0 additions & 106 deletions drivers/acpi/ac.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@
#include <linux/types.h>
#include <linux/dmi.h>
#include <linux/delay.h>
#ifdef CONFIG_ACPI_PROCFS_POWER
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#endif
#include <linux/platform_device.h>
#include <linux/power_supply.h>
#include <linux/acpi.h>
Expand Down Expand Up @@ -66,12 +62,6 @@ static int acpi_ac_resume(struct device *dev);
#endif
static SIMPLE_DEV_PM_OPS(acpi_ac_pm, NULL, acpi_ac_resume);

#ifdef CONFIG_ACPI_PROCFS_POWER
extern struct proc_dir_entry *acpi_lock_ac_dir(void);
extern void *acpi_unlock_ac_dir(struct proc_dir_entry *acpi_ac_dir);
#endif


static int ac_sleep_before_get_state_ms;
static int ac_check_pmic = 1;

Expand Down Expand Up @@ -150,77 +140,6 @@ static enum power_supply_property ac_props[] = {
POWER_SUPPLY_PROP_ONLINE,
};

#ifdef CONFIG_ACPI_PROCFS_POWER
/* --------------------------------------------------------------------------
FS Interface (/proc)
-------------------------------------------------------------------------- */

static struct proc_dir_entry *acpi_ac_dir;

static int acpi_ac_seq_show(struct seq_file *seq, void *offset)
{
struct acpi_ac *ac = seq->private;


if (!ac)
return 0;

if (acpi_ac_get_state(ac)) {
seq_puts(seq, "ERROR: Unable to read AC Adapter state\n");
return 0;
}

seq_puts(seq, "state: ");
switch (ac->state) {
case ACPI_AC_STATUS_OFFLINE:
seq_puts(seq, "off-line\n");
break;
case ACPI_AC_STATUS_ONLINE:
seq_puts(seq, "on-line\n");
break;
default:
seq_puts(seq, "unknown\n");
break;
}

return 0;
}

static int acpi_ac_add_fs(struct acpi_ac *ac)
{
struct proc_dir_entry *entry = NULL;

printk(KERN_WARNING PREFIX "Deprecated procfs I/F for AC is loaded,"
" please retry with CONFIG_ACPI_PROCFS_POWER cleared\n");
if (!acpi_device_dir(ac->device)) {
acpi_device_dir(ac->device) =
proc_mkdir(acpi_device_bid(ac->device), acpi_ac_dir);
if (!acpi_device_dir(ac->device))
return -ENODEV;
}

/* 'state' [R] */
entry = proc_create_single_data(ACPI_AC_FILE_STATE, S_IRUGO,
acpi_device_dir(ac->device), acpi_ac_seq_show, ac);
if (!entry)
return -ENODEV;
return 0;
}

static int acpi_ac_remove_fs(struct acpi_ac *ac)
{

if (acpi_device_dir(ac->device)) {
remove_proc_entry(ACPI_AC_FILE_STATE,
acpi_device_dir(ac->device));
remove_proc_entry(acpi_device_bid(ac->device), acpi_ac_dir);
acpi_device_dir(ac->device) = NULL;
}

return 0;
}
#endif

/* --------------------------------------------------------------------------
Driver Model
-------------------------------------------------------------------------- */
Expand Down Expand Up @@ -348,11 +267,6 @@ static int acpi_ac_add(struct acpi_device *device)
psy_cfg.drv_data = ac;

ac->charger_desc.name = acpi_device_bid(device);
#ifdef CONFIG_ACPI_PROCFS_POWER
result = acpi_ac_add_fs(ac);
if (result)
goto end;
#endif
ac->charger_desc.type = POWER_SUPPLY_TYPE_MAINS;
ac->charger_desc.properties = ac_props;
ac->charger_desc.num_properties = ARRAY_SIZE(ac_props);
Expand All @@ -372,9 +286,6 @@ static int acpi_ac_add(struct acpi_device *device)
register_acpi_notifier(&ac->battery_nb);
end:
if (result) {
#ifdef CONFIG_ACPI_PROCFS_POWER
acpi_ac_remove_fs(ac);
#endif
kfree(ac);
}

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

#ifdef CONFIG_ACPI_PROCFS_POWER
acpi_ac_remove_fs(ac);
#endif

kfree(ac);

return 0;
Expand All @@ -447,18 +354,8 @@ static int __init acpi_ac_init(void)
}
}

#ifdef CONFIG_ACPI_PROCFS_POWER
acpi_ac_dir = acpi_lock_ac_dir();
if (!acpi_ac_dir)
return -ENODEV;
#endif


result = acpi_bus_register_driver(&acpi_ac_driver);
if (result < 0) {
#ifdef CONFIG_ACPI_PROCFS_POWER
acpi_unlock_ac_dir(acpi_ac_dir);
#endif
return -ENODEV;
}

Expand All @@ -468,9 +365,6 @@ static int __init acpi_ac_init(void)
static void __exit acpi_ac_exit(void)
{
acpi_bus_unregister_driver(&acpi_ac_driver);
#ifdef CONFIG_ACPI_PROCFS_POWER
acpi_unlock_ac_dir(acpi_ac_dir);
#endif
}
module_init(acpi_ac_init);
module_exit(acpi_ac_exit);
2 changes: 1 addition & 1 deletion drivers/acpi/acpi_pad.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ static void round_robin_cpu(unsigned int tsk_index)
cpumask_var_t tmp;
int cpu;
unsigned long min_weight = -1;
unsigned long uninitialized_var(preferred_cpu);
unsigned long preferred_cpu;

if (!alloc_cpumask_var(&tmp, GFP_KERNEL))
return;
Expand Down
Loading

0 comments on commit 3fa5faf

Please sign in to comment.