public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bjorn.helgaas@hp.com>
To: Thomas Renninger <trenn@suse.de>
Cc: Len Brown <lenb@kernel.org>,
	linux-acpi@vger.kernel.org, "Rafael J. Wysocki" <rjw@sisk.pl>
Subject: Re: [PATCH 0/6] ACPI: button: minor cleanups
Date: Fri, 8 May 2009 14:53:01 -0600	[thread overview]
Message-ID: <200905081453.02556.bjorn.helgaas@hp.com> (raw)
In-Reply-To: <200905061120.52793.bjorn.helgaas@hp.com>

On Wednesday 06 May 2009 11:20:52 am Bjorn Helgaas wrote:
> On Wednesday 06 May 2009 09:13:07 am Thomas Renninger wrote:
> > Below is the outcome of the patch which fixes a fixed feature button
> > s2ram issue.
> > 
> > This does not work anymore since Bjoern's patches.
> > Comparing the with the HID of the acpi device looks ugly.
> > 
> > Shall I revive the fixed feature vs GPE button types?
> > ACPI_BUTTON_TYPE_POWERF and ACPI_BUTTON_TYPE_SLEEPF?
> 
> I don't understand exactly how I broke this.

What tree are you testing?  In Linus's upstream tree, 373cfc360e
adds the .notify method, and at the same time, it removes
acpi_button_notify_fixed().

Your patch below, which fixes the problem, shows that you already
have the .notify method, and yet you apparently *also* have the
acpi_button_notify_fixed() function.  That makes me suspect that
you're using a tree with a merge error.

Bjorn

> > @@ -85,6 +86,7 @@ static struct acpi_driver acpi_button_driver = {
> >  	.ops = {
> >  		.add = acpi_button_add,
> >  		.resume = acpi_button_resume,
> > +		.suspend = acpi_button_suspend,
> >  		.remove = acpi_button_remove,
> >  		.notify = acpi_button_notify,
> >  	},
> > @@ -281,8 +283,41 @@ static int acpi_button_resume(struct acpi_device *device)
> >  {
> >  	struct acpi_button *button = acpi_driver_data(device);
> >  
> > -	if (button->type == ACPI_BUTTON_TYPE_LID)
> > +	if (!button)
> > +		return -EINVAL;
> > +	switch (button->type) {
> > +	case ACPI_BUTTON_TYPE_LID:
> >  		return acpi_lid_send_state(device);
> > +	case ACPI_BUTTON_TYPE_SLEEPF:
> > +		return acpi_install_fixed_event_handler(
> > +					ACPI_EVENT_SLEEP_BUTTON,
> > +					acpi_button_notify_fixed, button);
> > +
> > +	case ACPI_BUTTON_TYPE_POWERF:
> > +		return acpi_install_fixed_event_handler(
> > +					ACPI_EVENT_POWER_BUTTON,
> > +					acpi_button_notify_fixed, button);
> > +	}
> > +	return 0;
> > +}
> > +
> > +static int acpi_button_suspend(struct acpi_device *device, pm_message_t state)
> > +{
> > +	struct acpi_button *button;
> > +	if (!device)
> > +		return -EINVAL;
> > +	button = acpi_driver_data(device);
> > +	if (!button)
> > +		return -EINVAL;
> > +	switch (button->type) {
> > +	case ACPI_BUTTON_TYPE_SLEEPF:
> > +		return acpi_remove_fixed_event_handler(ACPI_EVENT_SLEEP_BUTTON,
> > +					       acpi_button_notify_fixed);
> > +
> > +	case ACPI_BUTTON_TYPE_POWERF:
> > +		return acpi_remove_fixed_event_handler(ACPI_EVENT_POWER_BUTTON,
> > +					       acpi_button_notify_fixed);
> > +	}
> >  	return 0;
> >  }
> >  
> > 
> 
> 
> 



  parent reply	other threads:[~2009-05-08 20:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-08 15:39 [PATCH 0/6] ACPI: button: minor cleanups Bjorn Helgaas
2009-04-08 15:39 ` [PATCH 1/6] ACPI: button: whitespace changes Bjorn Helgaas
2009-04-08 15:39 ` [PATCH 2/6] ACPI: button: remove unnecessary null pointer checks Bjorn Helgaas
2009-04-08 15:39 ` [PATCH 3/6] ACPI: button: use Linux style for getting driver_data Bjorn Helgaas
2009-04-08 15:39 ` [PATCH 4/6] ACPI: button: cache hid/name/class pointers Bjorn Helgaas
2009-04-08 15:39 ` [PATCH 5/6] ACPI: button: remove button->device pointer Bjorn Helgaas
2009-04-08 15:40 ` [PATCH 6/6] ACPI: button: remove control method/fixed hardware distinctions Bjorn Helgaas
2009-04-18  4:19 ` [PATCH 0/6] ACPI: button: minor cleanups Len Brown
     [not found] ` <200904171339.15895.bjorn.helgaas@hp.com>
     [not found]   ` <200905061713.08057.trenn@suse.de>
2009-05-06 17:20     ` Bjorn Helgaas
2009-05-08 17:21       ` Bjorn Helgaas
2009-05-08 20:53       ` Bjorn Helgaas [this message]
2009-05-11  6:56         ` Thomas Renninger
2009-05-11 22:13           ` Bjorn Helgaas

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=200905081453.02556.bjorn.helgaas@hp.com \
    --to=bjorn.helgaas@hp.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=rjw@sisk.pl \
    --cc=trenn@suse.de \
    /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