Commit 68313be4 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

Merge back earlier system-wide PM changes for 6.10.

parents 3c89a068 5b9eda2b
...@@ -208,7 +208,7 @@ static ktime_t initcall_debug_start(struct device *dev, void *cb) ...@@ -208,7 +208,7 @@ static ktime_t initcall_debug_start(struct device *dev, void *cb)
if (!pm_print_times_enabled) if (!pm_print_times_enabled)
return 0; return 0;
dev_info(dev, "calling %pS @ %i, parent: %s\n", cb, dev_info(dev, "calling %ps @ %i, parent: %s\n", cb,
task_pid_nr(current), task_pid_nr(current),
dev->parent ? dev_name(dev->parent) : "none"); dev->parent ? dev_name(dev->parent) : "none");
return ktime_get(); return ktime_get();
...@@ -223,7 +223,7 @@ static void initcall_debug_report(struct device *dev, ktime_t calltime, ...@@ -223,7 +223,7 @@ static void initcall_debug_report(struct device *dev, ktime_t calltime,
return; return;
rettime = ktime_get(); rettime = ktime_get();
dev_info(dev, "%pS returned %d after %Ld usecs\n", cb, error, dev_info(dev, "%ps returned %d after %Ld usecs\n", cb, error,
(unsigned long long)ktime_us_delta(rettime, calltime)); (unsigned long long)ktime_us_delta(rettime, calltime));
} }
...@@ -1927,7 +1927,7 @@ EXPORT_SYMBOL_GPL(dpm_suspend_start); ...@@ -1927,7 +1927,7 @@ EXPORT_SYMBOL_GPL(dpm_suspend_start);
void __suspend_report_result(const char *function, struct device *dev, void *fn, int ret) void __suspend_report_result(const char *function, struct device *dev, void *fn, int ret)
{ {
if (ret) if (ret)
dev_err(dev, "%s(): %pS returns %d\n", function, fn, ret); dev_err(dev, "%s(): %ps returns %d\n", function, fn, ret);
} }
EXPORT_SYMBOL_GPL(__suspend_report_result); EXPORT_SYMBOL_GPL(__suspend_report_result);
......
...@@ -451,16 +451,15 @@ static struct wakeup_source *device_wakeup_detach(struct device *dev) ...@@ -451,16 +451,15 @@ static struct wakeup_source *device_wakeup_detach(struct device *dev)
* Detach the @dev's wakeup source object from it, unregister this wakeup source * Detach the @dev's wakeup source object from it, unregister this wakeup source
* object and destroy it. * object and destroy it.
*/ */
int device_wakeup_disable(struct device *dev) void device_wakeup_disable(struct device *dev)
{ {
struct wakeup_source *ws; struct wakeup_source *ws;
if (!dev || !dev->power.can_wakeup) if (!dev || !dev->power.can_wakeup)
return -EINVAL; return;
ws = device_wakeup_detach(dev); ws = device_wakeup_detach(dev);
wakeup_source_unregister(ws); wakeup_source_unregister(ws);
return 0;
} }
EXPORT_SYMBOL_GPL(device_wakeup_disable); EXPORT_SYMBOL_GPL(device_wakeup_disable);
...@@ -502,7 +501,11 @@ EXPORT_SYMBOL_GPL(device_set_wakeup_capable); ...@@ -502,7 +501,11 @@ EXPORT_SYMBOL_GPL(device_set_wakeup_capable);
*/ */
int device_set_wakeup_enable(struct device *dev, bool enable) int device_set_wakeup_enable(struct device *dev, bool enable)
{ {
return enable ? device_wakeup_enable(dev) : device_wakeup_disable(dev); if (enable)
return device_wakeup_enable(dev);
device_wakeup_disable(dev);
return 0;
} }
EXPORT_SYMBOL_GPL(device_set_wakeup_enable); EXPORT_SYMBOL_GPL(device_set_wakeup_enable);
......
...@@ -63,7 +63,7 @@ static int sdhci_pci_init_wakeup(struct sdhci_pci_chip *chip) ...@@ -63,7 +63,7 @@ static int sdhci_pci_init_wakeup(struct sdhci_pci_chip *chip)
if ((pm_flags & MMC_PM_KEEP_POWER) && (pm_flags & MMC_PM_WAKE_SDIO_IRQ)) if ((pm_flags & MMC_PM_KEEP_POWER) && (pm_flags & MMC_PM_WAKE_SDIO_IRQ))
return device_wakeup_enable(&chip->pdev->dev); return device_wakeup_enable(&chip->pdev->dev);
else if (!cap_cd_wake) else if (!cap_cd_wake)
return device_wakeup_disable(&chip->pdev->dev); device_wakeup_disable(&chip->pdev->dev);
return 0; return 0;
} }
......
...@@ -107,7 +107,7 @@ extern void wakeup_sources_read_unlock(int idx); ...@@ -107,7 +107,7 @@ extern void wakeup_sources_read_unlock(int idx);
extern struct wakeup_source *wakeup_sources_walk_start(void); extern struct wakeup_source *wakeup_sources_walk_start(void);
extern struct wakeup_source *wakeup_sources_walk_next(struct wakeup_source *ws); extern struct wakeup_source *wakeup_sources_walk_next(struct wakeup_source *ws);
extern int device_wakeup_enable(struct device *dev); extern int device_wakeup_enable(struct device *dev);
extern int device_wakeup_disable(struct device *dev); extern void device_wakeup_disable(struct device *dev);
extern void device_set_wakeup_capable(struct device *dev, bool capable); extern void device_set_wakeup_capable(struct device *dev, bool capable);
extern int device_set_wakeup_enable(struct device *dev, bool enable); extern int device_set_wakeup_enable(struct device *dev, bool enable);
extern void __pm_stay_awake(struct wakeup_source *ws); extern void __pm_stay_awake(struct wakeup_source *ws);
...@@ -154,10 +154,9 @@ static inline int device_wakeup_enable(struct device *dev) ...@@ -154,10 +154,9 @@ static inline int device_wakeup_enable(struct device *dev)
return 0; return 0;
} }
static inline int device_wakeup_disable(struct device *dev) static inline void device_wakeup_disable(struct device *dev)
{ {
dev->power.should_wakeup = false; dev->power.should_wakeup = false;
return 0;
} }
static inline int device_set_wakeup_enable(struct device *dev, bool enable) static inline int device_set_wakeup_enable(struct device *dev, bool enable)
...@@ -235,11 +234,10 @@ static inline int device_init_wakeup(struct device *dev, bool enable) ...@@ -235,11 +234,10 @@ static inline int device_init_wakeup(struct device *dev, bool enable)
if (enable) { if (enable) {
device_set_wakeup_capable(dev, true); device_set_wakeup_capable(dev, true);
return device_wakeup_enable(dev); return device_wakeup_enable(dev);
} else {
device_wakeup_disable(dev);
device_set_wakeup_capable(dev, false);
return 0;
} }
device_wakeup_disable(dev);
device_set_wakeup_capable(dev, false);
return 0;
} }
#endif /* _LINUX_PM_WAKEUP_H */ #endif /* _LINUX_PM_WAKEUP_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment