Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 212365
b: refs/heads/master
c: 098dff7
h: refs/heads/master
i:
  212363: d782848
v: v3
  • Loading branch information
Rafael J. Wysocki committed Oct 16, 2010
1 parent 6c2f2ea commit 67c0640
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 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: 074037ec79bea73edf1b1ec72fef1010e83e3cc5
refs/heads/master: 098dff738abbeaea15fc95c4f4fdaee1e9bbea75
15 changes: 9 additions & 6 deletions trunk/drivers/base/power/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ static pm_message_t pm_transition;
*/
static bool transition_started;

static int async_error;

/**
* device_pm_init - Initialize the PM-related part of a device object.
* @dev: Device object being initialized.
Expand Down Expand Up @@ -602,6 +604,7 @@ static void dpm_resume(pm_message_t state)
INIT_LIST_HEAD(&list);
mutex_lock(&dpm_list_mtx);
pm_transition = state;
async_error = 0;

list_for_each_entry(dev, &dpm_list, power.entry) {
if (dev->power.status < DPM_OFF)
Expand Down Expand Up @@ -831,8 +834,6 @@ static int legacy_suspend(struct device *dev, pm_message_t state,
return error;
}

static int async_error;

/**
* device_suspend - Execute "suspend" callbacks for given device.
* @dev: Device to handle.
Expand Down Expand Up @@ -887,6 +888,9 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async)
device_unlock(dev);
complete_all(&dev->power.completion);

if (error)
async_error = error;

return error;
}

Expand All @@ -896,10 +900,8 @@ static void async_suspend(void *data, async_cookie_t cookie)
int error;

error = __device_suspend(dev, pm_transition, true);
if (error) {
if (error)
pm_dev_err(dev, pm_transition, " async", error);
async_error = error;
}

put_device(dev);
}
Expand Down Expand Up @@ -1087,8 +1089,9 @@ EXPORT_SYMBOL_GPL(__suspend_report_result);
* @dev: Device to wait for.
* @subordinate: Device that needs to wait for @dev.
*/
void device_pm_wait_for_dev(struct device *subordinate, struct device *dev)
int device_pm_wait_for_dev(struct device *subordinate, struct device *dev)
{
dpm_wait(dev, subordinate->power.async_suspend);
return async_error;
}
EXPORT_SYMBOL_GPL(device_pm_wait_for_dev);
7 changes: 5 additions & 2 deletions trunk/include/linux/pm.h
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ extern void __suspend_report_result(const char *function, void *fn, int ret);
__suspend_report_result(__func__, fn, ret); \
} while (0)

extern void device_pm_wait_for_dev(struct device *sub, struct device *dev);
extern int device_pm_wait_for_dev(struct device *sub, struct device *dev);
#else /* !CONFIG_PM_SLEEP */

#define device_pm_lock() do {} while (0)
Expand All @@ -572,7 +572,10 @@ static inline int dpm_suspend_start(pm_message_t state)

#define suspend_report_result(fn, ret) do {} while (0)

static inline void device_pm_wait_for_dev(struct device *a, struct device *b) {}
static inline int device_pm_wait_for_dev(struct device *a, struct device *b)
{
return 0;
}
#endif /* !CONFIG_PM_SLEEP */

/* How to reorder dpm_list after device_move() */
Expand Down

0 comments on commit 67c0640

Please sign in to comment.