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. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Родитель
5ceadd2a2a
Коммит
3c72426f05
|
@ -76,39 +76,33 @@ static int spi_uevent(struct device *dev, struct kobj_uevent_env *env)
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
#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)
|
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);
|
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 */
|
/* suspend will stop irqs and dma; no more i/o */
|
||||||
value = drv->suspend(to_spi_device(dev), message);
|
if (drv) {
|
||||||
if (value == 0)
|
if (drv->suspend)
|
||||||
dev->power.power_state = message;
|
value = drv->suspend(to_spi_device(dev), message);
|
||||||
|
else
|
||||||
|
dev_dbg(dev, "... can't suspend\n");
|
||||||
|
}
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int spi_resume(struct device *dev)
|
static int spi_resume(struct device *dev)
|
||||||
{
|
{
|
||||||
int value;
|
int value = 0;
|
||||||
struct spi_driver *drv = to_spi_driver(dev->driver);
|
struct spi_driver *drv = to_spi_driver(dev->driver);
|
||||||
|
|
||||||
if (!drv || !drv->resume)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
/* resume may restart the i/o queue */
|
/* resume may restart the i/o queue */
|
||||||
value = drv->resume(to_spi_device(dev));
|
if (drv) {
|
||||||
if (value == 0)
|
if (drv->resume)
|
||||||
dev->power.power_state = PMSG_ON;
|
value = drv->resume(to_spi_device(dev));
|
||||||
|
else
|
||||||
|
dev_dbg(dev, "... can't resume\n");
|
||||||
|
}
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче