From eb27cae8adaa658a0bf31631baa1ce29d8183759 Mon Sep 17 00:00:00 2001 From: Len Brown Date: Mon, 6 Jul 2009 23:40:19 -0400 Subject: ACPI: linux/acpi.h should not include linux/dmi.h users of acpi.h that need dmi.h should include it directly. Signed-off-by: Len Brown --- drivers/acpi/bus.c | 1 + drivers/acpi/ec.c | 1 + drivers/acpi/pci_slot.c | 1 + drivers/acpi/video.c | 2 +- drivers/pci/dmar.c | 1 + include/linux/acpi.h | 2 -- 6 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 2876fc70c3a..0fb6b2a8b10 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -38,6 +38,7 @@ #include #include #include +#include #include "internal.h" diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index 391f331674c..c434f6571ab 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c @@ -42,6 +42,7 @@ #include #include #include +#include #define ACPI_EC_CLASS "embedded_controller" #define ACPI_EC_DEVICE_NAME "Embedded Controller" diff --git a/drivers/acpi/pci_slot.c b/drivers/acpi/pci_slot.c index 12158e0d009..7aa6802c0ee 100644 --- a/drivers/acpi/pci_slot.c +++ b/drivers/acpi/pci_slot.c @@ -31,6 +31,7 @@ #include #include #include +#include static int debug; static int check_sta_before_sun; diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index 60ea984c84a..055a455b6c7 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c @@ -40,7 +40,7 @@ #include #include #include - +#include #include #include diff --git a/drivers/pci/dmar.c b/drivers/pci/dmar.c index 7b287cb38b7..4484ac08977 100644 --- a/drivers/pci/dmar.c +++ b/drivers/pci/dmar.c @@ -33,6 +33,7 @@ #include #include #include +#include #undef PREFIX #define PREFIX "DMAR:" diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 34321cfffea..7950c65c43a 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -41,8 +41,6 @@ #include #include #include -#include - enum acpi_irq_model_id { ACPI_IRQ_MODEL_PIC = 0, -- cgit v1.2.3 From e4f55966d02c5dfade2978c2aa05fb202a78a4d1 Mon Sep 17 00:00:00 2001 From: Len Brown Date: Mon, 6 Jul 2009 23:42:10 -0400 Subject: ACPI: remove unnecessary #ifdef CONFIG_DMI acpi_osi_setup() does not depend on CONFIG_DMI acpi_dmi_osi_linux()'s definition doesn't depend on CONFIG_DMI either Signed-off-by: Len Brown --- include/linux/acpi.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 7950c65c43a..9260408bf4e 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -217,10 +217,8 @@ static inline int acpi_video_display_switch_support(void) #endif /* defined(CONFIG_ACPI_VIDEO) || defined(CONFIG_ACPI_VIDEO_MODULE) */ extern int acpi_blacklisted(void); -#ifdef CONFIG_DMI extern void acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d); extern int acpi_osi_setup(char *str); -#endif #ifdef CONFIG_ACPI_NUMA int acpi_get_pxm(acpi_handle handle); -- cgit v1.2.3 From 09729f0b11a389e046f621f3e4841043f460b603 Mon Sep 17 00:00:00 2001 From: Corentin Chary Date: Mon, 14 Sep 2009 12:43:51 +0200 Subject: hp-wmi: fix rfkill memory leak on unload rfkill_unregister() should always be followed by rfkill_destroy() In this case, rfkill_destroy was called two times on wifi_rfkill and never on bluetooth_rfkill. Signed-off-by: Corentin Chary Acked-by: Matthew Garrett Signed-off-by: Len Brown --- drivers/platform/x86/hp-wmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c index a2ad53e1587..a750192d6d4 100644 --- a/drivers/platform/x86/hp-wmi.c +++ b/drivers/platform/x86/hp-wmi.c @@ -502,7 +502,7 @@ static int __exit hp_wmi_bios_remove(struct platform_device *device) } if (bluetooth_rfkill) { rfkill_unregister(bluetooth_rfkill); - rfkill_destroy(wifi_rfkill); + rfkill_destroy(bluetooth_rfkill); } if (wwan_rfkill) { rfkill_unregister(wwan_rfkill); -- cgit v1.2.3 From 7d7decb213a65dea0973ed980c02dae2b1b88dbe Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Fri, 18 Sep 2009 12:41:08 -0700 Subject: acpi: switch /proc/acpi/{debug_layer,debug_level} to seq_file Signed-off-by: Alexey Dobriyan Signed-off-by: Andrew Morton Signed-off-by: Len Brown --- drivers/acpi/debug.c | 82 ++++++++++++++++++++++------------------------------ 1 file changed, 34 insertions(+), 48 deletions(-) diff --git a/drivers/acpi/debug.c b/drivers/acpi/debug.c index a8287be0870..8a690c3b8e2 100644 --- a/drivers/acpi/debug.c +++ b/drivers/acpi/debug.c @@ -3,6 +3,7 @@ */ #include +#include #include #include #include @@ -201,72 +202,54 @@ module_param_call(trace_state, param_set_trace_state, param_get_trace_state, #define ACPI_SYSTEM_FILE_DEBUG_LAYER "debug_layer" #define ACPI_SYSTEM_FILE_DEBUG_LEVEL "debug_level" -static int -acpi_system_read_debug(char *page, - char **start, off_t off, int count, int *eof, void *data) +static int acpi_system_debug_proc_show(struct seq_file *m, void *v) { - char *p = page; - int size = 0; unsigned int i; - if (off != 0) - goto end; + seq_printf(m, "%-25s\tHex SET\n", "Description"); - p += sprintf(p, "%-25s\tHex SET\n", "Description"); - - switch ((unsigned long)data) { + switch ((unsigned long)m->private) { case 0: for (i = 0; i < ARRAY_SIZE(acpi_debug_layers); i++) { - p += sprintf(p, "%-25s\t0x%08lX [%c]\n", + seq_printf(m, "%-25s\t0x%08lX [%c]\n", acpi_debug_layers[i].name, acpi_debug_layers[i].value, (acpi_dbg_layer & acpi_debug_layers[i]. value) ? '*' : ' '); } - p += sprintf(p, "%-25s\t0x%08X [%c]\n", "ACPI_ALL_DRIVERS", + seq_printf(m, "%-25s\t0x%08X [%c]\n", "ACPI_ALL_DRIVERS", ACPI_ALL_DRIVERS, (acpi_dbg_layer & ACPI_ALL_DRIVERS) == ACPI_ALL_DRIVERS ? '*' : (acpi_dbg_layer & ACPI_ALL_DRIVERS) == 0 ? ' ' : '-'); - p += sprintf(p, + seq_printf(m, "--\ndebug_layer = 0x%08X (* = enabled, - = partial)\n", acpi_dbg_layer); break; case 1: for (i = 0; i < ARRAY_SIZE(acpi_debug_levels); i++) { - p += sprintf(p, "%-25s\t0x%08lX [%c]\n", + seq_printf(m, "%-25s\t0x%08lX [%c]\n", acpi_debug_levels[i].name, acpi_debug_levels[i].value, (acpi_dbg_level & acpi_debug_levels[i]. value) ? '*' : ' '); } - p += sprintf(p, "--\ndebug_level = 0x%08X (* = enabled)\n", + seq_printf(m, "--\ndebug_level = 0x%08X (* = enabled)\n", acpi_dbg_level); break; - default: - p += sprintf(p, "Invalid debug option\n"); - break; } + return 0; +} - end: - size = (p - page); - if (size <= off + count) - *eof = 1; - *start = page + off; - size -= off; - if (size > count) - size = count; - if (size < 0) - size = 0; - - return size; +static int acpi_system_debug_proc_open(struct inode *inode, struct file *file) +{ + return single_open(file, acpi_system_debug_proc_show, PDE(inode)->data); } -static int -acpi_system_write_debug(struct file *file, +static ssize_t acpi_system_debug_proc_write(struct file *file, const char __user * buffer, - unsigned long count, void *data) + size_t count, loff_t *pos) { char debug_string[12] = { '\0' }; @@ -279,7 +262,7 @@ acpi_system_write_debug(struct file *file, debug_string[count] = '\0'; - switch ((unsigned long)data) { + switch ((unsigned long)PDE(file->f_path.dentry->d_inode)->data) { case 0: acpi_dbg_layer = simple_strtoul(debug_string, NULL, 0); break; @@ -292,6 +275,15 @@ acpi_system_write_debug(struct file *file, return count; } + +static const struct file_operations acpi_system_debug_proc_fops = { + .owner = THIS_MODULE, + .open = acpi_system_debug_proc_open, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, + .write = acpi_system_debug_proc_write, +}; #endif int __init acpi_debug_init(void) @@ -303,24 +295,18 @@ int __init acpi_debug_init(void) /* 'debug_layer' [R/W] */ name = ACPI_SYSTEM_FILE_DEBUG_LAYER; - entry = - create_proc_read_entry(name, S_IFREG | S_IRUGO | S_IWUSR, - acpi_root_dir, acpi_system_read_debug, - (void *)0); - if (entry) - entry->write_proc = acpi_system_write_debug; - else + entry = proc_create_data(name, S_IFREG | S_IRUGO | S_IWUSR, + acpi_root_dir, &acpi_system_debug_proc_fops, + (void *)0); + if (!entry) goto Error; /* 'debug_level' [R/W] */ name = ACPI_SYSTEM_FILE_DEBUG_LEVEL; - entry = - create_proc_read_entry(name, S_IFREG | S_IRUGO | S_IWUSR, - acpi_root_dir, acpi_system_read_debug, - (void *)1); - if (entry) - entry->write_proc = acpi_system_write_debug; - else + entry = proc_create_data(name, S_IFREG | S_IRUGO | S_IWUSR, + acpi_root_dir, &acpi_system_debug_proc_fops, + (void *)1); + if (!entry) goto Error; Done: -- cgit v1.2.3 From df43176c934f2bc01f7615a6e20a4b8e77dcdd11 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Fri, 18 Sep 2009 12:41:10 -0700 Subject: thermal: add missing Kconfig dependency Otherwise THERMAL_HWMON can be selected when HWMON=n and THERMAL=n, which fails to build. Signed-off-by: Jan Beulich Cc: Zhang Rui Cc: Matthew Garrett Signed-off-by: Andrew Morton Signed-off-by: Len Brown --- drivers/thermal/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig index a86e952ed4c..bf7c687519e 100644 --- a/drivers/thermal/Kconfig +++ b/drivers/thermal/Kconfig @@ -15,6 +15,7 @@ menuconfig THERMAL config THERMAL_HWMON bool "Hardware monitoring support" + depends on THERMAL depends on HWMON=y || HWMON=THERMAL help The generic thermal sysfs driver's hardware monitoring support -- cgit v1.2.3