linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* ACPI patches for Linux-2.6.23-rc3
@ 2007-08-24  7:20 Len Brown
       [not found] ` <3c1d36da1d5ed36979340efd233ddaacc45b0a02.1187939442.git.len.brown@intel.com>
  2007-08-24  8:07 ` ACPI patches for Linux-2.6.23-rc3 Zhang Rui
  0 siblings, 2 replies; 28+ messages in thread
From: Len Brown @ 2007-08-24  7:20 UTC (permalink / raw)
  To: linux-acpi

please speak up if you see any problem with these patches.
Also, please let me know if I've missed something you
think needs to make 2.6.23.

thanks,
-Len

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 01/25] ACPI: thermal: clean up MODULE_PARM_DESC newlines
       [not found] ` <3c1d36da1d5ed36979340efd233ddaacc45b0a02.1187939442.git.len.brown@intel.com>
@ 2007-08-24  7:20   ` Len Brown
       [not found]   ` <c52a7419af18594426bc601d1ea346dbbcf71e28.1187939442.git.len.brown@intel.com>
                     ` (22 subsequent siblings)
  23 siblings, 0 replies; 28+ messages in thread
From: Len Brown @ 2007-08-24  7:20 UTC (permalink / raw)
  To: linux-acpi; +Cc: Len Brown

Reported-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/thermal.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 1e06159..9b31f36 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -77,23 +77,23 @@ MODULE_LICENSE("GPL");
 
 static int act;
 module_param(act, int, 0644);
-MODULE_PARM_DESC(act, "Disable or override all lowest active trip points.\n");
+MODULE_PARM_DESC(act, "Disable or override all lowest active trip points.");
 
 static int tzp;
 module_param(tzp, int, 0444);
-MODULE_PARM_DESC(tzp, "Thermal zone polling frequency, in 1/10 seconds.\n");
+MODULE_PARM_DESC(tzp, "Thermal zone polling frequency, in 1/10 seconds.");
 
 static int nocrt;
 module_param(nocrt, int, 0);
-MODULE_PARM_DESC(nocrt, "Set to disable action on ACPI thermal zone critical and hot trips.\n");
+MODULE_PARM_DESC(nocrt, "Set to disable action on ACPI thermal zone critical and hot trips.");
 
 static int off;
 module_param(off, int, 0);
-MODULE_PARM_DESC(off, "Set to disable ACPI thermal support.\n");
+MODULE_PARM_DESC(off, "Set to disable ACPI thermal support.");
 
 static int psv;
 module_param(psv, int, 0644);
-MODULE_PARM_DESC(psv, "Disable or override all passive trip points.\n");
+MODULE_PARM_DESC(psv, "Disable or override all passive trip points.");
 
 static int acpi_thermal_add(struct acpi_device *device);
 static int acpi_thermal_remove(struct acpi_device *device, int type);
-- 
1.5.3.rc6.17.g1911

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 02/25] ACPI: thermal: create "thermal.crt=C" bootparam
       [not found]   ` <c52a7419af18594426bc601d1ea346dbbcf71e28.1187939442.git.len.brown@intel.com>
@ 2007-08-24  7:20     ` Len Brown
  0 siblings, 0 replies; 28+ messages in thread
From: Len Brown @ 2007-08-24  7:20 UTC (permalink / raw)
  To: linux-acpi; +Cc: Len Brown

Some hardware will malfunction at a temperature below
the BIOS provided critical shutdown threshold.

This hook allows moving the critical trip points down
to a temperature which provokes a graceful shutdown
before the hardware malfunction.

http://bugzilla.kernel.org/show_bug.cgi?id=8884

WARNING: A trip-point override will not get noticed
until the system delivers a temperature change event,
or unless thermal zone polling is enabled.
eg. "thermal.tzp=10"

Signed-off-by: Len Brown <len.brown@intel.com>
---
 Documentation/kernel-parameters.txt |    4 ++++
 drivers/acpi/thermal.c              |   18 ++++++++++++++++++
 2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 975f029..18dcfdd 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1826,6 +1826,10 @@ and is between 256 and 4096 characters. It is defined in the file
 			-1: disable all active trip points in all thermal zones
 			<degrees C>: override all lowest active trip points
 
+	thermal.crt=	[HW,ACPI]
+			-1: disable all critical trip points in all thermal zones
+			<degrees C>: lower all critical trip points
+
 	thermal.nocrt=	[HW,ACPI]
 			Set to disable actions on ACPI thermal zone
 			critical and hot trip points.
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 9b31f36..4c420fe 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -79,6 +79,10 @@ static int act;
 module_param(act, int, 0644);
 MODULE_PARM_DESC(act, "Disable or override all lowest active trip points.");
 
+static int crt;
+module_param(crt, int, 0644);
+MODULE_PARM_DESC(crt, "Disable or lower all critical trip points.");
+
 static int tzp;
 module_param(tzp, int, 0444);
 MODULE_PARM_DESC(tzp, "Thermal zone polling frequency, in 1/10 seconds.");
@@ -340,6 +344,20 @@ static int acpi_thermal_get_trip_points(struct acpi_thermal *tz)
 				  tz->trips.critical.temperature));
 	}
 
+	if (tz->trips.critical.flags.valid == 1) {
+		if (crt == -1) {
+			tz->trips.critical.flags.valid = 0;
+		} else if (crt > 0) {
+			unsigned long crt_k = CELSIUS_TO_KELVIN(crt);
+
+			/*
+			 * Allow override to lower critical threshold
+			 */
+			if (crt_k < tz->trips.critical.temperature)
+				tz->trips.critical.temperature = crt_k;
+		}
+	}
+
 	/* Critical Sleep (optional) */
 
 	status =
-- 
1.5.3.rc6.17.g1911

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 03/25] Revert "ACPI: Battery: Synchronize battery operations."
       [not found]   ` <5b31d895874f56174e4d885c065c9fc4b24b28bb.1187939442.git.len.brown@intel.com>
@ 2007-08-24  7:20     ` Len Brown
  0 siblings, 0 replies; 28+ messages in thread
From: Len Brown @ 2007-08-24  7:20 UTC (permalink / raw)
  To: linux-acpi; +Cc: Len Brown

This reverts commit 3bd92ba19a89fe61ebf58804f9c8675372f50c1c.

It is no longer necessary, and it opens up a race.

Acked-by: Vladimir Lebedev <vladimir.p.lebedev@gmail.com>
Acked-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/battery.c |   47 ++++++++++++++++++++++++++++++-----------------
 1 files changed, 30 insertions(+), 17 deletions(-)

diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index d7b499f..8165103 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -113,7 +113,7 @@ struct acpi_battery_info {
 	acpi_string oem_info;
 };
 
-enum acpi_battery_files {
+enum acpi_battery_files{
 	ACPI_BATTERY_INFO = 0,
 	ACPI_BATTERY_STATE,
 	ACPI_BATTERY_ALARM,
@@ -129,14 +129,13 @@ struct acpi_battery_flags {
 };
 
 struct acpi_battery {
+	struct mutex mutex;
 	struct acpi_device *device;
 	struct acpi_battery_flags flags;
 	struct acpi_buffer bif_data;
 	struct acpi_buffer bst_data;
-	struct mutex lock;
 	unsigned long alarm;
 	unsigned long update_time[ACPI_BATTERY_NUMFILES];
-
 };
 
 inline int acpi_battery_present(struct acpi_battery *battery)
@@ -236,10 +235,10 @@ static int acpi_battery_get_info(struct acpi_battery *battery)
 		return 0;
 
 	/* Evaluate _BIF */
-	mutex_lock(&battery->lock);
-	status = acpi_evaluate_object(acpi_battery_handle(battery), "_BIF",
-				      NULL, &buffer);
-	mutex_unlock(&battery->lock);
+
+	status =
+	    acpi_evaluate_object(acpi_battery_handle(battery), "_BIF", NULL,
+				 &buffer);
 	if (ACPI_FAILURE(status)) {
 		ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BIF"));
 		return -ENODEV;
@@ -286,10 +285,10 @@ static int acpi_battery_get_state(struct acpi_battery *battery)
 		return 0;
 
 	/* Evaluate _BST */
-	mutex_lock(&battery->lock);
-	status = acpi_evaluate_object(acpi_battery_handle(battery), "_BST",
-				      NULL, &buffer);
-	mutex_unlock(&battery->lock);
+
+	status =
+	    acpi_evaluate_object(acpi_battery_handle(battery), "_BST", NULL,
+				 &buffer);
 	if (ACPI_FAILURE(status)) {
 		ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BST"));
 		return -ENODEV;
@@ -337,10 +336,9 @@ static int acpi_battery_set_alarm(struct acpi_battery *battery,
 
 	arg0.integer.value = alarm;
 
-	mutex_lock(&battery->lock);
-	status = acpi_evaluate_object(acpi_battery_handle(battery), "_BTP",
+	status =
+	    acpi_evaluate_object(acpi_battery_handle(battery), "_BTP",
 				 &arg_list, NULL);
-	mutex_unlock(&battery->lock);
 	if (ACPI_FAILURE(status))
 		return -ENODEV;
 
@@ -660,6 +658,8 @@ acpi_battery_write_alarm(struct file *file,
 	if (!battery || (count > sizeof(alarm_string) - 1))
 		return -EINVAL;
 
+	mutex_lock(&battery->mutex);
+
 	result = acpi_battery_update(battery, 1, &update_result);
 	if (result) {
 		result = -ENODEV;
@@ -688,7 +688,9 @@ acpi_battery_write_alarm(struct file *file,
 	acpi_battery_check_result(battery, result);
 
 	if (!result)
-		return count;
+		result = count;
+
+	mutex_unlock(&battery->mutex);
 
 	return result;
 }
@@ -712,6 +714,8 @@ static int acpi_battery_read(int fid, struct seq_file *seq)
 	int update_result = ACPI_BATTERY_NONE_UPDATE;
 	int update = 0;
 
+	mutex_lock(&battery->mutex);
+
 	update = (get_seconds() - battery->update_time[fid] >= update_time);
 	update = (update | battery->flags.update[fid]);
 
@@ -729,6 +733,7 @@ static int acpi_battery_read(int fid, struct seq_file *seq)
 	result = acpi_read_funcs[fid].print(seq, result);
 	acpi_battery_check_result(battery, result);
 	battery->flags.update[fid] = result;
+	mutex_unlock(&battery->mutex);
 	return result;
 }
 
@@ -892,7 +897,10 @@ static int acpi_battery_add(struct acpi_device *device)
 	if (!battery)
 		return -ENOMEM;
 
-	mutex_init(&battery->lock);
+	mutex_init(&battery->mutex);
+
+	mutex_lock(&battery->mutex);
+
 	battery->device = device;
 	strcpy(acpi_device_name(device), ACPI_BATTERY_DEVICE_NAME);
 	strcpy(acpi_device_class(device), ACPI_BATTERY_CLASS);
@@ -928,6 +936,7 @@ static int acpi_battery_add(struct acpi_device *device)
 		kfree(battery);
 	}
 
+	mutex_unlock(&battery->mutex);
 
 	return result;
 }
@@ -942,6 +951,8 @@ static int acpi_battery_remove(struct acpi_device *device, int type)
 
 	battery = acpi_driver_data(device);
 
+	mutex_lock(&battery->mutex);
+
 	status = acpi_remove_notify_handler(device->handle,
 					    ACPI_ALL_NOTIFY,
 					    acpi_battery_notify);
@@ -952,7 +963,9 @@ static int acpi_battery_remove(struct acpi_device *device, int type)
 
 	kfree(battery->bst_data.pointer);
 
-	mutex_destroy(&battery->lock);
+	mutex_unlock(&battery->mutex);
+
+	mutex_destroy(&battery->mutex);
 
 	kfree(battery);
 
-- 
1.5.3.rc6.17.g1911

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 04/25] ACPI: thermal: set "thermal.nocrt" via DMI on Gigabyte GA-7ZX
       [not found]   ` <8c99fdce30787b0d1fc00b907d4cd55a714e4cdd.1187939442.git.len.brown@intel.com>
@ 2007-08-24  7:20     ` Len Brown
  0 siblings, 0 replies; 28+ messages in thread
From: Len Brown @ 2007-08-24  7:20 UTC (permalink / raw)
  To: linux-acpi; +Cc: Len Brown

This system BIOS sets a critical temperature to 65C,
which is too low.

https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=155496

Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/thermal.c |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 4c420fe..39479b0 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -89,7 +89,7 @@ MODULE_PARM_DESC(tzp, "Thermal zone polling frequency, in 1/10 seconds.");
 
 static int nocrt;
 module_param(nocrt, int, 0);
-MODULE_PARM_DESC(nocrt, "Set to disable action on ACPI thermal zone critical and hot trips.");
+MODULE_PARM_DESC(nocrt, "Set to take no action upon ACPI thermal zone critical trips points.");
 
 static int off;
 module_param(off, int, 0);
@@ -1357,6 +1357,13 @@ static int thermal_act(struct dmi_system_id *d) {
 	}
 	return 0;
 }
+static int thermal_nocrt(struct dmi_system_id *d) {
+
+	printk(KERN_NOTICE "ACPI: %s detected: "
+		"disabling all critical thermal trip point actions.\n", d->ident);
+	nocrt = 1;
+	return 0;
+}
 static int thermal_tzp(struct dmi_system_id *d) {
 
 	if (tzp == 0) {
@@ -1405,6 +1412,14 @@ static struct dmi_system_id thermal_dmi_table[] __initdata = {
 		DMI_MATCH(DMI_BOARD_NAME, "i915GMm-HFS"),
 		},
 	},
+	{
+	 .callback = thermal_nocrt,
+	 .ident = "Gigabyte GA-7ZX",
+	 .matches = {
+		DMI_MATCH(DMI_BOARD_VENDOR, "Gigabyte Technology Co., Ltd."),
+		DMI_MATCH(DMI_BOARD_NAME, "7ZX"),
+		},
+	},
 	{}
 };
 #endif /* CONFIG_DMI */
-- 
1.5.3.rc6.17.g1911

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 05/25] ACPI: boot correctly with "nosmp" or "maxcpus=0"
       [not found]   ` <61ec7567db103d537329b0db9a887db570431ff4.1187939442.git.len.brown@intel.com>
@ 2007-08-24  7:20     ` Len Brown
  0 siblings, 0 replies; 28+ messages in thread
From: Len Brown @ 2007-08-24  7:20 UTC (permalink / raw)
  To: linux-acpi; +Cc: Len Brown

In MPS mode, "nosmp" and "maxcpus=0" boot a UP kernel with IOAPIC disabled.
However, in ACPI mode, these parameters didn't completely disable
the IO APIC initialization code and boot failed.

init/main.c:
	Disable the IO_APIC if "nosmp" or "maxcpus=0"
	undefine disable_ioapic_setup() when it doesn't apply.

i386:
	delete ioapic_setup(), it was a duplicate of parse_noapic()
	delete undefinition of disable_ioapic_setup()

x86_64:
	rename disable_ioapic_setup() to parse_noapic() to match i386
	define disable_ioapic_setup() in header to match i386

http://bugzilla.kernel.org/show_bug.cgi?id=1641

Acked-by: Andi Kleen <ak@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 Documentation/kernel-parameters.txt |   15 ++++++---------
 arch/i386/kernel/io_apic.c          |    8 --------
 arch/x86_64/kernel/io_apic.c        |    8 +++-----
 include/asm-i386/io_apic.h          |    1 -
 include/asm-x86_64/io_apic.h        |    6 ++++++
 init/main.c                         |   12 ++++++++++--
 6 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 975f029..17770b4 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -952,14 +952,10 @@ and is between 256 and 4096 characters. It is defined in the file
 			Format: <1-256>
 
 	maxcpus=	[SMP] Maximum number of processors that	an SMP kernel
-			should make use of.
-			Using "nosmp" or "maxcpus=0" will disable SMP
-			entirely (the MPS table probe still happens, though).
-			A command-line option of "maxcpus=<NUM>", where <NUM>
-			is an integer greater than 0, limits the maximum number
-			of CPUs activated in SMP mode to <NUM>.
-			Using "maxcpus=1" on an SMP kernel is the trivial
-			case of an SMP kernel with only one CPU.
+			should make use of.  maxcpus=n : n >= 0 limits the
+			kernel to using 'n' processors.  n=0 is a special case,
+			it is equivalent to "nosmp", which also disables
+			the IO APIC.
 
 	max_addr=[KMG]	[KNL,BOOT,ia64] All physical memory greater than or
 			equal to this physical address is ignored.
@@ -1184,7 +1180,8 @@ and is between 256 and 4096 characters. It is defined in the file
 
 	nosep		[BUGS=X86-32] Disables x86 SYSENTER/SYSEXIT support.
 
-	nosmp		[SMP] Tells an SMP kernel to act as a UP kernel.
+	nosmp		[SMP] Tells an SMP kernel to act as a UP kernel,
+			and disable the IO APIC.  legacy for "maxcpus=0".
 
 	nosoftlockup	[KNL] Disable the soft-lockup detector.
 
diff --git a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c
index 4b8a8da..e2f4a1c 100644
--- a/arch/i386/kernel/io_apic.c
+++ b/arch/i386/kernel/io_apic.c
@@ -754,14 +754,6 @@ static int pirq_entries [MAX_PIRQS];
 static int pirqs_enabled;
 int skip_ioapic_setup;
 
-static int __init ioapic_setup(char *str)
-{
-	skip_ioapic_setup = 1;
-	return 1;
-}
-
-__setup("noapic", ioapic_setup);
-
 static int __init ioapic_pirq_setup(char *str)
 {
 	int i, max;
diff --git a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c
index f57f8b9..966fa10 100644
--- a/arch/x86_64/kernel/io_apic.c
+++ b/arch/x86_64/kernel/io_apic.c
@@ -397,14 +397,12 @@ static void clear_IO_APIC (void)
 int skip_ioapic_setup;
 int ioapic_force;
 
-/* dummy parsing: see setup.c */
-
-static int __init disable_ioapic_setup(char *str)
+static int __init parse_noapic(char *str)
 {
-	skip_ioapic_setup = 1;
+	disable_ioapic_setup();
 	return 0;
 }
-early_param("noapic", disable_ioapic_setup);
+early_param("noapic", parse_noapic);
 
 /* Actually the next is obsolete, but keep it for paranoid reasons -AK */
 static int __init disable_timer_pin_setup(char *arg)
diff --git a/include/asm-i386/io_apic.h b/include/asm-i386/io_apic.h
index 3407640..dbe734d 100644
--- a/include/asm-i386/io_apic.h
+++ b/include/asm-i386/io_apic.h
@@ -150,7 +150,6 @@ extern int (*ioapic_renumber_irq)(int ioapic, int irq);
 
 #else  /* !CONFIG_X86_IO_APIC */
 #define io_apic_assign_pci_irqs 0
-static inline void disable_ioapic_setup(void) { }
 #endif
 
 #endif
diff --git a/include/asm-x86_64/io_apic.h b/include/asm-x86_64/io_apic.h
index 969d225..d9f2e54 100644
--- a/include/asm-x86_64/io_apic.h
+++ b/include/asm-x86_64/io_apic.h
@@ -109,6 +109,12 @@ extern int mpc_default_type;
 /* 1 if "noapic" boot option passed */
 extern int skip_ioapic_setup;
 
+static inline void disable_ioapic_setup(void)
+{
+	skip_ioapic_setup = 1;
+}
+
+
 /*
  * If we use the IO-APIC for IRQ routing, disable automatic
  * assignment of PCI IRQ's.
diff --git a/init/main.c b/init/main.c
index d3bcb3b..cc0653e 100644
--- a/init/main.c
+++ b/init/main.c
@@ -146,9 +146,14 @@ static unsigned int __initdata max_cpus = NR_CPUS;
  * greater than 0, limits the maximum number of CPUs activated in
  * SMP mode to <NUM>.
  */
+#ifndef CONFIG_X86_IO_APIC
+static inline void disable_ioapic_setup(void) {};
+#endif
+
 static int __init nosmp(char *str)
 {
 	max_cpus = 0;
+	disable_ioapic_setup();
 	return 0;
 }
 
@@ -157,10 +162,13 @@ early_param("nosmp", nosmp);
 static int __init maxcpus(char *str)
 {
 	get_option(&str, &max_cpus);
-	return 1;
+	if (max_cpus == 0)
+		disable_ioapic_setup();
+
+	return 0;
 }
 
-__setup("maxcpus=", maxcpus);
+early_param("maxcpus=", maxcpus);
 #else
 #define max_cpus NR_CPUS
 #endif
-- 
1.5.3.rc6.17.g1911

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 06/25] Subject: "ACPI handle has no context!" should be KERN_DEBUG
       [not found]   ` <a9a4d1771cbb3c97f247534358ed24b1abf0aacb.1187939442.git.len.brown@intel.com>
@ 2007-08-24  7:20     ` Len Brown
  0 siblings, 0 replies; 28+ messages in thread
From: Len Brown @ 2007-08-24  7:20 UTC (permalink / raw)
  To: linux-acpi; +Cc: Shaohua Li, Len Brown

From: Shaohua Li <shaohua.li@intel.com>

Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/sleep/main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c
index e8cff5d..c52ade8 100644
--- a/drivers/acpi/sleep/main.c
+++ b/drivers/acpi/sleep/main.c
@@ -305,7 +305,7 @@ int acpi_pm_device_sleep_state(struct device *dev, int wake, int *d_min_p)
 	unsigned long d_min, d_max;
 
 	if (!handle || ACPI_FAILURE(acpi_bus_get_device(handle, &adev))) {
-		printk(KERN_ERR "ACPI handle has no context!\n");
+		printk(KERN_DEBUG "ACPI handle has no context!\n");
 		return -ENODEV;
 	}
 
-- 
1.5.3.rc6.17.g1911

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 08/25] ACPI: Schedule /proc/acpi/event for removal
       [not found]   ` <14e04fb34ffa82ee61ae69f98d8fca12d2e8e31c.1187939442.git.len.brown@intel.com>
@ 2007-08-24  7:20     ` Len Brown
  0 siblings, 0 replies; 28+ messages in thread
From: Len Brown @ 2007-08-24  7:20 UTC (permalink / raw)
  To: linux-acpi; +Cc: Len Brown

Schedule /proc/acpi/event for removal in 6 months.

Re-name acpi_bus_generate_event() to acpi_bus_generate_proc_event()
to make sure there is no confusion that it is for /proc/acpi/event only.

Add CONFIG_ACPI_PROC_EVENT to allow removal of /proc/acpi/event.
There is no functional change if CONFIG_ACPI_PROC_EVENT=y

Signed-off-by: Len Brown <len.brown@intel.com>
---
 Documentation/feature-removal-schedule.txt |    8 ++++++++
 drivers/acpi/Kconfig                       |   14 ++++++++++++++
 drivers/acpi/ac.c                          |    2 +-
 drivers/acpi/asus_acpi.c                   |    2 +-
 drivers/acpi/battery.c                     |    2 +-
 drivers/acpi/bus.c                         |    6 ++++--
 drivers/acpi/button.c                      |    2 +-
 drivers/acpi/event.c                       |    6 ++++++
 drivers/acpi/processor_core.c              |    6 +++---
 drivers/acpi/sbs.c                         |    2 +-
 drivers/acpi/thermal.c                     |    8 ++++----
 drivers/acpi/video.c                       |   10 +++++-----
 drivers/char/sonypi.c                      |    2 +-
 drivers/misc/asus-laptop.c                 |    2 +-
 drivers/misc/sony-laptop.c                 |    4 ++--
 drivers/misc/thinkpad_acpi.c               |    8 ++++----
 drivers/pci/hotplug/acpiphp_ibm.c          |    2 +-
 include/acpi/acpi_bus.h                    |    7 ++++++-
 18 files changed, 64 insertions(+), 29 deletions(-)

diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt
index a43d287..b9a3fdc 100644
--- a/Documentation/feature-removal-schedule.txt
+++ b/Documentation/feature-removal-schedule.txt
@@ -197,6 +197,14 @@ Who:	Len Brown <len.brown@intel.com>
 
 ---------------------------
 
+What:	/proc/acpi/event
+When:	February 2008
+Why:	/proc/acpi/event has been replaced by events via the input layer
+	and netlink since 2.6.23.
+Who:	Len Brown <len.brown@intel.com>
+
+---------------------------
+
 What:	Compaq touchscreen device emulation
 When:	Oct 2007
 Files:	drivers/input/tsdev.c
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
index f1372de..5742594 100644
--- a/drivers/acpi/Kconfig
+++ b/drivers/acpi/Kconfig
@@ -68,6 +68,20 @@ config ACPI_PROCFS
 
 	  Say N to delete /proc/acpi/ files that have moved to /sys/
 
+config ACPI_PROC_EVENT
+	bool "Deprecated /proc/acpi/event support"
+	depends on PROC_FS
+	---help---
+	  A user-space daemon, acpi, typically read /proc/acpi/event
+	  and handled all ACPI sub-system generated events.
+
+	  These events are now delivered to user-space via
+	  either the input layer, or as netlink events.
+
+	  This build option enables the old code for for legacy
+	  user-space implementation.  After some time, this will
+	  be moved under CONFIG_ACPI_PROCFS, and then deleted.
+
 config ACPI_AC
 	tristate "AC Adapter"
 	depends on X86
diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c
index b53c2cf..26d7070 100644
--- a/drivers/acpi/ac.c
+++ b/drivers/acpi/ac.c
@@ -204,7 +204,7 @@ static void acpi_ac_notify(acpi_handle handle, u32 event, void *data)
 	case ACPI_NOTIFY_BUS_CHECK:
 	case ACPI_NOTIFY_DEVICE_CHECK:
 		acpi_ac_get_state(ac);
-		acpi_bus_generate_event(device, event, (u32) ac->state);
+		acpi_bus_generate_proc_event(device, event, (u32) ac->state);
 		acpi_bus_generate_netlink_event(device->pnp.device_class,
 						  device->dev.bus_id, event,
 						  (u32) ac->state);
diff --git a/drivers/acpi/asus_acpi.c b/drivers/acpi/asus_acpi.c
index 86fd142..d915fec 100644
--- a/drivers/acpi/asus_acpi.c
+++ b/drivers/acpi/asus_acpi.c
@@ -1069,7 +1069,7 @@ static void asus_hotk_notify(acpi_handle handle, u32 event, void *data)
 		hotk->brightness = (event & ~((u32) BR_DOWN));
 	}
 
-	acpi_bus_generate_event(hotk->device, event,
+	acpi_bus_generate_proc_event(hotk->device, event,
 				hotk->event_count[event % 128]++);
 
 	return;
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index 9f0bf90..91dc4b3 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -867,7 +867,7 @@ static void acpi_battery_notify(acpi_handle handle, u32 event, void *data)
 	case ACPI_NOTIFY_DEVICE_CHECK:
 		device = battery->device;
 		acpi_battery_notify_update(battery);
-		acpi_bus_generate_event(device, event,
+		acpi_bus_generate_proc_event(device, event,
 					acpi_battery_present(battery));
 		acpi_bus_generate_netlink_event(device->pnp.device_class,
 						  device->dev.bus_id, event,
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index e5084ec..9ba778a 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -276,6 +276,7 @@ EXPORT_SYMBOL(acpi_bus_set_power);
                                 Event Management
    -------------------------------------------------------------------------- */
 
+#ifdef CONFIG_ACPI_PROC_EVENT
 static DEFINE_SPINLOCK(acpi_bus_event_lock);
 
 LIST_HEAD(acpi_bus_event_list);
@@ -283,7 +284,7 @@ DECLARE_WAIT_QUEUE_HEAD(acpi_bus_event_queue);
 
 extern int event_is_open;
 
-int acpi_bus_generate_event(struct acpi_device *device, u8 type, int data)
+int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data)
 {
 	struct acpi_bus_event *event = NULL;
 	unsigned long flags = 0;
@@ -314,7 +315,7 @@ int acpi_bus_generate_event(struct acpi_device *device, u8 type, int data)
 	return 0;
 }
 
-EXPORT_SYMBOL(acpi_bus_generate_event);
+EXPORT_SYMBOL(acpi_bus_generate_proc_event);
 
 int acpi_bus_receive_event(struct acpi_bus_event *event)
 {
@@ -360,6 +361,7 @@ int acpi_bus_receive_event(struct acpi_bus_event *event)
 }
 
 EXPORT_SYMBOL(acpi_bus_receive_event);
+#endif	/* CONFIG_ACPI_PROC_EVENT */
 
 /* --------------------------------------------------------------------------
                              Notification Handling
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
index 5405813..2e79a33 100644
--- a/drivers/acpi/button.c
+++ b/drivers/acpi/button.c
@@ -284,7 +284,7 @@ static void acpi_button_notify(acpi_handle handle, u32 event, void *data)
 		}
 		input_sync(input);
 
-		acpi_bus_generate_event(button->device, event,
+		acpi_bus_generate_proc_event(button->device, event,
 					++button->pushed);
 		break;
 	default:
diff --git a/drivers/acpi/event.c b/drivers/acpi/event.c
index b7b1432..cf6d516 100644
--- a/drivers/acpi/event.c
+++ b/drivers/acpi/event.c
@@ -17,6 +17,7 @@
 #define _COMPONENT		ACPI_SYSTEM_COMPONENT
 ACPI_MODULE_NAME("event");
 
+#ifdef CONFIG_ACPI_PROC_EVENT
 /* Global vars for handling event proc entry */
 static DEFINE_SPINLOCK(acpi_system_event_lock);
 int event_is_open = 0;
@@ -106,6 +107,7 @@ static const struct file_operations acpi_system_event_ops = {
 	.release = acpi_system_close_event,
 	.poll = acpi_system_poll_event,
 };
+#endif	/* CONFIG_ACPI_PROC_EVENT */
 
 #ifdef CONFIG_NET
 static unsigned int acpi_event_seqnum;
@@ -247,7 +249,9 @@ static int acpi_event_genetlink_init(void)
 
 static int __init acpi_event_init(void)
 {
+#ifdef CONFIG_ACPI_PROC_EVENT
 	struct proc_dir_entry *entry;
+#endif
 	int error = 0;
 
 	if (acpi_disabled)
@@ -259,12 +263,14 @@ static int __init acpi_event_init(void)
 		printk(KERN_WARNING PREFIX
 		       "Failed to create genetlink family for ACPI event\n");
 
+#ifdef CONFIG_ACPI_PROC_EVENT
 	/* 'event' [R] */
 	entry = create_proc_entry("event", S_IRUSR, acpi_root_dir);
 	if (entry)
 		entry->proc_fops = &acpi_system_event_ops;
 	else
 		return -ENODEV;
+#endif
 
 	return 0;
 }
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index dbc2e5d..e944aae 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -698,7 +698,7 @@ static void acpi_processor_notify(acpi_handle handle, u32 event, void *data)
 	switch (event) {
 	case ACPI_PROCESSOR_NOTIFY_PERFORMANCE:
 		acpi_processor_ppc_has_changed(pr);
-		acpi_bus_generate_event(device, event,
+		acpi_bus_generate_proc_event(device, event,
 					pr->performance_platform_limit);
 		acpi_bus_generate_netlink_event(device->pnp.device_class,
 						  device->dev.bus_id, event,
@@ -706,13 +706,13 @@ static void acpi_processor_notify(acpi_handle handle, u32 event, void *data)
 		break;
 	case ACPI_PROCESSOR_NOTIFY_POWER:
 		acpi_processor_cst_has_changed(pr);
-		acpi_bus_generate_event(device, event, 0);
+		acpi_bus_generate_proc_event(device, event, 0);
 		acpi_bus_generate_netlink_event(device->pnp.device_class,
 						  device->dev.bus_id, event, 0);
 		break;
 	case ACPI_PROCESSOR_NOTIFY_THROTTLING:
 		acpi_processor_tstate_has_changed(pr);
-		acpi_bus_generate_event(device, event, 0);
+		acpi_bus_generate_proc_event(device, event, 0);
 		acpi_bus_generate_netlink_event(device->pnp.device_class,
 						  device->dev.bus_id, event, 0);
 	default:
diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c
index 2d67e92..a578986 100644
--- a/drivers/acpi/sbs.c
+++ b/drivers/acpi/sbs.c
@@ -440,7 +440,7 @@ static int acpi_sbs_generate_event(struct acpi_device *device,
 	strcpy(acpi_device_bid(device), bid);
 	strcpy(acpi_device_class(device), class);
 
-	result = acpi_bus_generate_event(device, event, state);
+	result = acpi_bus_generate_proc_event(device, event, state);
 
 	strcpy(acpi_device_bid(device), bid_saved);
 	strcpy(acpi_device_class(device), class_saved);
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 291758c..2c9cfe2 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -485,7 +485,7 @@ static int acpi_thermal_critical(struct acpi_thermal *tz)
 	printk(KERN_EMERG
 	       "Critical temperature reached (%ld C), shutting down.\n",
 	       KELVIN_TO_CELSIUS(tz->temperature));
-	acpi_bus_generate_event(tz->device, ACPI_THERMAL_NOTIFY_CRITICAL,
+	acpi_bus_generate_proc_event(tz->device, ACPI_THERMAL_NOTIFY_CRITICAL,
 				tz->trips.critical.flags.enabled);
 	acpi_bus_generate_netlink_event(tz->device->pnp.device_class,
 					  tz->device->dev.bus_id,
@@ -508,7 +508,7 @@ static int acpi_thermal_hot(struct acpi_thermal *tz)
 	} else if (tz->trips.hot.flags.enabled)
 		tz->trips.hot.flags.enabled = 0;
 
-	acpi_bus_generate_event(tz->device, ACPI_THERMAL_NOTIFY_HOT,
+	acpi_bus_generate_proc_event(tz->device, ACPI_THERMAL_NOTIFY_HOT,
 				tz->trips.hot.flags.enabled);
 	acpi_bus_generate_netlink_event(tz->device->pnp.device_class,
 					  tz->device->dev.bus_id,
@@ -1157,14 +1157,14 @@ static void acpi_thermal_notify(acpi_handle handle, u32 event, void *data)
 	case ACPI_THERMAL_NOTIFY_THRESHOLDS:
 		acpi_thermal_get_trip_points(tz);
 		acpi_thermal_check(tz);
-		acpi_bus_generate_event(device, event, 0);
+		acpi_bus_generate_proc_event(device, event, 0);
 		acpi_bus_generate_netlink_event(device->pnp.device_class,
 						  device->dev.bus_id, event, 0);
 		break;
 	case ACPI_THERMAL_NOTIFY_DEVICES:
 		if (tz->flags.devices)
 			acpi_thermal_get_devices(tz);
-		acpi_bus_generate_event(device, event, 0);
+		acpi_bus_generate_proc_event(device, event, 0);
 		acpi_bus_generate_netlink_event(device->pnp.device_class,
 						  device->dev.bus_id, event, 0);
 		break;
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index d987019..9a5cfcf 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -1775,7 +1775,7 @@ static void acpi_video_bus_notify(acpi_handle handle, u32 event, void *data)
 	switch (event) {
 	case ACPI_VIDEO_NOTIFY_SWITCH:	/* User requested a switch,
 					 * most likely via hotkey. */
-		acpi_bus_generate_event(device, event, 0);
+		acpi_bus_generate_proc_event(device, event, 0);
 		break;
 
 	case ACPI_VIDEO_NOTIFY_PROBE:	/* User plugged in or removed a video
@@ -1783,14 +1783,14 @@ static void acpi_video_bus_notify(acpi_handle handle, u32 event, void *data)
 		acpi_video_device_enumerate(video);
 		acpi_video_device_rebind(video);
 		acpi_video_switch_output(video, event);
-		acpi_bus_generate_event(device, event, 0);
+		acpi_bus_generate_proc_event(device, event, 0);
 		break;
 
 	case ACPI_VIDEO_NOTIFY_CYCLE:	/* Cycle Display output hotkey pressed. */
 	case ACPI_VIDEO_NOTIFY_NEXT_OUTPUT:	/* Next Display output hotkey pressed. */
 	case ACPI_VIDEO_NOTIFY_PREV_OUTPUT:	/* previous Display output hotkey pressed. */
 		acpi_video_switch_output(video, event);
-		acpi_bus_generate_event(device, event, 0);
+		acpi_bus_generate_proc_event(device, event, 0);
 		break;
 
 	default:
@@ -1815,7 +1815,7 @@ static void acpi_video_device_notify(acpi_handle handle, u32 event, void *data)
 	switch (event) {
 	case ACPI_VIDEO_NOTIFY_SWITCH:	/* change in status (cycle output device) */
 	case ACPI_VIDEO_NOTIFY_PROBE:	/* change in status (output device status) */
-		acpi_bus_generate_event(device, event, 0);
+		acpi_bus_generate_proc_event(device, event, 0);
 		break;
 	case ACPI_VIDEO_NOTIFY_CYCLE_BRIGHTNESS:	/* Cycle brightness */
 	case ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS:	/* Increase brightness */
@@ -1823,7 +1823,7 @@ static void acpi_video_device_notify(acpi_handle handle, u32 event, void *data)
 	case ACPI_VIDEO_NOTIFY_ZERO_BRIGHTNESS:	/* zero brightnesss */
 	case ACPI_VIDEO_NOTIFY_DISPLAY_OFF:	/* display device off */
 		acpi_video_switch_brightness(video_device, event);
-		acpi_bus_generate_event(device, event, 0);
+		acpi_bus_generate_proc_event(device, event, 0);
 		break;
 	default:
 		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c
index aeec67e..8598585 100644
--- a/drivers/char/sonypi.c
+++ b/drivers/char/sonypi.c
@@ -875,7 +875,7 @@ found:
 
 #ifdef CONFIG_ACPI
 	if (sonypi_acpi_device)
-		acpi_bus_generate_event(sonypi_acpi_device, 1, event);
+		acpi_bus_generate_proc_event(sonypi_acpi_device, 1, event);
 #endif
 
 	kfifo_put(sonypi_device.fifo, (unsigned char *)&event, sizeof(event));
diff --git a/drivers/misc/asus-laptop.c b/drivers/misc/asus-laptop.c
index d0fc4fd..f8ae58f 100644
--- a/drivers/misc/asus-laptop.c
+++ b/drivers/misc/asus-laptop.c
@@ -732,7 +732,7 @@ static void asus_hotk_notify(acpi_handle handle, u32 event, void *data)
 		lcd_blank(FB_BLANK_POWERDOWN);
 	}
 
-	acpi_bus_generate_event(hotk->device, event,
+	acpi_bus_generate_proc_event(hotk->device, event,
 				hotk->event_count[event % 128]++);
 
 	return;
diff --git a/drivers/misc/sony-laptop.c b/drivers/misc/sony-laptop.c
index 91da688..743bd49 100644
--- a/drivers/misc/sony-laptop.c
+++ b/drivers/misc/sony-laptop.c
@@ -904,7 +904,7 @@ static void sony_acpi_notify(acpi_handle handle, u32 event, void *data)
 
 	dprintk("sony_acpi_notify, event: 0x%.2x\n", ev);
 	sony_laptop_report_input_event(ev);
-	acpi_bus_generate_event(sony_nc_acpi_device, 1, ev);
+	acpi_bus_generate_proc_event(sony_nc_acpi_device, 1, ev);
 }
 
 static acpi_status sony_walk_callback(acpi_handle handle, u32 level,
@@ -2292,7 +2292,7 @@ static irqreturn_t sony_pic_irq(int irq, void *dev_id)
 
 found:
 	sony_laptop_report_input_event(device_event);
-	acpi_bus_generate_event(spic_dev.acpi_dev, 1, device_event);
+	acpi_bus_generate_proc_event(spic_dev.acpi_dev, 1, device_event);
 	sonypi_compat_report_event(device_event);
 
 	return IRQ_HANDLED;
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
index d0825a3..bb8956d 100644
--- a/drivers/misc/thinkpad_acpi.c
+++ b/drivers/misc/thinkpad_acpi.c
@@ -1190,10 +1190,10 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
 		}
 
 		if (sendacpi)
-			acpi_bus_generate_event(ibm->acpi->device, event, hkey);
+			acpi_bus_generate_proc_event(ibm->acpi->device, event, hkey);
 	} else {
 		printk(IBM_ERR "unknown hotkey notification event %d\n", event);
-		acpi_bus_generate_event(ibm->acpi->device, event, 0);
+		acpi_bus_generate_proc_event(ibm->acpi->device, event, 0);
 	}
 }
 
@@ -2179,7 +2179,7 @@ static void dock_notify(struct ibm_struct *ibm, u32 event)
 		       event, _sta(dock_handle));
 		data = 0;	/* unknown */
 	}
-	acpi_bus_generate_event(ibm->acpi->device, event, data);
+	acpi_bus_generate_proc_event(ibm->acpi->device, event, data);
 	acpi_bus_generate_netlink_event(ibm->acpi->device->pnp.device_class,
 					  ibm->acpi->device->dev.bus_id,
 					  event, data);
@@ -2280,7 +2280,7 @@ static int __init bay_init(struct ibm_init_struct *iibm)
 
 static void bay_notify(struct ibm_struct *ibm, u32 event)
 {
-	acpi_bus_generate_event(ibm->acpi->device, event, 0);
+	acpi_bus_generate_proc_event(ibm->acpi->device, event, 0);
 	acpi_bus_generate_netlink_event(ibm->acpi->device->pnp.device_class,
 					  ibm->acpi->device->dev.bus_id,
 					  event, 0);
diff --git a/drivers/pci/hotplug/acpiphp_ibm.c b/drivers/pci/hotplug/acpiphp_ibm.c
index 3609024..d2c410c 100644
--- a/drivers/pci/hotplug/acpiphp_ibm.c
+++ b/drivers/pci/hotplug/acpiphp_ibm.c
@@ -267,7 +267,7 @@ static void ibm_handle_events(acpi_handle handle, u32 event, void *context)
 
 	if (subevent == 0x80) {
 		dbg("%s: generationg bus event\n", __FUNCTION__);
-		acpi_bus_generate_event(note->device, note->event, detail);
+		acpi_bus_generate_proc_event(note->device, note->event, detail);
 		acpi_bus_generate_netlink_event(note->device->pnp.device_class,
 						  note->device->dev.bus_id,
 						  note->event, detail);
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 8203cdd..86aea44 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -331,8 +331,13 @@ void acpi_bus_data_handler(acpi_handle handle, u32 function, void *context);
 int acpi_bus_get_status(struct acpi_device *device);
 int acpi_bus_get_power(acpi_handle handle, int *state);
 int acpi_bus_set_power(acpi_handle handle, int state);
-int acpi_bus_generate_event(struct acpi_device *device, u8 type, int data);
+#ifdef CONFIG_ACPI_PROC_EVENT
+int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data);
 int acpi_bus_receive_event(struct acpi_bus_event *event);
+#else
+static inline int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data)
+	{ return 0; }
+#endif
 int acpi_bus_register_driver(struct acpi_driver *driver);
 void acpi_bus_unregister_driver(struct acpi_driver *driver);
 int acpi_bus_add(struct acpi_device **child, struct acpi_device *parent,
-- 
1.5.3.rc6.17.g1911

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 09/25] ACPI: Fix a warning of discarding qualifiers from pointer target type
       [not found]   ` <f63211caacf6822049f02015faf1b78ba7a7984f.1187939442.git.len.brown@intel.com>
@ 2007-08-24  7:20     ` Len Brown
  0 siblings, 0 replies; 28+ messages in thread
From: Len Brown @ 2007-08-24  7:20 UTC (permalink / raw)
  To: linux-acpi; +Cc: Al Viro, Al Viro, Len Brown

From: Al Viro <viro@ftp.linux.org.uk>

drivers/acpi/ec.c: In function `acpi_ec_ecdt_probe':
drivers/acpi/ec.c:873: warning: passing arg 1 of `acpi_get_devices' discards qualifiers from pointer target type

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/namespace/nsxfeval.c |    2 +-
 include/acpi/acpixf.h             |    2 +-
 include/acpi/acstruct.h           |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/acpi/namespace/nsxfeval.c b/drivers/acpi/namespace/nsxfeval.c
index ab65b2c..f39fbc6 100644
--- a/drivers/acpi/namespace/nsxfeval.c
+++ b/drivers/acpi/namespace/nsxfeval.c
@@ -540,7 +540,7 @@ acpi_ns_get_device_callback(acpi_handle obj_handle,
  ******************************************************************************/
 
 acpi_status
-acpi_get_devices(char *HID,
+acpi_get_devices(const char *HID,
 		 acpi_walk_callback user_function,
 		 void *context, void **return_value)
 {
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index b5cca5d..3d7ab9e 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -130,7 +130,7 @@ acpi_walk_namespace(acpi_object_type type,
 		    void *context, void **return_value);
 
 acpi_status
-acpi_get_devices(char *HID,
+acpi_get_devices(const char *HID,
 		 acpi_walk_callback user_function,
 		 void *context, void **return_value);
 
diff --git a/include/acpi/acstruct.h b/include/acpi/acstruct.h
index aeb4498..8848265 100644
--- a/include/acpi/acstruct.h
+++ b/include/acpi/acstruct.h
@@ -146,7 +146,7 @@ struct acpi_init_walk_info {
 struct acpi_get_devices_info {
 	acpi_walk_callback user_function;
 	void *context;
-	char *hid;
+	const char *hid;
 };
 
 union acpi_aml_operands {
-- 
1.5.3.rc6.17.g1911

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 10/25] ACPI: video: Add keycode for ACPI video driver hotkey events.
       [not found]   ` <a7ecd1ea913346a72f41a002c365882dc05c9bd5.1187939442.git.len.brown@intel.com>
@ 2007-08-24  7:20     ` Len Brown
  0 siblings, 0 replies; 28+ messages in thread
From: Len Brown @ 2007-08-24  7:20 UTC (permalink / raw)
  To: linux-acpi; +Cc: Yu Luming, Zhang Rui, Len Brown

From: Yu Luming <luming.yu@intel.com>

Signed-off-by: Luming Yu <luming.yu@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 include/linux/input.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/include/linux/input.h b/include/linux/input.h
index e02c6a6..cf2b561 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -363,6 +363,12 @@ struct input_absinfo {
 
 #define KEY_UNKNOWN		240
 
+#define KEY_VIDEO_NEXT		241	/* drive next video source */
+#define KEY_VIDEO_PREV		242	/* drive previous video source */
+#define KEY_BRIGHTNESS_CYCLE	243	/* brightness up, after max is min */
+#define KEY_BRIGHTNESS_ZERO	244	/* brightness off, use ambient */
+#define KEY_DISPLAY_OFF		245	/* display device to off state */
+
 #define BTN_MISC		0x100
 #define BTN_0			0x100
 #define BTN_1			0x101
-- 
1.5.3.rc6.17.g1911

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 11/25] ACPI video hotkey: remove invalid events handler for video output devices
       [not found]   ` <a1eb96a2f635cdb8f626f4074dae2ba5a6fce1e8.1187939442.git.len.brown@intel.com>
@ 2007-08-24  7:20     ` Len Brown
  0 siblings, 0 replies; 28+ messages in thread
From: Len Brown @ 2007-08-24  7:20 UTC (permalink / raw)
  To: linux-acpi; +Cc: Zhang Rui, Len Brown

From: Zhang Rui <rui.zhang@intel.com>

Both ACPI_VIDEO_NOTIFY_SWITCH and ACPI_VIDEO_NOTIFY_PROBE
are valid for video bus devices only. Actually ACPI video output
device should never be notified for a output device switch/probe.

ACPI bus devices notify handler already has the code to
handle these kinds of events.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/video.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index d987019..8efdea5 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -1813,10 +1813,6 @@ static void acpi_video_device_notify(acpi_handle handle, u32 event, void *data)
 	device = video_device->dev;
 
 	switch (event) {
-	case ACPI_VIDEO_NOTIFY_SWITCH:	/* change in status (cycle output device) */
-	case ACPI_VIDEO_NOTIFY_PROBE:	/* change in status (output device status) */
-		acpi_bus_generate_event(device, event, 0);
-		break;
 	case ACPI_VIDEO_NOTIFY_CYCLE_BRIGHTNESS:	/* Cycle brightness */
 	case ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS:	/* Increase brightness */
 	case ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS:	/* Decrease brightness */
-- 
1.5.3.rc6.17.g1911

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 12/25] ACPI video hotkey: export ACPI video hotkey events via input layer
       [not found]   ` <745ce81328d09b1a5ebddacd1fffc20905d1cce3.1187939442.git.len.brown@intel.com>
@ 2007-08-24  7:20     ` Len Brown
  0 siblings, 0 replies; 28+ messages in thread
From: Len Brown @ 2007-08-24  7:20 UTC (permalink / raw)
  To: linux-acpi; +Cc: Luming Yu, Zhang Rui, Len Brown

From: Luming Yu <luming.yu@intel.com>

Export ACPI video hotkey events via input layer.

Signed-off-by: Yu Luming <luming.yu@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/video.c |   89 +++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 88 insertions(+), 1 deletions(-)

diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 8efdea5..d727d2c 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -31,7 +31,7 @@
 #include <linux/list.h>
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
-
+#include <linux/input.h>
 #include <linux/backlight.h>
 #include <linux/video_output.h>
 #include <asm/uaccess.h>
@@ -138,6 +138,8 @@ struct acpi_video_bus {
 	struct semaphore sem;
 	struct list_head video_device_list;
 	struct proc_dir_entry *dir;
+	struct input_dev *input;
+	char phys[32];	/* for input device */
 };
 
 struct acpi_video_device_flags {
@@ -1764,6 +1766,9 @@ static void acpi_video_bus_notify(acpi_handle handle, u32 event, void *data)
 {
 	struct acpi_video_bus *video = data;
 	struct acpi_device *device = NULL;
+	struct input_dev *input;
+	int keycode;
+
 
 	printk("video bus notify\n");
 
@@ -1771,11 +1776,13 @@ static void acpi_video_bus_notify(acpi_handle handle, u32 event, void *data)
 		return;
 
 	device = video->device;
+	input = video->input;
 
 	switch (event) {
 	case ACPI_VIDEO_NOTIFY_SWITCH:	/* User requested a switch,
 					 * most likely via hotkey. */
 		acpi_bus_generate_event(device, event, 0);
+		keycode = KEY_SWITCHVIDEOMODE;
 		break;
 
 	case ACPI_VIDEO_NOTIFY_PROBE:	/* User plugged in or removed a video
@@ -1784,21 +1791,37 @@ static void acpi_video_bus_notify(acpi_handle handle, u32 event, void *data)
 		acpi_video_device_rebind(video);
 		acpi_video_switch_output(video, event);
 		acpi_bus_generate_event(device, event, 0);
+		keycode = KEY_SWITCHVIDEOMODE;
 		break;
 
 	case ACPI_VIDEO_NOTIFY_CYCLE:	/* Cycle Display output hotkey pressed. */
+		acpi_video_switch_output(video, event);
+		acpi_bus_generate_event(device, event, 0);
+		keycode = KEY_SWITCHVIDEOMODE;
+		break;
 	case ACPI_VIDEO_NOTIFY_NEXT_OUTPUT:	/* Next Display output hotkey pressed. */
+		acpi_video_switch_output(video, event);
+		acpi_bus_generate_event(device, event, 0);
+		keycode = KEY_VIDEO_NEXT;
+		break;
 	case ACPI_VIDEO_NOTIFY_PREV_OUTPUT:	/* previous Display output hotkey pressed. */
 		acpi_video_switch_output(video, event);
 		acpi_bus_generate_event(device, event, 0);
+		keycode = KEY_VIDEO_PREV;
 		break;
 
 	default:
+		keycode = KEY_UNKNOWN;
 		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
 				  "Unsupported event [0x%x]\n", event));
 		break;
 	}
 
+	input_report_key(input, keycode, 1);
+	input_sync(input);
+	input_report_key(input, keycode, 0);
+	input_sync(input);
+
 	return;
 }
 
@@ -1806,26 +1829,55 @@ static void acpi_video_device_notify(acpi_handle handle, u32 event, void *data)
 {
 	struct acpi_video_device *video_device = data;
 	struct acpi_device *device = NULL;
+	struct acpi_video_bus *bus;
+	struct input_dev *input;
+	int keycode;
 
 	if (!video_device)
 		return;
 
 	device = video_device->dev;
+	bus = video_device->video;
+	input = bus->input;
 
 	switch (event) {
 	case ACPI_VIDEO_NOTIFY_CYCLE_BRIGHTNESS:	/* Cycle brightness */
+		acpi_video_switch_brightness(video_device, event);
+		acpi_bus_generate_event(device, event, 0);
+		keycode = KEY_BRIGHTNESS_CYCLE;
+		break;
 	case ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS:	/* Increase brightness */
+		acpi_video_switch_brightness(video_device, event);
+		acpi_bus_generate_event(device, event, 0);
+		keycode = KEY_BRIGHTNESSUP;
+		break;
 	case ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS:	/* Decrease brightness */
+		acpi_video_switch_brightness(video_device, event);
+		acpi_bus_generate_event(device, event, 0);
+		keycode = KEY_BRIGHTNESSDOWN;
+		break;
 	case ACPI_VIDEO_NOTIFY_ZERO_BRIGHTNESS:	/* zero brightnesss */
+		acpi_video_switch_brightness(video_device, event);
+		acpi_bus_generate_event(device, event, 0);
+		keycode = KEY_BRIGHTNESS_ZERO;
+		break;
 	case ACPI_VIDEO_NOTIFY_DISPLAY_OFF:	/* display device off */
 		acpi_video_switch_brightness(video_device, event);
 		acpi_bus_generate_event(device, event, 0);
+		keycode = KEY_DISPLAY_OFF;
 		break;
 	default:
+		keycode = KEY_UNKNOWN;
 		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
 				  "Unsupported event [0x%x]\n", event));
 		break;
 	}
+
+	input_report_key(input, keycode, 1);
+	input_sync(input);
+	input_report_key(input, keycode, 0);
+	input_sync(input);
+
 	return;
 }
 
@@ -1834,6 +1886,7 @@ static int acpi_video_bus_add(struct acpi_device *device)
 	int result = 0;
 	acpi_status status = 0;
 	struct acpi_video_bus *video = NULL;
+	struct input_dev *input;
 
 
 	if (!device)
@@ -1877,6 +1930,39 @@ static int acpi_video_bus_add(struct acpi_device *device)
 		goto end;
 	}
 
+
+	video->input = input = input_allocate_device();
+
+	snprintf(video->phys, sizeof(video->phys),
+		"%s/video/input0", acpi_device_hid(video->device));
+
+	input->name = acpi_device_name(video->device);
+	input->phys = video->phys;
+	input->id.bustype = BUS_HOST;
+	input->id.product = 0x06;
+	input->evbit[0] = BIT(EV_KEY);
+	set_bit(KEY_SWITCHVIDEOMODE, input->keybit);
+	set_bit(KEY_VIDEO_NEXT, input->keybit);
+	set_bit(KEY_VIDEO_PREV, input->keybit);
+	set_bit(KEY_BRIGHTNESS_CYCLE, input->keybit);
+	set_bit(KEY_BRIGHTNESSUP, input->keybit);
+	set_bit(KEY_BRIGHTNESSDOWN, input->keybit);
+	set_bit(KEY_BRIGHTNESS_ZERO, input->keybit);
+	set_bit(KEY_DISPLAY_OFF, input->keybit);
+	set_bit(KEY_UNKNOWN, input->keybit);
+	result = input_register_device(input);
+	if (result) {
+		acpi_remove_notify_handler(video->device->handle,
+						ACPI_DEVICE_NOTIFY,
+						acpi_video_bus_notify);
+		acpi_video_bus_stop_devices(video);
+		acpi_video_bus_put_devices(video);
+		kfree(video->attached_array);
+		acpi_video_bus_remove_fs(device);
+		goto end;
+        }
+
+
 	printk(KERN_INFO PREFIX "%s [%s] (multi-head: %s  rom: %s  post: %s)\n",
 	       ACPI_VIDEO_DEVICE_NAME, acpi_device_bid(device),
 	       video->flags.multihead ? "yes" : "no",
@@ -1910,6 +1996,7 @@ static int acpi_video_bus_remove(struct acpi_device *device, int type)
 	acpi_video_bus_put_devices(video);
 	acpi_video_bus_remove_fs(device);
 
+	input_unregister_device(video->input);
 	kfree(video->attached_array);
 	kfree(video);
 
-- 
1.5.3.rc6.17.g1911

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 13/25] ACPI: EC: revert fix for bugzilla 8709
       [not found]   ` <f9319f903f898dd4b15dbc386499725ce6c59776.1187939442.git.len.brown@intel.com>
@ 2007-08-24  7:21     ` Len Brown
  0 siblings, 0 replies; 28+ messages in thread
From: Len Brown @ 2007-08-24  7:21 UTC (permalink / raw)
  To: linux-acpi; +Cc: Alexey Starikovskiy, Alexey Starikovskiy, Len Brown

From: Alexey Starikovskiy <astarikovskiy@novell.com>

This is a manual revert of 7c010de7506954e973abfab5c5999c5a97f7a73e,
a fix that broke another ASUS in 8909 and 8919.

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/ec.c |   47 +++++++++++++++++++++++++++++++----------------
 1 files changed, 31 insertions(+), 16 deletions(-)

diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 56bee9e..43749c8 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -696,14 +696,6 @@ ec_parse_device(acpi_handle handle, u32 Level, void *context, void **retval)
 	return AE_CTRL_TERMINATE;
 }
 
-static void ec_remove_handlers(struct acpi_ec *ec)
-{
-	acpi_remove_address_space_handler(ec->handle,
-					  ACPI_ADR_SPACE_EC,
-					  &acpi_ec_space_handler);
-	acpi_remove_gpe_handler(NULL, ec->gpe, &acpi_ec_gpe_handler);
-}
-
 static int acpi_ec_add(struct acpi_device *device)
 {
 	struct acpi_ec *ec = NULL;
@@ -727,13 +719,16 @@ static int acpi_ec_add(struct acpi_device *device)
 	/* Check if we found the boot EC */
 	if (boot_ec) {
 		if (boot_ec->gpe == ec->gpe) {
-			ec_remove_handlers(boot_ec);
-			mutex_destroy(&boot_ec->lock);
-			kfree(boot_ec);
-			first_ec = boot_ec = NULL;
+			/* We might have incorrect info for GL at boot time */
+			mutex_lock(&boot_ec->lock);
+			boot_ec->global_lock = ec->global_lock;
+			/* Copy handlers from new ec into boot ec */
+			list_splice(&ec->list, &boot_ec->list);
+			mutex_unlock(&boot_ec->lock);
+			kfree(ec);
+			ec = boot_ec;
 		}
-	}
-	if (!first_ec)
+	} else
 		first_ec = ec;
 	ec->handle = device->handle;
 	acpi_driver_data(device) = ec;
@@ -762,6 +757,9 @@ static int acpi_ec_remove(struct acpi_device *device, int type)
 	if (ec == first_ec)
 		first_ec = NULL;
 
+	/* Don't touch boot EC */
+	if (boot_ec != ec)
+		kfree(ec);
 	return 0;
 }
 
@@ -825,7 +823,9 @@ static int acpi_ec_start(struct acpi_device *device)
 	if (!ec)
 		return -EINVAL;
 
-	ret = ec_install_handlers(ec);
+	/* Boot EC is already working */
+	if (ec != boot_ec)
+		ret = ec_install_handlers(ec);
 
 	/* EC is fully operational, allow queries */
 	atomic_set(&ec->query_pending, 0);
@@ -835,6 +835,7 @@ static int acpi_ec_start(struct acpi_device *device)
 
 static int acpi_ec_stop(struct acpi_device *device, int type)
 {
+	acpi_status status;
 	struct acpi_ec *ec;
 
 	if (!device)
@@ -843,7 +844,21 @@ static int acpi_ec_stop(struct acpi_device *device, int type)
 	ec = acpi_driver_data(device);
 	if (!ec)
 		return -EINVAL;
-	ec_remove_handlers(ec);
+
+	/* Don't touch boot EC */
+	if (ec == boot_ec)
+		return 0;
+
+	status = acpi_remove_address_space_handler(ec->handle,
+						   ACPI_ADR_SPACE_EC,
+						   &acpi_ec_space_handler);
+	if (ACPI_FAILURE(status))
+		return -ENODEV;
+
+	status = acpi_remove_gpe_handler(NULL, ec->gpe, &acpi_ec_gpe_handler);
+	if (ACPI_FAILURE(status))
+		return -ENODEV;
+
 	return 0;
 }
 
-- 
1.5.3.rc6.17.g1911

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 14/25] sony-laptop: enable Vaio FZ events
       [not found]   ` <f46d1604ed84e5a4107bae1db7283e3a76d72ace.1187939442.git.len.brown@intel.com>
@ 2007-08-24  7:21     ` Len Brown
  0 siblings, 0 replies; 28+ messages in thread
From: Len Brown @ 2007-08-24  7:21 UTC (permalink / raw)
  To: linux-acpi; +Cc: Mattia Dongili, Len Brown

From: Mattia Dongili <malattia@linux.it>

Signed-off-by: Mattia Dongili <malattia@linux.it>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/misc/sony-laptop.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/misc/sony-laptop.c b/drivers/misc/sony-laptop.c
index 91da688..7707cc2 100644
--- a/drivers/misc/sony-laptop.c
+++ b/drivers/misc/sony-laptop.c
@@ -856,6 +856,15 @@ static struct dmi_system_id sony_nc_ids[] = {
 			},
 		},
 		{
+			.ident = "Sony Vaio FZ Series",
+			.callback = sony_nc_C_enable,
+			.driver_data = sony_C_events,
+			.matches = {
+				DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
+				DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FZ"),
+			},
+		},
+		{
 			.ident = "Sony Vaio C Series",
 			.callback = sony_nc_C_enable,
 			.driver_data = sony_C_events,
-- 
1.5.3.rc6.17.g1911

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 15/25] sony-laptop: call sonypi_compat_init earlier
       [not found]   ` <015a916fbbf105bb15f4bbfd80c3b9b2f2e0d7db.1187939442.git.len.brown@intel.com>
@ 2007-08-24  7:21     ` Len Brown
  0 siblings, 0 replies; 28+ messages in thread
From: Len Brown @ 2007-08-24  7:21 UTC (permalink / raw)
  To: linux-acpi; +Cc: Mattia Dongili, Len Brown

From: Mattia Dongili <malattia@linux.it>

sonypi_compat uses a kfifo that needs to be present before _SRS is
called to be able to cope with the IRQs triggered when setting
resources.

Signed-off-by: Mattia Dongili <malattia@linux.it>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/misc/sony-laptop.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/misc/sony-laptop.c b/drivers/misc/sony-laptop.c
index 7707cc2..7d8bebe 100644
--- a/drivers/misc/sony-laptop.c
+++ b/drivers/misc/sony-laptop.c
@@ -2317,8 +2317,6 @@ static int sony_pic_remove(struct acpi_device *device, int type)
 	struct sony_pic_ioport *io, *tmp_io;
 	struct sony_pic_irq *irq, *tmp_irq;
 
-	sonypi_compat_exit();
-
 	if (sony_pic_disable(device)) {
 		printk(KERN_ERR DRV_PFX "Couldn't disable device.\n");
 		return -ENXIO;
@@ -2328,6 +2326,8 @@ static int sony_pic_remove(struct acpi_device *device, int type)
 	release_region(spic_dev.cur_ioport->io.minimum,
 			spic_dev.cur_ioport->io.address_length);
 
+	sonypi_compat_exit();
+
 	sony_laptop_remove_input();
 
 	/* pf attrs */
@@ -2393,6 +2393,9 @@ static int sony_pic_add(struct acpi_device *device)
 		goto err_free_resources;
 	}
 
+	if (sonypi_compat_init())
+		goto err_remove_input;
+
 	/* request io port */
 	list_for_each_entry(io, &spic_dev.ioports, list) {
 		if (request_region(io->io.minimum, io->io.address_length,
@@ -2407,7 +2410,7 @@ static int sony_pic_add(struct acpi_device *device)
 	if (!spic_dev.cur_ioport) {
 		printk(KERN_ERR DRV_PFX "Failed to request_region.\n");
 		result = -ENODEV;
-		goto err_remove_input;
+		goto err_remove_compat;
 	}
 
 	/* request IRQ */
@@ -2447,9 +2450,6 @@ static int sony_pic_add(struct acpi_device *device)
 	if (result)
 		goto err_remove_pf;
 
-	if (sonypi_compat_init())
-		goto err_remove_pf;
-
 	return 0;
 
 err_remove_pf:
@@ -2465,6 +2465,9 @@ err_release_region:
 	release_region(spic_dev.cur_ioport->io.minimum,
 			spic_dev.cur_ioport->io.address_length);
 
+err_remove_compat:
+	sonypi_compat_exit();
+
 err_remove_input:
 	sony_laptop_remove_input();
 
-- 
1.5.3.rc6.17.g1911

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 16/25] asus-laptop: Fix rmmod of asus_laptop
       [not found]   ` <e1996a69e162b1c99c3d3802684d1c388b54f47d.1187939442.git.len.brown@intel.com>
@ 2007-08-24  7:21     ` Len Brown
  0 siblings, 0 replies; 28+ messages in thread
From: Len Brown @ 2007-08-24  7:21 UTC (permalink / raw)
  To: linux-acpi; +Cc: Guillaume Chazarain, Len Brown

From: Guillaume Chazarain <guichaz@yahoo.fr>

The asus laptop driver conditionnaly registers leds in asus_led_register()
depending on their availability, but unconditionnaly unregisters them all at
exit time or when the module fails to load. Unregistering not registered leds
result in the following Oops. So we should check before unregistering.

 [<c032d2f9>] do_page_fault+0x511/0x5e9
 [<c032bae2>] error_code+0x6a/0x70
 [<c026abf8>] device_unregister+0x26/0x32
 [<f8864218>] led_classdev_unregister+0x58/0x94 [led_class]
 [<f88a90f8>] asus_led_exit+0x17/0x41 [asus_laptop]
 [<f88a91c9>] asus_laptop_exit+0xd/0x3f [asus_laptop]
 [<c013cee1>] sys_delete_module+0x17b/0x1a2
 [<c0106eae>] sysenter_past_esp+0x6b/0xa1

EIP: [<c026a9a3>] device_del+0xb/0x23a SS:ESP 0068:f594ef0c

Signed-off-by: Guillaume Chazarain <guichaz@yahoo.fr>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/misc/asus-laptop.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/misc/asus-laptop.c b/drivers/misc/asus-laptop.c
index d0fc4fd..40db9f7 100644
--- a/drivers/misc/asus-laptop.c
+++ b/drivers/misc/asus-laptop.c
@@ -1072,7 +1072,8 @@ static void asus_backlight_exit(void)
 }
 
 #define  ASUS_LED_UNREGISTER(object)				\
-	led_classdev_unregister(&object##_led)
+	if (object##_led.dev)					\
+		led_classdev_unregister(&object##_led)
 
 static void asus_led_exit(void)
 {
-- 
1.5.3.rc6.17.g1911

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 17/25] ACPI: enable GPEs before calling _WAK on resume
       [not found]   ` <79d2dfaa4e787f94b7f65f4611bc7d1c8d85fabc.1187939442.git.len.brown@intel.com>
@ 2007-08-24  7:21     ` Len Brown
  0 siblings, 0 replies; 28+ messages in thread
From: Len Brown @ 2007-08-24  7:21 UTC (permalink / raw)
  To: linux-acpi; +Cc: Thomas Renninger, Andrew Morton, Len Brown

From: Thomas Renninger <trenn@suse.de>

It seems it's required to enable GPEs before _WAK.  E.g.  X60 triggers a
LID related GPE instead of doing a Notify in WAK.  Now the GPE reaches the
kernel and the Notify for LID status change gets thrown from there.

Signed-off-by: Thomas Renninger <trenn@suse.de>
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/hardware/hwsleep.c |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/drivers/acpi/hardware/hwsleep.c b/drivers/acpi/hardware/hwsleep.c
index 76c525d..cf69c00 100644
--- a/drivers/acpi/hardware/hwsleep.c
+++ b/drivers/acpi/hardware/hwsleep.c
@@ -576,13 +576,10 @@ acpi_status acpi_leave_sleep_state(u8 sleep_state)
 		ACPI_EXCEPTION((AE_INFO, status, "During Method _BFS"));
 	}
 
-	status = acpi_evaluate_object(NULL, METHOD_NAME__WAK, &arg_list, NULL);
-	if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
-		ACPI_EXCEPTION((AE_INFO, status, "During Method _WAK"));
-	}
-	/* TBD: _WAK "sometimes" returns stuff - do we want to look at it? */
-
 	/*
+	 * GPEs must be enabled before _WAK is called as GPEs
+	 * might get fired there
+	 *
 	 * Restore the GPEs:
 	 * 1) Disable/Clear all GPEs
 	 * 2) Enable all runtime GPEs
@@ -591,13 +588,19 @@ acpi_status acpi_leave_sleep_state(u8 sleep_state)
 	if (ACPI_FAILURE(status)) {
 		return_ACPI_STATUS(status);
 	}
-	acpi_gbl_system_awake_and_running = TRUE;
-
 	status = acpi_hw_enable_all_runtime_gpes();
 	if (ACPI_FAILURE(status)) {
 		return_ACPI_STATUS(status);
 	}
 
+	status = acpi_evaluate_object(NULL, METHOD_NAME__WAK, &arg_list, NULL);
+	if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
+		ACPI_EXCEPTION((AE_INFO, status, "During Method _WAK"));
+	}
+	/* TBD: _WAK "sometimes" returns stuff - do we want to look at it? */
+
+	acpi_gbl_system_awake_and_running = TRUE;
+
 	/* Enable power button */
 
 	(void)
-- 
1.5.3.rc6.17.g1911

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 18/25] PNP: fix up after Lindent
       [not found]   ` <1e0aa9ad721349781b728ec4226876247e3fd431.1187939442.git.len.brown@intel.com>
@ 2007-08-24  7:21     ` Len Brown
  0 siblings, 0 replies; 28+ messages in thread
From: Len Brown @ 2007-08-24  7:21 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bjorn Helgaas, Len Brown

From: Bjorn Helgaas <bjorn.helgaas@hp.com>

More manual fixups after Lindent.  No functional change.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-by: Adam Belay <abelay@novell.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/pnp/card.c             |   16 ++++++++--------
 drivers/pnp/driver.c           |    2 +-
 drivers/pnp/interface.c        |    9 +++++----
 drivers/pnp/isapnp/core.c      |   15 ++++++---------
 drivers/pnp/manager.c          |    4 ++--
 drivers/pnp/pnpacpi/core.c     |    4 ++--
 drivers/pnp/pnpacpi/rsparser.c |    1 +
 drivers/pnp/pnpbios/core.c     |    1 +
 drivers/pnp/pnpbios/proc.c     |    2 +-
 drivers/pnp/pnpbios/rsparser.c |    9 +++++----
 10 files changed, 32 insertions(+), 31 deletions(-)

diff --git a/drivers/pnp/card.c b/drivers/pnp/card.c
index b6a4f02..6c0440c 100644
--- a/drivers/pnp/card.c
+++ b/drivers/pnp/card.c
@@ -25,13 +25,13 @@ static const struct pnp_card_device_id *match_card(struct pnp_card_driver *drv,
 				int found;
 				struct pnp_dev *dev;
 
-				if (i == PNP_MAX_DEVICES
-				    || !*drv_id->devs[i].id)
+				if (i == PNP_MAX_DEVICES ||
+				    !*drv_id->devs[i].id)
 					return drv_id;
 				found = 0;
 				card_for_each_dev(card, dev) {
-					if (compare_pnp_id
-					    (dev->id, drv_id->devs[i].id)) {
+					if (compare_pnp_id(dev->id,
+						   drv_id->devs[i].id)) {
 						found = 1;
 						break;
 					}
@@ -183,7 +183,7 @@ static int pnp_interface_attach_card(struct pnp_card *card)
 
 	return 0;
 
-      err_name:
+err_name:
 	device_remove_file(&card->dev, &dev_attr_name);
 	return rc;
 }
@@ -321,10 +321,10 @@ struct pnp_dev *pnp_request_card_device(struct pnp_card_link *clink,
 		pos = pos->next;
 	}
 
-      done:
+done:
 	return NULL;
 
-      found:
+found:
 	dev->card_link = clink;
 	dev->dev.driver = &drv->link.driver;
 	if (pnp_bus_type.probe(&dev->dev))
@@ -334,7 +334,7 @@ struct pnp_dev *pnp_request_card_device(struct pnp_card_link *clink,
 
 	return dev;
 
-      err_out:
+err_out:
 	dev->dev.driver = NULL;
 	dev->card_link = NULL;
 	return NULL;
diff --git a/drivers/pnp/driver.c b/drivers/pnp/driver.c
index 30b8f6f..9be01b0 100644
--- a/drivers/pnp/driver.c
+++ b/drivers/pnp/driver.c
@@ -118,7 +118,7 @@ static int pnp_device_probe(struct device *dev)
 		goto fail;
 	return error;
 
-      fail:
+fail:
 	pnp_device_detach(pnp_dev);
 	return error;
 }
diff --git a/drivers/pnp/interface.c b/drivers/pnp/interface.c
index fe6684e..a0cfb75 100644
--- a/drivers/pnp/interface.c
+++ b/drivers/pnp/interface.c
@@ -459,7 +459,8 @@ pnp_set_current_resources(struct device *dmdev, struct device_attribute *attr,
 		up(&pnp_res_mutex);
 		goto done;
 	}
-      done:
+
+done:
 	if (retval < 0)
 		return retval;
 	return count;
@@ -499,10 +500,10 @@ int pnp_interface_attach_device(struct pnp_dev *dev)
 
 	return 0;
 
-      err_res:
+err_res:
 	device_remove_file(&dev->dev, &dev_attr_resources);
-      err_opt:
+err_opt:
 	device_remove_file(&dev->dev, &dev_attr_options);
-      err:
+err:
 	return rc;
 }
diff --git a/drivers/pnp/isapnp/core.c b/drivers/pnp/isapnp/core.c
index b4e2aa9..32386ce 100644
--- a/drivers/pnp/isapnp/core.c
+++ b/drivers/pnp/isapnp/core.c
@@ -335,7 +335,7 @@ static int __init isapnp_isolate(void)
 		} else if (iteration > 1) {
 			break;
 		}
-	      __next:
+__next:
 		if (csn == 255)
 			break;
 		checksum = 0x6a;
@@ -733,7 +733,7 @@ static int __init isapnp_create_device(struct pnp_card *card,
 			       "isapnp: unexpected or unknown tag type 0x%x for logical device %i (device %i), ignored\n",
 			       type, dev->number, card->number);
 		}
-	      __skip:
+__skip:
 		if (size > 0)
 			isapnp_skip_bytes(size);
 	}
@@ -788,7 +788,7 @@ static void __init isapnp_parse_resource_map(struct pnp_card *card)
 			       "isapnp: unexpected or unknown tag type 0x%x for device %i, ignored\n",
 			       type, card->number);
 		}
-	      __skip:
+__skip:
 		if (size > 0)
 			isapnp_skip_bytes(size);
 	}
@@ -940,9 +940,6 @@ EXPORT_SYMBOL(isapnp_protocol);
 EXPORT_SYMBOL(isapnp_present);
 EXPORT_SYMBOL(isapnp_cfg_begin);
 EXPORT_SYMBOL(isapnp_cfg_end);
-#if 0
-EXPORT_SYMBOL(isapnp_read_byte);
-#endif
 EXPORT_SYMBOL(isapnp_write_byte);
 
 static int isapnp_read_resources(struct pnp_dev *dev,
@@ -993,6 +990,7 @@ static int isapnp_get_resources(struct pnp_dev *dev,
 				struct pnp_resource_table *res)
 {
 	int ret;
+
 	pnp_init_resource_table(res);
 	isapnp_cfg_begin(dev->card->number, dev->number);
 	ret = isapnp_read_resources(dev, res);
@@ -1148,13 +1146,12 @@ static int __init isapnp_init(void)
 			}
 		}
 	}
-	if (cards) {
+	if (cards)
 		printk(KERN_INFO
 		       "isapnp: %i Plug & Play card%s detected total\n", cards,
 		       cards > 1 ? "s" : "");
-	} else {
+	else
 		printk(KERN_INFO "isapnp: No Plug & Play card found\n");
-	}
 
 	isapnp_proc_init();
 	return 0;
diff --git a/drivers/pnp/manager.c b/drivers/pnp/manager.c
index 3bda513..329dc6c 100644
--- a/drivers/pnp/manager.c
+++ b/drivers/pnp/manager.c
@@ -390,7 +390,7 @@ static int pnp_assign_resources(struct pnp_dev *dev, int depnum)
 	up(&pnp_res_mutex);
 	return 1;
 
-      fail:
+fail:
 	pnp_clean_resource_table(&dev->res);
 	up(&pnp_res_mutex);
 	return 0;
@@ -444,7 +444,7 @@ int pnp_manual_config_dev(struct pnp_dev *dev, struct pnp_resource_table *res,
 	kfree(bak);
 	return 0;
 
-      fail:
+fail:
 	dev->res = *bak;
 	up(&pnp_res_mutex);
 	kfree(bak);
diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c
index 616fc72..a5a3722 100644
--- a/drivers/pnp/pnpacpi/core.c
+++ b/drivers/pnp/pnpacpi/core.c
@@ -248,9 +248,9 @@ static int __init pnpacpi_add_device(struct acpi_device *device)
 	num++;
 
 	return AE_OK;
-      err1:
+err1:
 	kfree(dev_id);
-      err:
+err:
 	kfree(dev);
 	return -EINVAL;
 }
diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c
index ce5027f..51478c0 100644
--- a/drivers/pnp/pnpacpi/rsparser.c
+++ b/drivers/pnp/pnpacpi/rsparser.c
@@ -35,6 +35,7 @@
 static int irq_flags(int triggering, int polarity)
 {
 	int flag;
+
 	if (triggering == ACPI_LEVEL_SENSITIVE) {
 		if (polarity == ACPI_ACTIVE_LOW)
 			flag = IORESOURCE_IRQ_LOWLEVEL;
diff --git a/drivers/pnp/pnpbios/core.c b/drivers/pnp/pnpbios/core.c
index 3692a09..9892a6a 100644
--- a/drivers/pnp/pnpbios/core.c
+++ b/drivers/pnp/pnpbios/core.c
@@ -591,6 +591,7 @@ subsys_initcall(pnpbios_init);
 static int __init pnpbios_thread_init(void)
 {
 	struct task_struct *task;
+
 #if defined(CONFIG_PPC_MERGE)
 	if (check_legacy_ioport(PNPBIOS_BASE))
 		return 0;
diff --git a/drivers/pnp/pnpbios/proc.c b/drivers/pnp/pnpbios/proc.c
index 9c8c077..9d9841f 100644
--- a/drivers/pnp/pnpbios/proc.c
+++ b/drivers/pnp/pnpbios/proc.c
@@ -212,7 +212,7 @@ static int proc_write_node(struct file *file, const char __user * buf,
 		goto out;
 	}
 	ret = count;
-      out:
+out:
 	kfree(node);
 	return ret;
 }
diff --git a/drivers/pnp/pnpbios/rsparser.c b/drivers/pnp/pnpbios/rsparser.c
index 04ecd7b..3fabf11 100644
--- a/drivers/pnp/pnpbios/rsparser.c
+++ b/drivers/pnp/pnpbios/rsparser.c
@@ -238,7 +238,7 @@ static unsigned char *pnpbios_parse_allocated_resource_data(unsigned char *p,
 			break;
 
 		default:	/* an unkown tag */
-		      len_err:
+len_err:
 			printk(KERN_ERR
 			       "PnPBIOS: Unknown tag '0x%x', length '%d'.\n",
 			       tag, len);
@@ -298,6 +298,7 @@ static void pnpbios_parse_fixed_mem32_option(unsigned char *p, int size,
 					     struct pnp_option *option)
 {
 	struct pnp_mem *mem;
+
 	mem = kzalloc(sizeof(struct pnp_mem), GFP_KERNEL);
 	if (!mem)
 		return;
@@ -468,7 +469,7 @@ static unsigned char *pnpbios_parse_resource_option_data(unsigned char *p,
 			return p + 2;
 
 		default:	/* an unkown tag */
-		      len_err:
+len_err:
 			printk(KERN_ERR
 			       "PnPBIOS: Unknown tag '0x%x', length '%d'.\n",
 			       tag, len);
@@ -562,7 +563,7 @@ static unsigned char *pnpbios_parse_compatible_ids(unsigned char *p,
 			break;
 
 		default:	/* an unkown tag */
-		      len_err:
+len_err:
 			printk(KERN_ERR
 			       "PnPBIOS: Unknown tag '0x%x', length '%d'.\n",
 			       tag, len);
@@ -756,7 +757,7 @@ static unsigned char *pnpbios_encode_allocated_resource_data(unsigned char *p,
 			break;
 
 		default:	/* an unkown tag */
-		      len_err:
+len_err:
 			printk(KERN_ERR
 			       "PnPBIOS: Unknown tag '0x%x', length '%d'.\n",
 			       tag, len);
-- 
1.5.3.rc6.17.g1911

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 19/25] PNPACPI: simplify irq_flags()
       [not found]   ` <4cec086b219224167c22dd020d3dd2d9220e1d98.1187939443.git.len.brown@intel.com>
@ 2007-08-24  7:21     ` Len Brown
  0 siblings, 0 replies; 28+ messages in thread
From: Len Brown @ 2007-08-24  7:21 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bjorn Helgaas, Len Brown

From: Bjorn Helgaas <bjorn.helgaas@hp.com>

No need for a temporary variable; just return the flags once we know them.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-by: Adam Belay <abelay@novell.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/pnp/pnpacpi/rsparser.c |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c
index 51478c0..a0784fe 100644
--- a/drivers/pnp/pnpacpi/rsparser.c
+++ b/drivers/pnp/pnpacpi/rsparser.c
@@ -34,20 +34,17 @@
  */
 static int irq_flags(int triggering, int polarity)
 {
-	int flag;
-
 	if (triggering == ACPI_LEVEL_SENSITIVE) {
 		if (polarity == ACPI_ACTIVE_LOW)
-			flag = IORESOURCE_IRQ_LOWLEVEL;
+			return IORESOURCE_IRQ_LOWLEVEL;
 		else
-			flag = IORESOURCE_IRQ_HIGHLEVEL;
+			return IORESOURCE_IRQ_HIGHLEVEL;
 	} else {
 		if (polarity == ACPI_ACTIVE_LOW)
-			flag = IORESOURCE_IRQ_LOWEDGE;
+			return IORESOURCE_IRQ_LOWEDGE;
 		else
-			flag = IORESOURCE_IRQ_HIGHEDGE;
+			return IORESOURCE_IRQ_HIGHEDGE;
 	}
-	return flag;
 }
 
 static void decode_irq_flags(int flag, int *triggering, int *polarity)
-- 
1.5.3.rc6.17.g1911

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 20/25] PNPACPI: remove unnecessary casts of "void *"
       [not found]   ` <4721a4cc8864f0eb92958c3e0479e7994e8b0072.1187939443.git.len.brown@intel.com>
@ 2007-08-24  7:21     ` Len Brown
  0 siblings, 0 replies; 28+ messages in thread
From: Len Brown @ 2007-08-24  7:21 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bjorn Helgaas, Len Brown

From: Bjorn Helgaas <bjorn.helgaas@hp.com>

Remove unnecessary casts of void pointers.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-by: Adam Belay <abelay@novell.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/pnp/pnpacpi/rsparser.c |   13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c
index a0784fe..0e3b8d0 100644
--- a/drivers/pnp/pnpacpi/rsparser.c
+++ b/drivers/pnp/pnpacpi/rsparser.c
@@ -240,8 +240,7 @@ static void pnpacpi_parse_allocated_address_space(struct pnp_resource_table *res
 static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res,
 					      void *data)
 {
-	struct pnp_resource_table *res_table =
-	    (struct pnp_resource_table *)data;
+	struct pnp_resource_table *res_table = data;
 	int i;
 
 	switch (res->type) {
@@ -564,8 +563,7 @@ static acpi_status pnpacpi_option_resource(struct acpi_resource *res,
 					   void *data)
 {
 	int priority = 0;
-	struct acpipnp_parse_option_s *parse_data =
-	    (struct acpipnp_parse_option_s *)data;
+	struct acpipnp_parse_option_s *parse_data = data;
 	struct pnp_dev *dev = parse_data->dev;
 	struct pnp_option *option = parse_data->option;
 
@@ -703,7 +701,7 @@ static int pnpacpi_supported_resource(struct acpi_resource *res)
 static acpi_status pnpacpi_count_resources(struct acpi_resource *res,
 					   void *data)
 {
-	int *res_cnt = (int *)data;
+	int *res_cnt = data;
 
 	if (pnpacpi_supported_resource(res))
 		(*res_cnt)++;
@@ -712,7 +710,7 @@ static acpi_status pnpacpi_count_resources(struct acpi_resource *res,
 
 static acpi_status pnpacpi_type_resources(struct acpi_resource *res, void *data)
 {
-	struct acpi_resource **resource = (struct acpi_resource **)data;
+	struct acpi_resource **resource = data;
 
 	if (pnpacpi_supported_resource(res)) {
 		(*resource)->type = res->type;
@@ -884,8 +882,7 @@ int pnpacpi_encode_resources(struct pnp_resource_table *res_table,
 	int i = 0;
 	/* pnpacpi_build_resource_template allocates extra mem */
 	int res_cnt = (buffer->length - 1) / sizeof(struct acpi_resource) - 1;
-	struct acpi_resource *resource =
-	    (struct acpi_resource *)buffer->pointer;
+	struct acpi_resource *resource = buffer->pointer;
 	int port = 0, irq = 0, dma = 0, mem = 0;
 
 	pnp_dbg("res cnt %d", res_cnt);
-- 
1.5.3.rc6.17.g1911

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 21/25] ISAPNP: removed unused isapnp_detected and ISAPNP_DEBUG
       [not found]   ` <6c504d30a48157b7c05a0dfb6a799c72095e957d.1187939443.git.len.brown@intel.com>
@ 2007-08-24  7:21     ` Len Brown
  0 siblings, 0 replies; 28+ messages in thread
From: Len Brown @ 2007-08-24  7:21 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bjorn Helgaas, Len Brown

From: Bjorn Helgaas <bjorn.helgaas@hp.com>

ISAPNP_DEBUG isn't used at all.  isapnp_detected is set but never read.
So remove them both.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-by: Adam Belay <abelay@novell.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/pnp/isapnp/core.c |    7 -------
 1 files changed, 0 insertions(+), 7 deletions(-)

diff --git a/drivers/pnp/isapnp/core.c b/drivers/pnp/isapnp/core.c
index 32386ce..1a0d33a 100644
--- a/drivers/pnp/isapnp/core.c
+++ b/drivers/pnp/isapnp/core.c
@@ -47,9 +47,6 @@
 #if 0
 #define ISAPNP_REGION_OK
 #endif
-#if 0
-#define ISAPNP_DEBUG
-#endif
 
 int isapnp_disable;		/* Disable ISA PnP */
 static int isapnp_rdp;		/* Read Data Port */
@@ -93,7 +90,6 @@ MODULE_LICENSE("GPL");
 
 static unsigned char isapnp_checksum_value;
 static DEFINE_MUTEX(isapnp_cfg_mutex);
-static int isapnp_detected;
 static int isapnp_csn_count;
 
 /* some prototypes */
@@ -1067,7 +1063,6 @@ static int __init isapnp_init(void)
 	struct pnp_dev *dev;
 
 	if (isapnp_disable) {
-		isapnp_detected = 0;
 		printk(KERN_INFO "isapnp: ISA Plug & Play support disabled\n");
 		return 0;
 	}
@@ -1115,7 +1110,6 @@ static int __init isapnp_init(void)
 		}
 		isapnp_set_rdp();
 	}
-	isapnp_detected = 1;
 	if (isapnp_rdp < 0x203 || isapnp_rdp > 0x3ff) {
 		cards = isapnp_isolate();
 		if (cards < 0 || (isapnp_rdp < 0x203 || isapnp_rdp > 0x3ff)) {
@@ -1123,7 +1117,6 @@ static int __init isapnp_init(void)
 			release_region(_PIDXR, 1);
 #endif
 			release_region(_PNPWRP, 1);
-			isapnp_detected = 0;
 			printk(KERN_INFO
 			       "isapnp: No Plug & Play device found\n");
 			return 0;
-- 
1.5.3.rc6.17.g1911

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 22/25] PNP: remove MODULE infrastructure
       [not found]   ` <4f0217e30249ac0eb13b65ef64f2aee627465da2.1187939443.git.len.brown@intel.com>
@ 2007-08-24  7:21     ` Len Brown
  0 siblings, 0 replies; 28+ messages in thread
From: Len Brown @ 2007-08-24  7:21 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bjorn Helgaas, Len Brown

From: Bjorn Helgaas <bjorn.helgaas@hp.com>

We don't support building any part of PNP as a module (*drivers* can be
modules, of course, but the PNP infrastructure itself can not).  Since
MODULE will never be defined, remove the ifdefs and dead code.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-by: Adam Belay <abelay@novell.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/pnp/isapnp/proc.c  |   45 --------------------------------------------
 drivers/pnp/pnpbios/core.c |   43 ------------------------------------------
 2 files changed, 0 insertions(+), 88 deletions(-)

diff --git a/drivers/pnp/isapnp/proc.c b/drivers/pnp/isapnp/proc.c
index 3fbc0f9..560ccb6 100644
--- a/drivers/pnp/isapnp/proc.c
+++ b/drivers/pnp/isapnp/proc.c
@@ -112,33 +112,6 @@ static int isapnp_proc_attach_device(struct pnp_dev *dev)
 	return 0;
 }
 
-#ifdef MODULE
-static int __exit isapnp_proc_detach_device(struct pnp_dev *dev)
-{
-	struct pnp_card *bus = dev->card;
-	struct proc_dir_entry *de;
-	char name[16];
-
-	if (!(de = bus->procdir))
-		return -EINVAL;
-	sprintf(name, "%02x", dev->number);
-	remove_proc_entry(name, de);
-	return 0;
-}
-
-static int __exit isapnp_proc_detach_bus(struct pnp_card *bus)
-{
-	struct proc_dir_entry *de;
-	char name[16];
-
-	if (!(de = bus->procdir))
-		return -EINVAL;
-	sprintf(name, "%02x", bus->number);
-	remove_proc_entry(name, isapnp_proc_bus_dir);
-	return 0;
-}
-#endif				/* MODULE */
-
 int __init isapnp_proc_init(void)
 {
 	struct pnp_dev *dev;
@@ -149,21 +122,3 @@ int __init isapnp_proc_init(void)
 	}
 	return 0;
 }
-
-#ifdef MODULE
-int __exit isapnp_proc_done(void)
-{
-	struct pnp_dev *dev;
-	struct pnp_bus *card;
-
-	isapnp_for_each_dev(dev) {
-		isapnp_proc_detach_device(dev);
-	}
-	isapnp_for_each_card(card) {
-		isapnp_proc_detach_bus(card);
-	}
-	if (isapnp_proc_bus_dir)
-		remove_proc_entry("isapnp", proc_bus);
-	return 0;
-}
-#endif				/* MODULE */
diff --git a/drivers/pnp/pnpbios/core.c b/drivers/pnp/pnpbios/core.c
index 9892a6a..0691f47 100644
--- a/drivers/pnp/pnpbios/core.c
+++ b/drivers/pnp/pnpbios/core.c
@@ -419,7 +419,6 @@ static void __init build_devlist(void)
 static int pnpbios_disabled;
 int pnpbios_dont_use_current_config;
 
-#ifndef MODULE
 static int __init pnpbios_setup(char *str)
 {
 	int invert;
@@ -443,7 +442,6 @@ static int __init pnpbios_setup(char *str)
 }
 
 __setup("pnpbios=", pnpbios_setup);
-#endif
 
 /* PnP BIOS signature: "$PnP" */
 #define PNP_SIGNATURE   (('$' << 0) + ('P' << 8) + ('n' << 16) + ('P' << 24))
@@ -607,48 +605,7 @@ static int __init pnpbios_thread_init(void)
 	return 0;
 }
 
-#ifndef MODULE
-
-/* init/main.c calls pnpbios_init early */
-
 /* Start the kernel thread later: */
 module_init(pnpbios_thread_init);
 
-#else
-
-/*
- * N.B.: Building pnpbios as a module hasn't been fully implemented
- */
-
-MODULE_LICENSE("GPL");
-
-static int __init pnpbios_init_all(void)
-{
-	int r;
-
-	r = pnpbios_init();
-	if (r)
-		return r;
-	r = pnpbios_thread_init();
-	if (r)
-		return r;
-	return 0;
-}
-
-static void __exit pnpbios_exit(void)
-{
-#ifdef CONFIG_HOTPLUG
-	unloading = 1;
-	wait_for_completion(&unload_sem);
-#endif
-	pnpbios_proc_exit();
-	/* We ought to free resources here */
-	return;
-}
-
-module_init(pnpbios_init_all);
-module_exit(pnpbios_exit);
-
-#endif
-
 EXPORT_SYMBOL(pnpbios_protocol);
-- 
1.5.3.rc6.17.g1911

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 23/25] PNP: remove null pointer checks
       [not found]   ` <b173491339b9ae7f1322241ce6228c1268513a39.1187939443.git.len.brown@intel.com>
@ 2007-08-24  7:21     ` Len Brown
  0 siblings, 0 replies; 28+ messages in thread
From: Len Brown @ 2007-08-24  7:21 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bjorn Helgaas, Len Brown

From: Bjorn Helgaas <bjorn.helgaas@hp.com>

Remove some null pointer checks.  Null pointers in these areas indicate
programming errors, and I think it's better to oops immediately rather
than return an error that is easily ignored.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-by: Adam Belay <abelay@novell.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/pnp/core.c        |    7 +------
 drivers/pnp/driver.c      |    4 ----
 drivers/pnp/isapnp/core.c |    2 +-
 drivers/pnp/manager.c     |   23 -----------------------
 drivers/pnp/resource.c    |   26 --------------------------
 5 files changed, 2 insertions(+), 60 deletions(-)

diff --git a/drivers/pnp/core.c b/drivers/pnp/core.c
index 61066fd..d5964fe 100644
--- a/drivers/pnp/core.c
+++ b/drivers/pnp/core.c
@@ -52,9 +52,6 @@ int pnp_register_protocol(struct pnp_protocol *protocol)
 	int nodenum;
 	struct list_head *pos;
 
-	if (!protocol)
-		return -EINVAL;
-
 	INIT_LIST_HEAD(&protocol->devices);
 	INIT_LIST_HEAD(&protocol->cards);
 	nodenum = 0;
@@ -94,8 +91,6 @@ static void pnp_free_ids(struct pnp_dev *dev)
 	struct pnp_id *id;
 	struct pnp_id *next;
 
-	if (!dev)
-		return;
 	id = dev->id;
 	while (id) {
 		next = id->next;
@@ -143,7 +138,7 @@ int __pnp_add_device(struct pnp_dev *dev)
  */
 int pnp_add_device(struct pnp_dev *dev)
 {
-	if (!dev || !dev->protocol || dev->card)
+	if (dev->card)
 		return -EINVAL;
 	dev->dev.parent = &dev->protocol->dev;
 	sprintf(dev->dev.bus_id, "%02x:%02x", dev->protocol->number,
diff --git a/drivers/pnp/driver.c b/drivers/pnp/driver.c
index 9be01b0..2fa64a6 100644
--- a/drivers/pnp/driver.c
+++ b/drivers/pnp/driver.c
@@ -232,10 +232,6 @@ int pnp_add_id(struct pnp_id *id, struct pnp_dev *dev)
 {
 	struct pnp_id *ptr;
 
-	if (!id)
-		return -EINVAL;
-	if (!dev)
-		return -EINVAL;
 	id->next = NULL;
 	ptr = dev->id;
 	while (ptr && ptr->next)
diff --git a/drivers/pnp/isapnp/core.c b/drivers/pnp/isapnp/core.c
index 1a0d33a..b035d60 100644
--- a/drivers/pnp/isapnp/core.c
+++ b/drivers/pnp/isapnp/core.c
@@ -1040,7 +1040,7 @@ static int isapnp_set_resources(struct pnp_dev *dev,
 
 static int isapnp_disable_resources(struct pnp_dev *dev)
 {
-	if (!dev || !dev->active)
+	if (!dev->active)
 		return -EINVAL;
 	isapnp_cfg_begin(dev->card->number, dev->number);
 	isapnp_deactivate(dev->number);
diff --git a/drivers/pnp/manager.c b/drivers/pnp/manager.c
index 329dc6c..0826287 100644
--- a/drivers/pnp/manager.c
+++ b/drivers/pnp/manager.c
@@ -21,9 +21,6 @@ static int pnp_assign_port(struct pnp_dev *dev, struct pnp_port *rule, int idx)
 	resource_size_t *start, *end;
 	unsigned long *flags;
 
-	if (!dev || !rule)
-		return -EINVAL;
-
 	if (idx >= PNP_MAX_PORT) {
 		pnp_err
 		    ("More than 4 ports is incompatible with pnp specifications.");
@@ -66,9 +63,6 @@ static int pnp_assign_mem(struct pnp_dev *dev, struct pnp_mem *rule, int idx)
 	resource_size_t *start, *end;
 	unsigned long *flags;
 
-	if (!dev || !rule)
-		return -EINVAL;
-
 	if (idx >= PNP_MAX_MEM) {
 		pnp_err
 		    ("More than 8 mems is incompatible with pnp specifications.");
@@ -127,9 +121,6 @@ static int pnp_assign_irq(struct pnp_dev *dev, struct pnp_irq *rule, int idx)
 		5, 10, 11, 12, 9, 14, 15, 7, 3, 4, 13, 0, 1, 6, 8, 2
 	};
 
-	if (!dev || !rule)
-		return -EINVAL;
-
 	if (idx >= PNP_MAX_IRQ) {
 		pnp_err
 		    ("More than 2 irqs is incompatible with pnp specifications.");
@@ -181,9 +172,6 @@ static int pnp_assign_dma(struct pnp_dev *dev, struct pnp_dma *rule, int idx)
 		1, 3, 5, 6, 7, 0, 2, 4
 	};
 
-	if (!dev || !rule)
-		return -EINVAL;
-
 	if (idx >= PNP_MAX_DMA) {
 		pnp_err
 		    ("More than 2 dmas is incompatible with pnp specifications.");
@@ -410,8 +398,6 @@ int pnp_manual_config_dev(struct pnp_dev *dev, struct pnp_resource_table *res,
 	int i;
 	struct pnp_resource_table *bak;
 
-	if (!dev || !res)
-		return -EINVAL;
 	if (!pnp_can_configure(dev))
 		return -ENODEV;
 	bak = pnp_alloc(sizeof(struct pnp_resource_table));
@@ -460,9 +446,6 @@ int pnp_auto_config_dev(struct pnp_dev *dev)
 	struct pnp_option *dep;
 	int i = 1;
 
-	if (!dev)
-		return -EINVAL;
-
 	if (!pnp_can_configure(dev)) {
 		pnp_dbg("Device %s does not support resource configuration.",
 			dev->dev.bus_id);
@@ -541,8 +524,6 @@ int pnp_activate_dev(struct pnp_dev *dev)
 {
 	int error;
 
-	if (!dev)
-		return -EINVAL;
 	if (dev->active)
 		return 0;	/* the device is already active */
 
@@ -568,8 +549,6 @@ int pnp_disable_dev(struct pnp_dev *dev)
 {
 	int error;
 
-	if (!dev)
-		return -EINVAL;
 	if (!dev->active)
 		return 0;	/* the device is already disabled */
 
@@ -596,8 +575,6 @@ int pnp_disable_dev(struct pnp_dev *dev)
 void pnp_resource_change(struct resource *resource, resource_size_t start,
 			 resource_size_t size)
 {
-	if (resource == NULL)
-		return;
 	resource->flags &= ~(IORESOURCE_AUTO | IORESOURCE_UNSET);
 	resource->start = start;
 	resource->end = start + size - 1;
diff --git a/drivers/pnp/resource.c b/drivers/pnp/resource.c
index ea6ec14..ef12869 100644
--- a/drivers/pnp/resource.c
+++ b/drivers/pnp/resource.c
@@ -47,9 +47,6 @@ struct pnp_option *pnp_register_independent_option(struct pnp_dev *dev)
 {
 	struct pnp_option *option;
 
-	if (!dev)
-		return NULL;
-
 	option = pnp_build_option(PNP_RES_PRIORITY_PREFERRED);
 
 	/* this should never happen but if it does we'll try to continue */
@@ -64,9 +61,6 @@ struct pnp_option *pnp_register_dependent_option(struct pnp_dev *dev,
 {
 	struct pnp_option *option;
 
-	if (!dev)
-		return NULL;
-
 	option = pnp_build_option(priority);
 
 	if (dev->dependent) {
@@ -83,11 +77,6 @@ int pnp_register_irq_resource(struct pnp_option *option, struct pnp_irq *data)
 {
 	struct pnp_irq *ptr;
 
-	if (!option)
-		return -EINVAL;
-	if (!data)
-		return -EINVAL;
-
 	ptr = option->irq;
 	while (ptr && ptr->next)
 		ptr = ptr->next;
@@ -112,11 +101,6 @@ int pnp_register_dma_resource(struct pnp_option *option, struct pnp_dma *data)
 {
 	struct pnp_dma *ptr;
 
-	if (!option)
-		return -EINVAL;
-	if (!data)
-		return -EINVAL;
-
 	ptr = option->dma;
 	while (ptr && ptr->next)
 		ptr = ptr->next;
@@ -132,11 +116,6 @@ int pnp_register_port_resource(struct pnp_option *option, struct pnp_port *data)
 {
 	struct pnp_port *ptr;
 
-	if (!option)
-		return -EINVAL;
-	if (!data)
-		return -EINVAL;
-
 	ptr = option->port;
 	while (ptr && ptr->next)
 		ptr = ptr->next;
@@ -152,11 +131,6 @@ int pnp_register_mem_resource(struct pnp_option *option, struct pnp_mem *data)
 {
 	struct pnp_mem *ptr;
 
-	if (!option)
-		return -EINVAL;
-	if (!data)
-		return -EINVAL;
-
 	ptr = option->mem;
 	while (ptr && ptr->next)
 		ptr = ptr->next;
-- 
1.5.3.rc6.17.g1911

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 24/25] make drivers/acpi/scan.c:create_modalias() static
       [not found]   ` <29bb7fd39d8976d9d510a9ab79f8942fdcd2b2ea.1187939443.git.len.brown@intel.com>
@ 2007-08-24  7:21     ` Len Brown
  0 siblings, 0 replies; 28+ messages in thread
From: Len Brown @ 2007-08-24  7:21 UTC (permalink / raw)
  To: linux-acpi; +Cc: Adrian Bunk, Len Brown

From: Adrian Bunk <bunk@kernel.org>

This patch makes the needlessly global create_modalias() static.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/scan.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index be74347..64620d6 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -35,8 +35,9 @@ struct acpi_device_bus_id{
  * e.g. on a device with hid:IBM0001 and cid:ACPI0001 you get:
  * char *modalias: "acpi:IBM0001:ACPI0001"
 */
-int create_modalias(struct acpi_device *acpi_dev, char *modalias, int size){
-
+static int create_modalias(struct acpi_device *acpi_dev, char *modalias,
+			   int size)
+{
 	int len;
 
 	if (!acpi_dev->flags.hardware_id)
-- 
1.5.3.rc6.17.g1911

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 25/25] ACPI: fix ia64 allnoconfig build
       [not found]   ` <3e069ee0c30d6f28b79e409ef2df1ffa427897ae.1187939443.git.len.brown@intel.com>
@ 2007-08-24  7:21     ` Len Brown
  0 siblings, 0 replies; 28+ messages in thread
From: Len Brown @ 2007-08-24  7:21 UTC (permalink / raw)
  To: linux-acpi; +Cc: Len Brown

drivers/acpi/event.c:238: error: conflicting types for ‘acpi_bus_generate_netlink_event’
include/acpi/acpi_bus.h:324: error: previous declaration of ‘acpi_bus_generate_netlink_event’ was here

Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/event.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/event.c b/drivers/acpi/event.c
index cf6d516..a2b9304 100644
--- a/drivers/acpi/event.c
+++ b/drivers/acpi/event.c
@@ -233,8 +233,9 @@ static int acpi_event_genetlink_init(void)
 }
 
 #else
-int acpi_bus_generate_netlink_event(struct acpi_device *device, u8 type,
-				      int data)
+int acpi_bus_generate_netlink_event(const char *device_class,
+				      const char *bus_id,
+				      u8 type, int data)
 {
 	return 0;
 }
-- 
1.5.3.rc6.17.g1911
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* Re: ACPI patches for Linux-2.6.23-rc3
  2007-08-24  7:20 ACPI patches for Linux-2.6.23-rc3 Len Brown
       [not found] ` <3c1d36da1d5ed36979340efd233ddaacc45b0a02.1187939442.git.len.brown@intel.com>
@ 2007-08-24  8:07 ` Zhang Rui
  2007-08-24 23:37   ` Len Brown
  1 sibling, 1 reply; 28+ messages in thread
From: Zhang Rui @ 2007-08-24  8:07 UTC (permalink / raw)
  To: Len Brown; +Cc: linux-acpi

On Fri, 2007-08-24 at 03:20 -0400, Len Brown wrote:
> please speak up if you see any problem with these patches.
> Also, please let me know if I've missed something you
> think needs to make 2.6.23.
> 
What about the latest patch in bug 8798?
It can fix the duplicate name problem without changing the
procfs generic code.

Thanks,
Rui

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: ACPI patches for Linux-2.6.23-rc3
  2007-08-24  8:07 ` ACPI patches for Linux-2.6.23-rc3 Zhang Rui
@ 2007-08-24 23:37   ` Len Brown
  2007-08-25  5:26     ` Zhang Rui
  0 siblings, 1 reply; 28+ messages in thread
From: Len Brown @ 2007-08-24 23:37 UTC (permalink / raw)
  To: Zhang Rui; +Cc: linux-acpi

On Friday 24 August 2007 04:07, Zhang Rui wrote:
> On Fri, 2007-08-24 at 03:20 -0400, Len Brown wrote:
> > please speak up if you see any problem with these patches.
> > Also, please let me know if I've missed something you
> > think needs to make 2.6.23.
> > 
> What about the latest patch in bug 8798?
> It can fix the duplicate name problem without changing the
> procfs generic code.

Do we need to null-terminate bus_id?

-Len
----------
Subject: hack duplicate name "VID" problem on T61
From: Zhang Rui <rui.zhang@intel.com>

This can only fix the problem that more than one video bus device
have the same AML name "VID".
ie. the proc I/F for the second "VID" video bus device is located under
/proc/acpi/video/VID1/...

As this is really rare and the ACPI proc I/F is a legacy feature that
we are planning to remove.
We won't provide a generic solution for this problem.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
---
 drivers/acpi/video.c |    8 ++++++++
 1 file changed, 8 insertions(+)

Index: linux-2.6.23-rc3/drivers/acpi/video.c
===================================================================
--- linux-2.6.23-rc3.orig/drivers/acpi/video.c
+++ linux-2.6.23-rc3/drivers/acpi/video.c
@@ -1833,6 +1833,7 @@ static void acpi_video_device_notify(acp
 	return;
 }
 
+static int instance;
 static int acpi_video_bus_add(struct acpi_device *device)
 {
 	int result = 0;
@@ -1847,6 +1848,13 @@ static int acpi_video_bus_add(struct acp
 	if (!video)
 		return -ENOMEM;
 
+	/* a hack to fix the duplicate name "VID" problem on T61 */
+	if (!strcmp(device->pnp.bus_id, "VID")) {
+		if (instance)
+			device->pnp.bus_id[3] = '0' + instance;
+		instance ++;
+	}
+
 	video->device = device;
 	strcpy(acpi_device_name(device), ACPI_VIDEO_BUS_NAME);
 	strcpy(acpi_device_class(device), ACPI_VIDEO_CLASS);

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: ACPI patches for Linux-2.6.23-rc3
  2007-08-24 23:37   ` Len Brown
@ 2007-08-25  5:26     ` Zhang Rui
  0 siblings, 0 replies; 28+ messages in thread
From: Zhang Rui @ 2007-08-25  5:26 UTC (permalink / raw)
  To: Len Brown; +Cc: linux-acpi

On Sat, 2007-08-25 at 07:37 +0800, Len Brown wrote:
> On Friday 24 August 2007 04:07, Zhang Rui wrote:
> > On Fri, 2007-08-24 at 03:20 -0400, Len Brown wrote:
> > > please speak up if you see any problem with these patches.
> > > Also, please let me know if I've missed something you
> > > think needs to make 2.6.23.
> > >
> > What about the latest patch in bug 8798?
> > It can fix the duplicate name problem without changing the
> > procfs generic code.
> 
> Do we need to null-terminate bus_id?
> 
device->pnp.bus_id[4] = 0 all the time.

Thanks,
Rui
> -Len
> ----------
> Subject: hack duplicate name "VID" problem on T61
> From: Zhang Rui <rui.zhang@intel.com>
> 
> This can only fix the problem that more than one video bus device
> have the same AML name "VID".
> ie. the proc I/F for the second "VID" video bus device is located
> under
> /proc/acpi/video/VID1/...
> 
> As this is really rare and the ACPI proc I/F is a legacy feature that
> we are planning to remove.
> We won't provide a generic solution for this problem.
> 
> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
> ---
>  drivers/acpi/video.c |    8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> Index: linux-2.6.23-rc3/drivers/acpi/video.c
> ===================================================================
> --- linux-2.6.23-rc3.orig/drivers/acpi/video.c
> +++ linux-2.6.23-rc3/drivers/acpi/video.c
> @@ -1833,6 +1833,7 @@ static void acpi_video_device_notify(acp
>         return;
>  }
> 
> +static int instance;
>  static int acpi_video_bus_add(struct acpi_device *device)
>  {
>         int result = 0;
> @@ -1847,6 +1848,13 @@ static int acpi_video_bus_add(struct acp
>         if (!video)
>                 return -ENOMEM;
> 
> +       /* a hack to fix the duplicate name "VID" problem on T61 */
> +       if (!strcmp(device->pnp.bus_id, "VID")) {
> +               if (instance)
> +                       device->pnp.bus_id[3] = '0' + instance;
> +               instance ++;
> +       }
> +
>         video->device = device;
>         strcpy(acpi_device_name(device), ACPI_VIDEO_BUS_NAME);
>         strcpy(acpi_device_class(device), ACPI_VIDEO_CLASS);
> 
> 

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2007-08-25  5:22 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-24  7:20 ACPI patches for Linux-2.6.23-rc3 Len Brown
     [not found] ` <3c1d36da1d5ed36979340efd233ddaacc45b0a02.1187939442.git.len.brown@intel.com>
2007-08-24  7:20   ` [PATCH 01/25] ACPI: thermal: clean up MODULE_PARM_DESC newlines Len Brown
     [not found]   ` <c52a7419af18594426bc601d1ea346dbbcf71e28.1187939442.git.len.brown@intel.com>
2007-08-24  7:20     ` [PATCH 02/25] ACPI: thermal: create "thermal.crt=C" bootparam Len Brown
     [not found]   ` <5b31d895874f56174e4d885c065c9fc4b24b28bb.1187939442.git.len.brown@intel.com>
2007-08-24  7:20     ` [PATCH 03/25] Revert "ACPI: Battery: Synchronize battery operations." Len Brown
     [not found]   ` <8c99fdce30787b0d1fc00b907d4cd55a714e4cdd.1187939442.git.len.brown@intel.com>
2007-08-24  7:20     ` [PATCH 04/25] ACPI: thermal: set "thermal.nocrt" via DMI on Gigabyte GA-7ZX Len Brown
     [not found]   ` <61ec7567db103d537329b0db9a887db570431ff4.1187939442.git.len.brown@intel.com>
2007-08-24  7:20     ` [PATCH 05/25] ACPI: boot correctly with "nosmp" or "maxcpus=0" Len Brown
     [not found]   ` <a9a4d1771cbb3c97f247534358ed24b1abf0aacb.1187939442.git.len.brown@intel.com>
2007-08-24  7:20     ` [PATCH 06/25] Subject: "ACPI handle has no context!" should be KERN_DEBUG Len Brown
     [not found]   ` <14e04fb34ffa82ee61ae69f98d8fca12d2e8e31c.1187939442.git.len.brown@intel.com>
2007-08-24  7:20     ` [PATCH 08/25] ACPI: Schedule /proc/acpi/event for removal Len Brown
     [not found]   ` <f63211caacf6822049f02015faf1b78ba7a7984f.1187939442.git.len.brown@intel.com>
2007-08-24  7:20     ` [PATCH 09/25] ACPI: Fix a warning of discarding qualifiers from pointer target type Len Brown
     [not found]   ` <a7ecd1ea913346a72f41a002c365882dc05c9bd5.1187939442.git.len.brown@intel.com>
2007-08-24  7:20     ` [PATCH 10/25] ACPI: video: Add keycode for ACPI video driver hotkey events Len Brown
     [not found]   ` <a1eb96a2f635cdb8f626f4074dae2ba5a6fce1e8.1187939442.git.len.brown@intel.com>
2007-08-24  7:20     ` [PATCH 11/25] ACPI video hotkey: remove invalid events handler for video output devices Len Brown
     [not found]   ` <745ce81328d09b1a5ebddacd1fffc20905d1cce3.1187939442.git.len.brown@intel.com>
2007-08-24  7:20     ` [PATCH 12/25] ACPI video hotkey: export ACPI video hotkey events via input layer Len Brown
     [not found]   ` <f9319f903f898dd4b15dbc386499725ce6c59776.1187939442.git.len.brown@intel.com>
2007-08-24  7:21     ` [PATCH 13/25] ACPI: EC: revert fix for bugzilla 8709 Len Brown
     [not found]   ` <f46d1604ed84e5a4107bae1db7283e3a76d72ace.1187939442.git.len.brown@intel.com>
2007-08-24  7:21     ` [PATCH 14/25] sony-laptop: enable Vaio FZ events Len Brown
     [not found]   ` <015a916fbbf105bb15f4bbfd80c3b9b2f2e0d7db.1187939442.git.len.brown@intel.com>
2007-08-24  7:21     ` [PATCH 15/25] sony-laptop: call sonypi_compat_init earlier Len Brown
     [not found]   ` <e1996a69e162b1c99c3d3802684d1c388b54f47d.1187939442.git.len.brown@intel.com>
2007-08-24  7:21     ` [PATCH 16/25] asus-laptop: Fix rmmod of asus_laptop Len Brown
     [not found]   ` <79d2dfaa4e787f94b7f65f4611bc7d1c8d85fabc.1187939442.git.len.brown@intel.com>
2007-08-24  7:21     ` [PATCH 17/25] ACPI: enable GPEs before calling _WAK on resume Len Brown
     [not found]   ` <1e0aa9ad721349781b728ec4226876247e3fd431.1187939442.git.len.brown@intel.com>
2007-08-24  7:21     ` [PATCH 18/25] PNP: fix up after Lindent Len Brown
     [not found]   ` <4cec086b219224167c22dd020d3dd2d9220e1d98.1187939443.git.len.brown@intel.com>
2007-08-24  7:21     ` [PATCH 19/25] PNPACPI: simplify irq_flags() Len Brown
     [not found]   ` <4721a4cc8864f0eb92958c3e0479e7994e8b0072.1187939443.git.len.brown@intel.com>
2007-08-24  7:21     ` [PATCH 20/25] PNPACPI: remove unnecessary casts of "void *" Len Brown
     [not found]   ` <6c504d30a48157b7c05a0dfb6a799c72095e957d.1187939443.git.len.brown@intel.com>
2007-08-24  7:21     ` [PATCH 21/25] ISAPNP: removed unused isapnp_detected and ISAPNP_DEBUG Len Brown
     [not found]   ` <4f0217e30249ac0eb13b65ef64f2aee627465da2.1187939443.git.len.brown@intel.com>
2007-08-24  7:21     ` [PATCH 22/25] PNP: remove MODULE infrastructure Len Brown
     [not found]   ` <b173491339b9ae7f1322241ce6228c1268513a39.1187939443.git.len.brown@intel.com>
2007-08-24  7:21     ` [PATCH 23/25] PNP: remove null pointer checks Len Brown
     [not found]   ` <29bb7fd39d8976d9d510a9ab79f8942fdcd2b2ea.1187939443.git.len.brown@intel.com>
2007-08-24  7:21     ` [PATCH 24/25] make drivers/acpi/scan.c:create_modalias() static Len Brown
     [not found]   ` <3e069ee0c30d6f28b79e409ef2df1ffa427897ae.1187939443.git.len.brown@intel.com>
2007-08-24  7:21     ` [PATCH 25/25] ACPI: fix ia64 allnoconfig build Len Brown
2007-08-24  8:07 ` ACPI patches for Linux-2.6.23-rc3 Zhang Rui
2007-08-24 23:37   ` Len Brown
2007-08-25  5:26     ` Zhang Rui

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).