lkml.org 
[lkml]   [2001]   [Nov]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] fix ACPI multible power entries
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;
\
 
 \ /
  Last update: 2005-03-22 13:13    [W:0.055 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site