[PATCH] fix ACPI multible power entries

From: Anders Peter Fugmann (afu@fugmann.dhs.org)
Date: Fri Nov 09 2001 - 07:01:22 EST


Hi.

In trying to get ACPI to work on my system, i was stumbled to see two
button entries under /proc/acpi/button/.

Attached is a patch which corrects this behaviour.
The patch applies to 2.4.14.

Regards
Anders Fugmann


--- linux-2.4.14/drivers/acpi/ospm/button/bn_osl.c.orig Thu Nov 8 21:03:35 2001
+++ linux-2.4.14/drivers/acpi/ospm/button/bn_osl.c Fri Nov 9 12:52:57 2001
@@ -97,10 +97,13 @@
                         printk(KERN_WARNING "ACPI: Multiple power buttons detected, ignoring fixed-feature\n");
                 default:
                         printk(KERN_INFO "ACPI: Power Button (CM) found\n");
- bn_power_button = BN_TYPE_GENERIC;
- if (!proc_mkdir(BN_PROC_POWER_BUTTON, bn_proc_root)) {
- status = AE_ERROR;
+ /* Only create proc entry, if it has not been created before */
+ if (!bn_power_button) {
+ if (!proc_mkdir(BN_PROC_POWER_BUTTON, bn_proc_root)) {
+ status = AE_ERROR;
+ }
                         }
+ bn_power_button = BN_TYPE_GENERIC;
                         break;
                 }
                 break;
@@ -130,9 +133,13 @@
                 default:
                         bn_sleep_button = BN_TYPE_GENERIC;
                         printk(KERN_INFO "ACPI: Sleep Button (CM) found\n");
- if (!proc_mkdir(BN_PROC_SLEEP_BUTTON, bn_proc_root)) {
- status = AE_ERROR;
+ /* Only create proc entry, if it has not been created before */
+ if (!bn_sleep_button) {
+ if (!proc_mkdir(BN_PROC_SLEEP_BUTTON, bn_proc_root)) {
+ status = AE_ERROR;
+ }
                         }
+ bn_sleep_button = BN_TYPE_GENERIC;
                         break;
                 }
                 break;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Nov 15 2001 - 21:00:22 EST