linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anders Peter Fugmann <afu@fugmann.dhs.org>
To: andrew.grover@intel.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] fix ACPI multible power entries
Date: Fri, 09 Nov 2001 13:01:22 +0100	[thread overview]
Message-ID: <3BEBC592.1030506@fugmann.dhs.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 224 bytes --]

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



[-- Attachment #2: acpi.diff --]
[-- Type: text/plain, Size: 1223 bytes --]

--- 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;

             reply	other threads:[~2001-11-09 12:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-09 12:01 Anders Peter Fugmann [this message]
2001-11-09 19:10 [PATCH] fix ACPI multible power entries Grover, Andrew
2001-11-09 19:17 ` Matthew Dharm
2001-11-10 10:20 ` Anders Peter Fugmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3BEBC592.1030506@fugmann.dhs.org \
    --to=afu@fugmann.dhs.org \
    --cc=andrew.grover@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).