main.c (4a7126a25b4dfd07d61c699f724118275acc0c25) | main.c (9ed9895370aedd6032af2a9181c62c394d08223b) |
---|---|
1/* 2 * drivers/base/power/main.c - Where the driver meets power management. 3 * 4 * Copyright (c) 2003 Patrick Mochel 5 * Copyright (c) 2003 Open Source Development Lab 6 * 7 * This file is released under the GPLv2 8 * --- 117 unchanged lines hidden (view full) --- 126 pr_debug("PM: Adding info for %s:%s\n", 127 dev->bus ? dev->bus->name : "No Bus", dev_name(dev)); 128 device_pm_check_callbacks(dev); 129 mutex_lock(&dpm_list_mtx); 130 if (dev->parent && dev->parent->power.is_prepared) 131 dev_warn(dev, "parent %s should not be sleeping\n", 132 dev_name(dev->parent)); 133 list_add_tail(&dev->power.entry, &dpm_list); | 1/* 2 * drivers/base/power/main.c - Where the driver meets power management. 3 * 4 * Copyright (c) 2003 Patrick Mochel 5 * Copyright (c) 2003 Open Source Development Lab 6 * 7 * This file is released under the GPLv2 8 * --- 117 unchanged lines hidden (view full) --- 126 pr_debug("PM: Adding info for %s:%s\n", 127 dev->bus ? dev->bus->name : "No Bus", dev_name(dev)); 128 device_pm_check_callbacks(dev); 129 mutex_lock(&dpm_list_mtx); 130 if (dev->parent && dev->parent->power.is_prepared) 131 dev_warn(dev, "parent %s should not be sleeping\n", 132 dev_name(dev->parent)); 133 list_add_tail(&dev->power.entry, &dpm_list); |
134 dev->power.in_dpm_list = true; |
|
134 mutex_unlock(&dpm_list_mtx); 135} 136 137/** 138 * device_pm_remove - Remove a device from the PM core's list of active devices. 139 * @dev: Device to be removed from the list. 140 */ 141void device_pm_remove(struct device *dev) 142{ 143 pr_debug("PM: Removing info for %s:%s\n", 144 dev->bus ? dev->bus->name : "No Bus", dev_name(dev)); 145 complete_all(&dev->power.completion); 146 mutex_lock(&dpm_list_mtx); 147 list_del_init(&dev->power.entry); | 135 mutex_unlock(&dpm_list_mtx); 136} 137 138/** 139 * device_pm_remove - Remove a device from the PM core's list of active devices. 140 * @dev: Device to be removed from the list. 141 */ 142void device_pm_remove(struct device *dev) 143{ 144 pr_debug("PM: Removing info for %s:%s\n", 145 dev->bus ? dev->bus->name : "No Bus", dev_name(dev)); 146 complete_all(&dev->power.completion); 147 mutex_lock(&dpm_list_mtx); 148 list_del_init(&dev->power.entry); |
149 dev->power.in_dpm_list = false; |
|
148 mutex_unlock(&dpm_list_mtx); 149 device_wakeup_disable(dev); 150 pm_runtime_remove(dev); 151 device_pm_check_callbacks(dev); 152} 153 154/** 155 * device_pm_move_before - Move device in the PM core's list of active devices. --- 1611 unchanged lines hidden --- | 150 mutex_unlock(&dpm_list_mtx); 151 device_wakeup_disable(dev); 152 pm_runtime_remove(dev); 153 device_pm_check_callbacks(dev); 154} 155 156/** 157 * device_pm_move_before - Move device in the PM core's list of active devices. --- 1611 unchanged lines hidden --- |