* [patch 2.6.24-rc4] spi core stops updating dev->power.power_state
@ 2007-12-04 19:59 David Brownell
[not found] ` <200712041159.43712.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: David Brownell @ 2007-12-04 19:59 UTC (permalink / raw)
To: Andrew Morton; +Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
Don't update dev->power.power_state any more in the SPI core. The
only reason to update this scheduled-to-be-removed field was to make
the already-removed /sys/devices/.../power/state files work better.
Signed-off-by: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
--- pstate.orig/drivers/spi/spi.c 2007-12-04 09:36:40.000000000 -0800
+++ pstate/drivers/spi/spi.c 2007-12-04 11:11:33.000000000 -0800
@@ -77,39 +77,33 @@ static int spi_uevent(struct device *dev
#ifdef CONFIG_PM
-/*
- * NOTE: the suspend() method for an spi_master controller driver
- * should verify that all its child devices are marked as suspended;
- * suspend requests delivered through sysfs power/state files don't
- * enforce such constraints.
- */
static int spi_suspend(struct device *dev, pm_message_t message)
{
- int value;
+ int value = 0;
struct spi_driver *drv = to_spi_driver(dev->driver);
- if (!drv || !drv->suspend)
- return 0;
-
/* suspend will stop irqs and dma; no more i/o */
- value = drv->suspend(to_spi_device(dev), message);
- if (value == 0)
- dev->power.power_state = message;
+ if (drv) {
+ if (drv->suspend)
+ value = drv->suspend(to_spi_device(dev), message);
+ else
+ dev_dbg(dev, "... can't suspend\n");
+ }
return value;
}
static int spi_resume(struct device *dev)
{
- int value;
+ int value = 0;
struct spi_driver *drv = to_spi_driver(dev->driver);
- if (!drv || !drv->resume)
- return 0;
-
/* resume may restart the i/o queue */
- value = drv->resume(to_spi_device(dev));
- if (value == 0)
- dev->power.power_state = PMSG_ON;
+ if (drv) {
+ if (drv->resume)
+ value = drv->resume(to_spi_device(dev));
+ else
+ dev_dbg(dev, "... can't resume\n");
+ }
return value;
}
-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch 2.6.24-rc4] spi core stops updating dev->power.power_state
[not found] ` <200712041159.43712.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
@ 2007-12-04 20:24 ` Andrew Morton
[not found] ` <20071204122401.d06d6699.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2007-12-04 20:24 UTC (permalink / raw)
To: David Brownell; +Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
On Tue, 4 Dec 2007 11:59:42 -0800
David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org> wrote:
> Subject: [patch 2.6.24-rc4] spi core stops updating dev->power.power_state
Methinks this should have been "spi core: stop updating
dev->power.power_state"?
>
> Don't update dev->power.power_state any more in the SPI core. The
> only reason to update this scheduled-to-be-removed field was to make
> the already-removed /sys/devices/.../power/state files work better.
>
For 2.6.25, yes?
-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch 2.6.24-rc4] spi core stops updating dev->power.power_state
[not found] ` <20071204122401.d06d6699.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
@ 2007-12-04 20:52 ` David Brownell
0 siblings, 0 replies; 3+ messages in thread
From: David Brownell @ 2007-12-04 20:52 UTC (permalink / raw)
To: Andrew Morton; +Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
On Tuesday 04 December 2007, Andrew Morton wrote:
> On Tue, 4 Dec 2007 11:59:42 -0800
> David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org> wrote:
>
> > Subject: [patch 2.6.24-rc4] spi core stops updating dev->power.power_state
>
> Methinks this should have been "spi core: stop updating
> dev->power.power_state"?
Either one seems correct to me ... The Chicago Manual of Style
doesn't seem to cover such issues. ;)
> > Don't update dev->power.power_state any more in the SPI core. The
> > only reason to update this scheduled-to-be-removed field was to make
> > the already-removed /sys/devices/.../power/state files work better.
> >
>
> For 2.6.25, yes?
Absolutely. Ditto for the other similar patches you're about to see.
- Dave
-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-12-04 20:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-04 19:59 [patch 2.6.24-rc4] spi core stops updating dev->power.power_state David Brownell
[not found] ` <200712041159.43712.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2007-12-04 20:24 ` Andrew Morton
[not found] ` <20071204122401.d06d6699.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2007-12-04 20:52 ` David Brownell
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).