Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 211315
b: refs/heads/master
c: 64b4782
h: refs/heads/master
i:
  211313: acf8e7e
  211311: 73729cf
v: v3
  • Loading branch information
Rajendra Nayak authored and Jean Delvare committed Sep 30, 2010
1 parent 8f2dc58 commit d0e28ff
Show file tree
Hide file tree
Showing 2 changed files with 25 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: 6abb930af064fb1cf4177d32e2c7bfb89eee0fe5
refs/heads/master: 64b4782fc9e4bdc59ae90897e2258e4ec938690e
44 changes: 24 additions & 20 deletions trunk/drivers/i2c/i2c-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,12 @@ static int i2c_device_pm_suspend(struct device *dev)
{
const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;

if (pm_runtime_suspended(dev))
return 0;

if (pm)
return pm->suspend ? pm->suspend(dev) : 0;
if (pm) {
if (pm_runtime_suspended(dev))
return 0;
else
return pm->suspend ? pm->suspend(dev) : 0;
}

return i2c_legacy_suspend(dev, PMSG_SUSPEND);
}
Expand All @@ -223,11 +224,12 @@ static int i2c_device_pm_freeze(struct device *dev)
{
const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;

if (pm_runtime_suspended(dev))
return 0;

if (pm)
return pm->freeze ? pm->freeze(dev) : 0;
if (pm) {
if (pm_runtime_suspended(dev))
return 0;
else
return pm->freeze ? pm->freeze(dev) : 0;
}

return i2c_legacy_suspend(dev, PMSG_FREEZE);
}
Expand All @@ -236,11 +238,12 @@ static int i2c_device_pm_thaw(struct device *dev)
{
const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;

if (pm_runtime_suspended(dev))
return 0;

if (pm)
return pm->thaw ? pm->thaw(dev) : 0;
if (pm) {
if (pm_runtime_suspended(dev))
return 0;
else
return pm->thaw ? pm->thaw(dev) : 0;
}

return i2c_legacy_resume(dev);
}
Expand All @@ -249,11 +252,12 @@ static int i2c_device_pm_poweroff(struct device *dev)
{
const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;

if (pm_runtime_suspended(dev))
return 0;

if (pm)
return pm->poweroff ? pm->poweroff(dev) : 0;
if (pm) {
if (pm_runtime_suspended(dev))
return 0;
else
return pm->poweroff ? pm->poweroff(dev) : 0;
}

return i2c_legacy_suspend(dev, PMSG_HIBERNATE);
}
Expand Down

0 comments on commit d0e28ff

Please sign in to comment.