linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Len Brown <lenb@kernel.org>
To: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org,
	Chris Wedgwood <cw@f00f.org>,
	ibm-acpi-devel@lists.sourceforge.net,
	kristen.c.accardi@intel.com
Subject: Re: [PATCH] ACPI: ibm-acpi: allow module to load when acpi notifiers can't be set (v2)
Date: Fri, 16 Mar 2007 01:24:18 -0400	[thread overview]
Message-ID: <200703160124.18942.lenb@kernel.org> (raw)
In-Reply-To: <20070315191506.GA14394@khazad-dum.debian.net>

Applied.


On Thursday 15 March 2007 15:15, Henrique de Moraes Holschuh wrote:
> 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>
> ---
> 
>  There was a minor problem in the first version of the patch, which I didn't
>  notice when backporting from acpi-test.  This is a fixed version.  Sorry
>  about this.
> 
>  Len, you can pull this patch from:
>  git://repo.or.cz/linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git
>  branch for-upstream/acpi-release
>  
>  Please send it to Linus for merge in 2.6.21.
>  
>  It will clash with the patches in acpi-test that are waiting for 2.6.22.
>  I will rediff those, and send you a pull request when this patch
>  gets accepted in mainline.

ok

thanks Henrique,
-Len


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

  reply	other threads:[~2007-03-16  6:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-15  7:10 [PATCH] ACPI_IBM_BAY can not coexist with ACPI_BAY Chris Wedgwood
2007-03-15 13:27 ` Henrique de Moraes Holschuh
2007-03-15 15:04 ` Henrique de Moraes Holschuh
2007-03-15 17:51 ` [PATCH] ACPI: ibm-acpi: allow module to load when acpi notifiers can't be set Henrique de Moraes Holschuh
     [not found]   ` <20070315175113.GA6596-ZGHd14iZgfaRjzvQDGKj+xxZW9W5cXbT@public.gmane.org>
2007-03-15 19:15     ` [PATCH] ACPI: ibm-acpi: allow module to load when acpi notifiers can't be set (v2) Henrique de Moraes Holschuh
2007-03-16  5:24       ` Len Brown [this message]
2007-03-15 19:26     ` [PATCH] ACPI: ibm-acpi: allow module to load when acpi notifiers can't be set Kristen Carlson Accardi
2007-03-15 19:48       ` [ibm-acpi-devel] " Henrique de Moraes Holschuh
2007-03-15 19:17   ` Chris Wedgwood
     [not found]     ` <20070315191721.GB2556-ADlBjwePHCC1xTEMbVT0AQFcV7zePqp5@public.gmane.org>
2007-03-15 19:37       ` Kristen Carlson Accardi
     [not found]         ` <20070315123732.2ac478a3.kristen.c.accardi-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2007-03-15 19:57           ` Henrique de Moraes Holschuh
2007-03-15 21:57         ` Holger Macht
2007-03-15 19:39     ` Henrique de Moraes Holschuh

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=200703160124.18942.lenb@kernel.org \
    --to=lenb@kernel.org \
    --cc=cw@f00f.org \
    --cc=hmh@hmh.eng.br \
    --cc=ibm-acpi-devel@lists.sourceforge.net \
    --cc=kristen.c.accardi@intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --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).