From: Len Brown <len.brown@intel.com>
To: linux-acpi@vger.kernel.org
Cc: Henrique de Moraes Holschuh <hmh@hmh.eng.br>,
Len Brown <len.brown@intel.com>
Subject: [PATCH 6/9] ACPI: ibm-acpi: allow module to load when acpi notifiers can't be set (v2)
Date: Tue, 20 Mar 2007 11:27:08 -0400 [thread overview]
Message-ID: <11744044363481-git-send-email-len.brown@intel.com> (raw)
Message-ID: <96e89afe6da630dc54cfbca33c2c6a7ab9b6c11b.1174404137.git.len.brown@intel.com> (raw)
In-Reply-To: <11744044351759-git-send-email-len.brown@intel.com>
In-Reply-To: <a1fdcc0d2714b6622e3fd5c00db1635213d6c41a.1174404136.git.len.brown@intel.com>
From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
This patch allows for ibm-acpi to coexist (with diminished functionality) with
other drivers like ACPI_BAY. ibm-acpi will simply disable the functions it is
not able to register ACPI notifiers for.
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Chris Wedgwood <cw@f00f.org>
Cc: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/ibm_acpi.c | 19 ++++++++++++++++---
1 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/drivers/acpi/ibm_acpi.c b/drivers/acpi/ibm_acpi.c
index 3690136..dc10966 100644
--- a/drivers/acpi/ibm_acpi.c
+++ b/drivers/acpi/ibm_acpi.c
@@ -2507,7 +2507,7 @@ static int __init setup_notify(struct ibm_struct *ibm)
ret = acpi_bus_get_device(*ibm->handle, &ibm->device);
if (ret < 0) {
printk(IBM_ERR "%s device not present\n", ibm->name);
- return 0;
+ return -ENODEV;
}
acpi_driver_data(ibm->device) = ibm;
@@ -2516,8 +2516,13 @@ static int __init setup_notify(struct ibm_struct *ibm)
status = acpi_install_notify_handler(*ibm->handle, ibm->type,
dispatch_notify, ibm);
if (ACPI_FAILURE(status)) {
- printk(IBM_ERR "acpi_install_notify_handler(%s) failed: %d\n",
- ibm->name, status);
+ if (status == AE_ALREADY_EXISTS) {
+ printk(IBM_NOTICE "another device driver is already handling %s events\n",
+ ibm->name);
+ } else {
+ printk(IBM_ERR "acpi_install_notify_handler(%s) failed: %d\n",
+ ibm->name, status);
+ }
return -ENODEV;
}
ibm->notify_installed = 1;
@@ -2553,6 +2558,8 @@ static int __init register_driver(struct ibm_struct *ibm)
return ret;
}
+static void ibm_exit(struct ibm_struct *ibm);
+
static int __init ibm_init(struct ibm_struct *ibm)
{
int ret;
@@ -2594,6 +2601,12 @@ static int __init ibm_init(struct ibm_struct *ibm)
if (ibm->notify) {
ret = setup_notify(ibm);
+ if (ret == -ENODEV) {
+ printk(IBM_NOTICE "disabling subdriver %s\n",
+ ibm->name);
+ ibm_exit(ibm);
+ return 0;
+ }
if (ret < 0)
return ret;
}
--
1.5.0.3.382.g34572
next prev parent reply other threads:[~2007-03-20 15:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-20 15:27 ACPI patches for release onto Linux-2.6.21-rc4 Len Brown
2007-03-20 15:27 ` [PATCH 1/9] ACPI: Add support to parse 2nd MADT Len Brown
2007-03-20 15:27 ` Len Brown
2007-03-20 15:27 ` [PATCH 2/9] ACPI: resolve HP nx6125 S3 immediate wakeup regression Len Brown
2007-03-20 15:27 ` Len Brown
2007-03-20 15:27 ` [PATCH 3/9] sony-laptop: MAINTAINERS fix entry, add L: and W: Len Brown
2007-03-20 15:27 ` Len Brown
2007-03-20 15:27 ` [PATCH 4/9] ACPICA: revert "acpi_serialize" changes Len Brown
2007-03-20 15:27 ` Len Brown
2007-03-20 15:27 ` [PATCH 5/9] ACPI: parse 2nd MADT by default Len Brown
2007-03-20 15:27 ` Len Brown
2007-03-20 15:27 ` Len Brown [this message]
2007-03-20 15:27 ` [PATCH 6/9] ACPI: ibm-acpi: allow module to load when acpi notifiers can't be set (v2) Len Brown
2007-03-20 15:27 ` [PATCH 7/9] ACPI: Only use IPI on known broken machines (AMD, Dothan/BaniasPentium M) Len Brown
2007-03-20 15:27 ` Len Brown
2007-03-20 15:27 ` [PATCH 8/9] ACPI: IA64: fix allnoconfig build Len Brown
2007-03-20 15:27 ` Len Brown
2007-03-20 15:27 ` [PATCH 9/9] ACPI: IA64: fix %ll build warnings Len Brown
2007-03-20 15:27 ` Len Brown
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=11744044363481-git-send-email-len.brown@intel.com \
--to=len.brown@intel.com \
--cc=hmh@hmh.eng.br \
--cc=linux-acpi@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.