Loading drivers/acpi/Kconfig +15 −3 Original line number Original line Diff line number Diff line Loading @@ -50,7 +50,6 @@ config ACPI_SLEEP config ACPI_PROCFS config ACPI_PROCFS bool "Deprecated /proc/acpi files" bool "Deprecated /proc/acpi files" depends on PROC_FS depends on PROC_FS default y ---help--- ---help--- For backwards compatibility, this option allows For backwards compatibility, this option allows deprecated /proc/acpi/ files to exist, even when deprecated /proc/acpi/ files to exist, even when Loading @@ -61,7 +60,6 @@ config ACPI_PROCFS /proc/acpi/info (/sys/modules/acpi/parameters/acpica_version) /proc/acpi/info (/sys/modules/acpi/parameters/acpica_version) /proc/acpi/dsdt (/sys/firmware/acpi/tables/DSDT) /proc/acpi/dsdt (/sys/firmware/acpi/tables/DSDT) /proc/acpi/fadt (/sys/firmware/acpi/tables/FACP) /proc/acpi/fadt (/sys/firmware/acpi/tables/FACP) /proc/acpi/battery (/sys/class/power_supply) /proc/acpi/debug_layer (/sys/module/acpi/parameters/debug_layer) /proc/acpi/debug_layer (/sys/module/acpi/parameters/debug_layer) /proc/acpi/debug_level (/sys/module/acpi/parameters/debug_level) /proc/acpi/debug_level (/sys/module/acpi/parameters/debug_level) Loading @@ -69,7 +67,21 @@ config ACPI_PROCFS and functions which do not yet exist in /sys. and functions which do not yet exist in /sys. Say N to delete /proc/acpi/ files that have moved to /sys/ Say N to delete /proc/acpi/ files that have moved to /sys/ config ACPI_PROCFS_POWER bool "Deprecated power /proc/acpi folders" depends on PROC_FS default y ---help--- For backwards compatibility, this option allows deprecated power /proc/acpi/ folders to exist, even when they have been replaced by functions in /sys. The deprecated folders (and their replacements) include: /proc/acpi/battery/* (/sys/class/power_supply/*) /proc/acpi/ac_adapter/* (sys/class/power_supply/*) This option has no effect on /proc/acpi/ folders and functions, which do not yet exist in /sys Say N to delete power /proc/acpi/ folders that have moved to /sys/ config ACPI_PROC_EVENT config ACPI_PROC_EVENT bool "Deprecated /proc/acpi/event support" bool "Deprecated /proc/acpi/event support" depends on PROC_FS depends on PROC_FS Loading drivers/acpi/Makefile +1 −1 Original line number Original line Diff line number Diff line Loading @@ -58,6 +58,6 @@ obj-$(CONFIG_ACPI_NUMA) += numa.o obj-$(CONFIG_ACPI_ASUS) += asus_acpi.o obj-$(CONFIG_ACPI_ASUS) += asus_acpi.o obj-$(CONFIG_ACPI_TOSHIBA) += toshiba_acpi.o obj-$(CONFIG_ACPI_TOSHIBA) += toshiba_acpi.o obj-$(CONFIG_ACPI_HOTPLUG_MEMORY) += acpi_memhotplug.o obj-$(CONFIG_ACPI_HOTPLUG_MEMORY) += acpi_memhotplug.o obj-y += cm_sbs.o obj-$(CONFIG_ACPI_PROCFS_POWER) += cm_sbs.o obj-$(CONFIG_ACPI_SBS) += sbs.o obj-$(CONFIG_ACPI_SBS) += sbs.o obj-$(CONFIG_ACPI_SBS) += sbshc.o obj-$(CONFIG_ACPI_SBS) += sbshc.o drivers/acpi/ac.c +10 −10 Original line number Original line Diff line number Diff line Loading @@ -27,7 +27,7 @@ #include <linux/module.h> #include <linux/module.h> #include <linux/init.h> #include <linux/init.h> #include <linux/types.h> #include <linux/types.h> #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER #include <linux/proc_fs.h> #include <linux/proc_fs.h> #include <linux/seq_file.h> #include <linux/seq_file.h> #endif #endif Loading @@ -51,7 +51,7 @@ MODULE_AUTHOR("Paul Diefenbaugh"); MODULE_DESCRIPTION("ACPI AC Adapter Driver"); MODULE_DESCRIPTION("ACPI AC Adapter Driver"); MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL"); #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER extern struct proc_dir_entry *acpi_lock_ac_dir(void); extern struct proc_dir_entry *acpi_lock_ac_dir(void); extern void *acpi_unlock_ac_dir(struct proc_dir_entry *acpi_ac_dir); extern void *acpi_unlock_ac_dir(struct proc_dir_entry *acpi_ac_dir); static int acpi_ac_open_fs(struct inode *inode, struct file *file); static int acpi_ac_open_fs(struct inode *inode, struct file *file); Loading Loading @@ -86,7 +86,7 @@ struct acpi_ac { #define to_acpi_ac(x) container_of(x, struct acpi_ac, charger); #define to_acpi_ac(x) container_of(x, struct acpi_ac, charger); #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER static const struct file_operations acpi_ac_fops = { static const struct file_operations acpi_ac_fops = { .open = acpi_ac_open_fs, .open = acpi_ac_open_fs, .read = seq_read, .read = seq_read, Loading Loading @@ -136,7 +136,7 @@ static int acpi_ac_get_state(struct acpi_ac *ac) return 0; return 0; } } #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER /* -------------------------------------------------------------------------- /* -------------------------------------------------------------------------- FS Interface (/proc) FS Interface (/proc) -------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */ Loading Loading @@ -275,7 +275,7 @@ static int acpi_ac_add(struct acpi_device *device) if (result) if (result) goto end; goto end; #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER result = acpi_ac_add_fs(device); result = acpi_ac_add_fs(device); #endif #endif if (result) if (result) Loading @@ -300,7 +300,7 @@ static int acpi_ac_add(struct acpi_device *device) end: end: if (result) { if (result) { #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER acpi_ac_remove_fs(device); acpi_ac_remove_fs(device); #endif #endif kfree(ac); kfree(ac); Loading Loading @@ -339,7 +339,7 @@ static int acpi_ac_remove(struct acpi_device *device, int type) ACPI_ALL_NOTIFY, acpi_ac_notify); ACPI_ALL_NOTIFY, acpi_ac_notify); if (ac->charger.dev) if (ac->charger.dev) power_supply_unregister(&ac->charger); power_supply_unregister(&ac->charger); #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER acpi_ac_remove_fs(device); acpi_ac_remove_fs(device); #endif #endif Loading @@ -355,7 +355,7 @@ static int __init acpi_ac_init(void) if (acpi_disabled) if (acpi_disabled) return -ENODEV; return -ENODEV; #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER acpi_ac_dir = acpi_lock_ac_dir(); acpi_ac_dir = acpi_lock_ac_dir(); if (!acpi_ac_dir) if (!acpi_ac_dir) return -ENODEV; return -ENODEV; Loading @@ -363,7 +363,7 @@ static int __init acpi_ac_init(void) result = acpi_bus_register_driver(&acpi_ac_driver); result = acpi_bus_register_driver(&acpi_ac_driver); if (result < 0) { if (result < 0) { #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER acpi_unlock_ac_dir(acpi_ac_dir); acpi_unlock_ac_dir(acpi_ac_dir); #endif #endif return -ENODEV; return -ENODEV; Loading @@ -377,7 +377,7 @@ static void __exit acpi_ac_exit(void) acpi_bus_unregister_driver(&acpi_ac_driver); acpi_bus_unregister_driver(&acpi_ac_driver); #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER acpi_unlock_ac_dir(acpi_ac_dir); acpi_unlock_ac_dir(acpi_ac_dir); #endif #endif Loading drivers/acpi/battery.c +10 −10 Original line number Original line Diff line number Diff line Loading @@ -31,7 +31,7 @@ #include <linux/types.h> #include <linux/types.h> #include <linux/jiffies.h> #include <linux/jiffies.h> #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER #include <linux/proc_fs.h> #include <linux/proc_fs.h> #include <linux/seq_file.h> #include <linux/seq_file.h> #include <asm/uaccess.h> #include <asm/uaccess.h> Loading Loading @@ -63,7 +63,7 @@ static unsigned int cache_time = 1000; module_param(cache_time, uint, 0644); module_param(cache_time, uint, 0644); MODULE_PARM_DESC(cache_time, "cache time in milliseconds"); MODULE_PARM_DESC(cache_time, "cache time in milliseconds"); #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER extern struct proc_dir_entry *acpi_lock_battery_dir(void); extern struct proc_dir_entry *acpi_lock_battery_dir(void); extern void *acpi_unlock_battery_dir(struct proc_dir_entry *acpi_battery_dir); extern void *acpi_unlock_battery_dir(struct proc_dir_entry *acpi_battery_dir); Loading Loading @@ -223,7 +223,7 @@ static enum power_supply_property energy_battery_props[] = { POWER_SUPPLY_PROP_MANUFACTURER, POWER_SUPPLY_PROP_MANUFACTURER, }; }; #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER inline char *acpi_battery_units(struct acpi_battery *battery) inline char *acpi_battery_units(struct acpi_battery *battery) { { return (battery->power_unit)?"mA":"mW"; return (battery->power_unit)?"mA":"mW"; Loading Loading @@ -481,7 +481,7 @@ static int acpi_battery_update(struct acpi_battery *battery) FS Interface (/proc) FS Interface (/proc) -------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */ #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER static struct proc_dir_entry *acpi_battery_dir; static struct proc_dir_entry *acpi_battery_dir; static int acpi_battery_print_info(struct seq_file *seq, int result) static int acpi_battery_print_info(struct seq_file *seq, int result) Loading Loading @@ -788,7 +788,7 @@ static int acpi_battery_add(struct acpi_device *device) acpi_driver_data(device) = battery; acpi_driver_data(device) = battery; mutex_init(&battery->lock); mutex_init(&battery->lock); acpi_battery_update(battery); acpi_battery_update(battery); #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER result = acpi_battery_add_fs(device); result = acpi_battery_add_fs(device); if (result) if (result) goto end; goto end; Loading @@ -806,7 +806,7 @@ static int acpi_battery_add(struct acpi_device *device) device->status.battery_present ? "present" : "absent"); device->status.battery_present ? "present" : "absent"); end: end: if (result) { if (result) { #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER acpi_battery_remove_fs(device); acpi_battery_remove_fs(device); #endif #endif kfree(battery); kfree(battery); Loading @@ -825,7 +825,7 @@ static int acpi_battery_remove(struct acpi_device *device, int type) status = acpi_remove_notify_handler(device->handle, status = acpi_remove_notify_handler(device->handle, ACPI_ALL_NOTIFY, ACPI_ALL_NOTIFY, acpi_battery_notify); acpi_battery_notify); #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER acpi_battery_remove_fs(device); acpi_battery_remove_fs(device); #endif #endif sysfs_remove_battery(battery); sysfs_remove_battery(battery); Loading Loading @@ -861,13 +861,13 @@ static int __init acpi_battery_init(void) { { if (acpi_disabled) if (acpi_disabled) return -ENODEV; return -ENODEV; #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER acpi_battery_dir = acpi_lock_battery_dir(); acpi_battery_dir = acpi_lock_battery_dir(); if (!acpi_battery_dir) if (!acpi_battery_dir) return -ENODEV; return -ENODEV; #endif #endif if (acpi_bus_register_driver(&acpi_battery_driver) < 0) { if (acpi_bus_register_driver(&acpi_battery_driver) < 0) { #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER acpi_unlock_battery_dir(acpi_battery_dir); acpi_unlock_battery_dir(acpi_battery_dir); #endif #endif return -ENODEV; return -ENODEV; Loading @@ -878,7 +878,7 @@ static int __init acpi_battery_init(void) static void __exit acpi_battery_exit(void) static void __exit acpi_battery_exit(void) { { acpi_bus_unregister_driver(&acpi_battery_driver); acpi_bus_unregister_driver(&acpi_battery_driver); #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER acpi_unlock_battery_dir(acpi_battery_dir); acpi_unlock_battery_dir(acpi_battery_dir); #endif #endif } } Loading drivers/acpi/sbs.c +10 −10 Original line number Original line Diff line number Diff line Loading @@ -29,7 +29,7 @@ #include <linux/moduleparam.h> #include <linux/moduleparam.h> #include <linux/kernel.h> #include <linux/kernel.h> #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER #include <linux/proc_fs.h> #include <linux/proc_fs.h> #include <linux/seq_file.h> #include <linux/seq_file.h> #include <asm/uaccess.h> #include <asm/uaccess.h> Loading Loading @@ -88,7 +88,7 @@ MODULE_DEVICE_TABLE(acpi, sbs_device_ids); struct acpi_battery { struct acpi_battery { struct power_supply bat; struct power_supply bat; struct acpi_sbs *sbs; struct acpi_sbs *sbs; #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER struct proc_dir_entry *proc_entry; struct proc_dir_entry *proc_entry; #endif #endif unsigned long update_time; unsigned long update_time; Loading Loading @@ -123,7 +123,7 @@ struct acpi_sbs { struct acpi_device *device; struct acpi_device *device; struct acpi_smb_hc *hc; struct acpi_smb_hc *hc; struct mutex lock; struct mutex lock; #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER struct proc_dir_entry *charger_entry; struct proc_dir_entry *charger_entry; #endif #endif struct acpi_battery battery[MAX_SBS_BAT]; struct acpi_battery battery[MAX_SBS_BAT]; Loading Loading @@ -469,7 +469,7 @@ static struct device_attribute alarm_attr = { FS Interface (/proc/acpi) FS Interface (/proc/acpi) -------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */ #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER /* Generic Routines */ /* Generic Routines */ static int static int acpi_sbs_add_fs(struct proc_dir_entry **dir, acpi_sbs_add_fs(struct proc_dir_entry **dir, Loading Loading @@ -790,7 +790,7 @@ static int acpi_battery_add(struct acpi_sbs *sbs, int id) return result; return result; sprintf(battery->name, ACPI_BATTERY_DIR_NAME, id); sprintf(battery->name, ACPI_BATTERY_DIR_NAME, id); #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER acpi_sbs_add_fs(&battery->proc_entry, acpi_battery_dir, acpi_sbs_add_fs(&battery->proc_entry, acpi_battery_dir, battery->name, &acpi_battery_info_fops, battery->name, &acpi_battery_info_fops, &acpi_battery_state_fops, &acpi_battery_alarm_fops, &acpi_battery_state_fops, &acpi_battery_alarm_fops, Loading Loading @@ -831,7 +831,7 @@ static void acpi_battery_remove(struct acpi_sbs *sbs, int id) device_remove_file(battery->bat.dev, &alarm_attr); device_remove_file(battery->bat.dev, &alarm_attr); power_supply_unregister(&battery->bat); power_supply_unregister(&battery->bat); } } #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER if (battery->proc_entry) if (battery->proc_entry) acpi_sbs_remove_fs(&battery->proc_entry, acpi_battery_dir); acpi_sbs_remove_fs(&battery->proc_entry, acpi_battery_dir); #endif #endif Loading @@ -844,7 +844,7 @@ static int acpi_charger_add(struct acpi_sbs *sbs) result = acpi_ac_get_present(sbs); result = acpi_ac_get_present(sbs); if (result) if (result) goto end; goto end; #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER result = acpi_sbs_add_fs(&sbs->charger_entry, acpi_ac_dir, result = acpi_sbs_add_fs(&sbs->charger_entry, acpi_ac_dir, ACPI_AC_DIR_NAME, NULL, ACPI_AC_DIR_NAME, NULL, &acpi_ac_state_fops, NULL, sbs); &acpi_ac_state_fops, NULL, sbs); Loading @@ -868,7 +868,7 @@ static void acpi_charger_remove(struct acpi_sbs *sbs) { { if (sbs->charger.dev) if (sbs->charger.dev) power_supply_unregister(&sbs->charger); power_supply_unregister(&sbs->charger); #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER if (sbs->charger_entry) if (sbs->charger_entry) acpi_sbs_remove_fs(&sbs->charger_entry, acpi_ac_dir); acpi_sbs_remove_fs(&sbs->charger_entry, acpi_ac_dir); #endif #endif Loading Loading @@ -974,7 +974,7 @@ static int acpi_sbs_remove(struct acpi_device *device, int type) static void acpi_sbs_rmdirs(void) static void acpi_sbs_rmdirs(void) { { #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER if (acpi_ac_dir) { if (acpi_ac_dir) { acpi_unlock_ac_dir(acpi_ac_dir); acpi_unlock_ac_dir(acpi_ac_dir); acpi_ac_dir = NULL; acpi_ac_dir = NULL; Loading Loading @@ -1013,7 +1013,7 @@ static int __init acpi_sbs_init(void) if (acpi_disabled) if (acpi_disabled) return -ENODEV; return -ENODEV; #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER acpi_ac_dir = acpi_lock_ac_dir(); acpi_ac_dir = acpi_lock_ac_dir(); if (!acpi_ac_dir) if (!acpi_ac_dir) return -ENODEV; return -ENODEV; Loading Loading
drivers/acpi/Kconfig +15 −3 Original line number Original line Diff line number Diff line Loading @@ -50,7 +50,6 @@ config ACPI_SLEEP config ACPI_PROCFS config ACPI_PROCFS bool "Deprecated /proc/acpi files" bool "Deprecated /proc/acpi files" depends on PROC_FS depends on PROC_FS default y ---help--- ---help--- For backwards compatibility, this option allows For backwards compatibility, this option allows deprecated /proc/acpi/ files to exist, even when deprecated /proc/acpi/ files to exist, even when Loading @@ -61,7 +60,6 @@ config ACPI_PROCFS /proc/acpi/info (/sys/modules/acpi/parameters/acpica_version) /proc/acpi/info (/sys/modules/acpi/parameters/acpica_version) /proc/acpi/dsdt (/sys/firmware/acpi/tables/DSDT) /proc/acpi/dsdt (/sys/firmware/acpi/tables/DSDT) /proc/acpi/fadt (/sys/firmware/acpi/tables/FACP) /proc/acpi/fadt (/sys/firmware/acpi/tables/FACP) /proc/acpi/battery (/sys/class/power_supply) /proc/acpi/debug_layer (/sys/module/acpi/parameters/debug_layer) /proc/acpi/debug_layer (/sys/module/acpi/parameters/debug_layer) /proc/acpi/debug_level (/sys/module/acpi/parameters/debug_level) /proc/acpi/debug_level (/sys/module/acpi/parameters/debug_level) Loading @@ -69,7 +67,21 @@ config ACPI_PROCFS and functions which do not yet exist in /sys. and functions which do not yet exist in /sys. Say N to delete /proc/acpi/ files that have moved to /sys/ Say N to delete /proc/acpi/ files that have moved to /sys/ config ACPI_PROCFS_POWER bool "Deprecated power /proc/acpi folders" depends on PROC_FS default y ---help--- For backwards compatibility, this option allows deprecated power /proc/acpi/ folders to exist, even when they have been replaced by functions in /sys. The deprecated folders (and their replacements) include: /proc/acpi/battery/* (/sys/class/power_supply/*) /proc/acpi/ac_adapter/* (sys/class/power_supply/*) This option has no effect on /proc/acpi/ folders and functions, which do not yet exist in /sys Say N to delete power /proc/acpi/ folders that have moved to /sys/ config ACPI_PROC_EVENT config ACPI_PROC_EVENT bool "Deprecated /proc/acpi/event support" bool "Deprecated /proc/acpi/event support" depends on PROC_FS depends on PROC_FS Loading
drivers/acpi/Makefile +1 −1 Original line number Original line Diff line number Diff line Loading @@ -58,6 +58,6 @@ obj-$(CONFIG_ACPI_NUMA) += numa.o obj-$(CONFIG_ACPI_ASUS) += asus_acpi.o obj-$(CONFIG_ACPI_ASUS) += asus_acpi.o obj-$(CONFIG_ACPI_TOSHIBA) += toshiba_acpi.o obj-$(CONFIG_ACPI_TOSHIBA) += toshiba_acpi.o obj-$(CONFIG_ACPI_HOTPLUG_MEMORY) += acpi_memhotplug.o obj-$(CONFIG_ACPI_HOTPLUG_MEMORY) += acpi_memhotplug.o obj-y += cm_sbs.o obj-$(CONFIG_ACPI_PROCFS_POWER) += cm_sbs.o obj-$(CONFIG_ACPI_SBS) += sbs.o obj-$(CONFIG_ACPI_SBS) += sbs.o obj-$(CONFIG_ACPI_SBS) += sbshc.o obj-$(CONFIG_ACPI_SBS) += sbshc.o
drivers/acpi/ac.c +10 −10 Original line number Original line Diff line number Diff line Loading @@ -27,7 +27,7 @@ #include <linux/module.h> #include <linux/module.h> #include <linux/init.h> #include <linux/init.h> #include <linux/types.h> #include <linux/types.h> #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER #include <linux/proc_fs.h> #include <linux/proc_fs.h> #include <linux/seq_file.h> #include <linux/seq_file.h> #endif #endif Loading @@ -51,7 +51,7 @@ MODULE_AUTHOR("Paul Diefenbaugh"); MODULE_DESCRIPTION("ACPI AC Adapter Driver"); MODULE_DESCRIPTION("ACPI AC Adapter Driver"); MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL"); #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER extern struct proc_dir_entry *acpi_lock_ac_dir(void); extern struct proc_dir_entry *acpi_lock_ac_dir(void); extern void *acpi_unlock_ac_dir(struct proc_dir_entry *acpi_ac_dir); extern void *acpi_unlock_ac_dir(struct proc_dir_entry *acpi_ac_dir); static int acpi_ac_open_fs(struct inode *inode, struct file *file); static int acpi_ac_open_fs(struct inode *inode, struct file *file); Loading Loading @@ -86,7 +86,7 @@ struct acpi_ac { #define to_acpi_ac(x) container_of(x, struct acpi_ac, charger); #define to_acpi_ac(x) container_of(x, struct acpi_ac, charger); #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER static const struct file_operations acpi_ac_fops = { static const struct file_operations acpi_ac_fops = { .open = acpi_ac_open_fs, .open = acpi_ac_open_fs, .read = seq_read, .read = seq_read, Loading Loading @@ -136,7 +136,7 @@ static int acpi_ac_get_state(struct acpi_ac *ac) return 0; return 0; } } #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER /* -------------------------------------------------------------------------- /* -------------------------------------------------------------------------- FS Interface (/proc) FS Interface (/proc) -------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */ Loading Loading @@ -275,7 +275,7 @@ static int acpi_ac_add(struct acpi_device *device) if (result) if (result) goto end; goto end; #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER result = acpi_ac_add_fs(device); result = acpi_ac_add_fs(device); #endif #endif if (result) if (result) Loading @@ -300,7 +300,7 @@ static int acpi_ac_add(struct acpi_device *device) end: end: if (result) { if (result) { #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER acpi_ac_remove_fs(device); acpi_ac_remove_fs(device); #endif #endif kfree(ac); kfree(ac); Loading Loading @@ -339,7 +339,7 @@ static int acpi_ac_remove(struct acpi_device *device, int type) ACPI_ALL_NOTIFY, acpi_ac_notify); ACPI_ALL_NOTIFY, acpi_ac_notify); if (ac->charger.dev) if (ac->charger.dev) power_supply_unregister(&ac->charger); power_supply_unregister(&ac->charger); #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER acpi_ac_remove_fs(device); acpi_ac_remove_fs(device); #endif #endif Loading @@ -355,7 +355,7 @@ static int __init acpi_ac_init(void) if (acpi_disabled) if (acpi_disabled) return -ENODEV; return -ENODEV; #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER acpi_ac_dir = acpi_lock_ac_dir(); acpi_ac_dir = acpi_lock_ac_dir(); if (!acpi_ac_dir) if (!acpi_ac_dir) return -ENODEV; return -ENODEV; Loading @@ -363,7 +363,7 @@ static int __init acpi_ac_init(void) result = acpi_bus_register_driver(&acpi_ac_driver); result = acpi_bus_register_driver(&acpi_ac_driver); if (result < 0) { if (result < 0) { #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER acpi_unlock_ac_dir(acpi_ac_dir); acpi_unlock_ac_dir(acpi_ac_dir); #endif #endif return -ENODEV; return -ENODEV; Loading @@ -377,7 +377,7 @@ static void __exit acpi_ac_exit(void) acpi_bus_unregister_driver(&acpi_ac_driver); acpi_bus_unregister_driver(&acpi_ac_driver); #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER acpi_unlock_ac_dir(acpi_ac_dir); acpi_unlock_ac_dir(acpi_ac_dir); #endif #endif Loading
drivers/acpi/battery.c +10 −10 Original line number Original line Diff line number Diff line Loading @@ -31,7 +31,7 @@ #include <linux/types.h> #include <linux/types.h> #include <linux/jiffies.h> #include <linux/jiffies.h> #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER #include <linux/proc_fs.h> #include <linux/proc_fs.h> #include <linux/seq_file.h> #include <linux/seq_file.h> #include <asm/uaccess.h> #include <asm/uaccess.h> Loading Loading @@ -63,7 +63,7 @@ static unsigned int cache_time = 1000; module_param(cache_time, uint, 0644); module_param(cache_time, uint, 0644); MODULE_PARM_DESC(cache_time, "cache time in milliseconds"); MODULE_PARM_DESC(cache_time, "cache time in milliseconds"); #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER extern struct proc_dir_entry *acpi_lock_battery_dir(void); extern struct proc_dir_entry *acpi_lock_battery_dir(void); extern void *acpi_unlock_battery_dir(struct proc_dir_entry *acpi_battery_dir); extern void *acpi_unlock_battery_dir(struct proc_dir_entry *acpi_battery_dir); Loading Loading @@ -223,7 +223,7 @@ static enum power_supply_property energy_battery_props[] = { POWER_SUPPLY_PROP_MANUFACTURER, POWER_SUPPLY_PROP_MANUFACTURER, }; }; #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER inline char *acpi_battery_units(struct acpi_battery *battery) inline char *acpi_battery_units(struct acpi_battery *battery) { { return (battery->power_unit)?"mA":"mW"; return (battery->power_unit)?"mA":"mW"; Loading Loading @@ -481,7 +481,7 @@ static int acpi_battery_update(struct acpi_battery *battery) FS Interface (/proc) FS Interface (/proc) -------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */ #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER static struct proc_dir_entry *acpi_battery_dir; static struct proc_dir_entry *acpi_battery_dir; static int acpi_battery_print_info(struct seq_file *seq, int result) static int acpi_battery_print_info(struct seq_file *seq, int result) Loading Loading @@ -788,7 +788,7 @@ static int acpi_battery_add(struct acpi_device *device) acpi_driver_data(device) = battery; acpi_driver_data(device) = battery; mutex_init(&battery->lock); mutex_init(&battery->lock); acpi_battery_update(battery); acpi_battery_update(battery); #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER result = acpi_battery_add_fs(device); result = acpi_battery_add_fs(device); if (result) if (result) goto end; goto end; Loading @@ -806,7 +806,7 @@ static int acpi_battery_add(struct acpi_device *device) device->status.battery_present ? "present" : "absent"); device->status.battery_present ? "present" : "absent"); end: end: if (result) { if (result) { #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER acpi_battery_remove_fs(device); acpi_battery_remove_fs(device); #endif #endif kfree(battery); kfree(battery); Loading @@ -825,7 +825,7 @@ static int acpi_battery_remove(struct acpi_device *device, int type) status = acpi_remove_notify_handler(device->handle, status = acpi_remove_notify_handler(device->handle, ACPI_ALL_NOTIFY, ACPI_ALL_NOTIFY, acpi_battery_notify); acpi_battery_notify); #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER acpi_battery_remove_fs(device); acpi_battery_remove_fs(device); #endif #endif sysfs_remove_battery(battery); sysfs_remove_battery(battery); Loading Loading @@ -861,13 +861,13 @@ static int __init acpi_battery_init(void) { { if (acpi_disabled) if (acpi_disabled) return -ENODEV; return -ENODEV; #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER acpi_battery_dir = acpi_lock_battery_dir(); acpi_battery_dir = acpi_lock_battery_dir(); if (!acpi_battery_dir) if (!acpi_battery_dir) return -ENODEV; return -ENODEV; #endif #endif if (acpi_bus_register_driver(&acpi_battery_driver) < 0) { if (acpi_bus_register_driver(&acpi_battery_driver) < 0) { #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER acpi_unlock_battery_dir(acpi_battery_dir); acpi_unlock_battery_dir(acpi_battery_dir); #endif #endif return -ENODEV; return -ENODEV; Loading @@ -878,7 +878,7 @@ static int __init acpi_battery_init(void) static void __exit acpi_battery_exit(void) static void __exit acpi_battery_exit(void) { { acpi_bus_unregister_driver(&acpi_battery_driver); acpi_bus_unregister_driver(&acpi_battery_driver); #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER acpi_unlock_battery_dir(acpi_battery_dir); acpi_unlock_battery_dir(acpi_battery_dir); #endif #endif } } Loading
drivers/acpi/sbs.c +10 −10 Original line number Original line Diff line number Diff line Loading @@ -29,7 +29,7 @@ #include <linux/moduleparam.h> #include <linux/moduleparam.h> #include <linux/kernel.h> #include <linux/kernel.h> #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER #include <linux/proc_fs.h> #include <linux/proc_fs.h> #include <linux/seq_file.h> #include <linux/seq_file.h> #include <asm/uaccess.h> #include <asm/uaccess.h> Loading Loading @@ -88,7 +88,7 @@ MODULE_DEVICE_TABLE(acpi, sbs_device_ids); struct acpi_battery { struct acpi_battery { struct power_supply bat; struct power_supply bat; struct acpi_sbs *sbs; struct acpi_sbs *sbs; #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER struct proc_dir_entry *proc_entry; struct proc_dir_entry *proc_entry; #endif #endif unsigned long update_time; unsigned long update_time; Loading Loading @@ -123,7 +123,7 @@ struct acpi_sbs { struct acpi_device *device; struct acpi_device *device; struct acpi_smb_hc *hc; struct acpi_smb_hc *hc; struct mutex lock; struct mutex lock; #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER struct proc_dir_entry *charger_entry; struct proc_dir_entry *charger_entry; #endif #endif struct acpi_battery battery[MAX_SBS_BAT]; struct acpi_battery battery[MAX_SBS_BAT]; Loading Loading @@ -469,7 +469,7 @@ static struct device_attribute alarm_attr = { FS Interface (/proc/acpi) FS Interface (/proc/acpi) -------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */ #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER /* Generic Routines */ /* Generic Routines */ static int static int acpi_sbs_add_fs(struct proc_dir_entry **dir, acpi_sbs_add_fs(struct proc_dir_entry **dir, Loading Loading @@ -790,7 +790,7 @@ static int acpi_battery_add(struct acpi_sbs *sbs, int id) return result; return result; sprintf(battery->name, ACPI_BATTERY_DIR_NAME, id); sprintf(battery->name, ACPI_BATTERY_DIR_NAME, id); #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER acpi_sbs_add_fs(&battery->proc_entry, acpi_battery_dir, acpi_sbs_add_fs(&battery->proc_entry, acpi_battery_dir, battery->name, &acpi_battery_info_fops, battery->name, &acpi_battery_info_fops, &acpi_battery_state_fops, &acpi_battery_alarm_fops, &acpi_battery_state_fops, &acpi_battery_alarm_fops, Loading Loading @@ -831,7 +831,7 @@ static void acpi_battery_remove(struct acpi_sbs *sbs, int id) device_remove_file(battery->bat.dev, &alarm_attr); device_remove_file(battery->bat.dev, &alarm_attr); power_supply_unregister(&battery->bat); power_supply_unregister(&battery->bat); } } #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER if (battery->proc_entry) if (battery->proc_entry) acpi_sbs_remove_fs(&battery->proc_entry, acpi_battery_dir); acpi_sbs_remove_fs(&battery->proc_entry, acpi_battery_dir); #endif #endif Loading @@ -844,7 +844,7 @@ static int acpi_charger_add(struct acpi_sbs *sbs) result = acpi_ac_get_present(sbs); result = acpi_ac_get_present(sbs); if (result) if (result) goto end; goto end; #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER result = acpi_sbs_add_fs(&sbs->charger_entry, acpi_ac_dir, result = acpi_sbs_add_fs(&sbs->charger_entry, acpi_ac_dir, ACPI_AC_DIR_NAME, NULL, ACPI_AC_DIR_NAME, NULL, &acpi_ac_state_fops, NULL, sbs); &acpi_ac_state_fops, NULL, sbs); Loading @@ -868,7 +868,7 @@ static void acpi_charger_remove(struct acpi_sbs *sbs) { { if (sbs->charger.dev) if (sbs->charger.dev) power_supply_unregister(&sbs->charger); power_supply_unregister(&sbs->charger); #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER if (sbs->charger_entry) if (sbs->charger_entry) acpi_sbs_remove_fs(&sbs->charger_entry, acpi_ac_dir); acpi_sbs_remove_fs(&sbs->charger_entry, acpi_ac_dir); #endif #endif Loading Loading @@ -974,7 +974,7 @@ static int acpi_sbs_remove(struct acpi_device *device, int type) static void acpi_sbs_rmdirs(void) static void acpi_sbs_rmdirs(void) { { #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER if (acpi_ac_dir) { if (acpi_ac_dir) { acpi_unlock_ac_dir(acpi_ac_dir); acpi_unlock_ac_dir(acpi_ac_dir); acpi_ac_dir = NULL; acpi_ac_dir = NULL; Loading Loading @@ -1013,7 +1013,7 @@ static int __init acpi_sbs_init(void) if (acpi_disabled) if (acpi_disabled) return -ENODEV; return -ENODEV; #ifdef CONFIG_ACPI_PROCFS #ifdef CONFIG_ACPI_PROCFS_POWER acpi_ac_dir = acpi_lock_ac_dir(); acpi_ac_dir = acpi_lock_ac_dir(); if (!acpi_ac_dir) if (!acpi_ac_dir) return -ENODEV; return -ENODEV; Loading