Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83489
b: refs/heads/master
c: 3c72426
h: refs/heads/master
i:
  83487: 6c5945e
v: v3
  • Loading branch information
David Brownell authored and Linus Torvalds committed Feb 6, 2008
1 parent ffbf8a7 commit d6ff1e9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5ceadd2a2a9cf2768a9baf808abf1ffeedcc4cc4
refs/heads/master: 3c72426f0539c1abce17918d1456f7a6a5a11f90
34 changes: 14 additions & 20 deletions trunk/drivers/spi/spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,39 +76,33 @@ static int spi_uevent(struct device *dev, struct kobj_uevent_env *env)

#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;
}

Expand Down

0 comments on commit d6ff1e9

Please sign in to comment.