提交 2421ad48 编写于 作者: R Rafael J. Wysocki

ACPI / PM: Drop two functions that are not used any more

Two functions defined in device_pm.c, acpi_dev_pm_add_dependent()
and acpi_dev_pm_remove_dependent(), have no callers and may be
dropped, so drop them.

Moreover, they are the only functions adding entries to and removing
entries from the power_dependent list in struct acpi_device, so drop
that list too.
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 b08fc109
...@@ -1025,60 +1025,4 @@ void acpi_dev_pm_detach(struct device *dev, bool power_off) ...@@ -1025,60 +1025,4 @@ void acpi_dev_pm_detach(struct device *dev, bool power_off)
} }
} }
EXPORT_SYMBOL_GPL(acpi_dev_pm_detach); EXPORT_SYMBOL_GPL(acpi_dev_pm_detach);
/**
* acpi_dev_pm_add_dependent - Add physical device depending for PM.
* @handle: Handle of ACPI device node.
* @depdev: Device depending on that node for PM.
*/
void acpi_dev_pm_add_dependent(acpi_handle handle, struct device *depdev)
{
struct acpi_device_physical_node *dep;
struct acpi_device *adev;
if (!depdev || acpi_bus_get_device(handle, &adev))
return;
mutex_lock(&adev->physical_node_lock);
list_for_each_entry(dep, &adev->power_dependent, node)
if (dep->dev == depdev)
goto out;
dep = kzalloc(sizeof(*dep), GFP_KERNEL);
if (dep) {
dep->dev = depdev;
list_add_tail(&dep->node, &adev->power_dependent);
}
out:
mutex_unlock(&adev->physical_node_lock);
}
EXPORT_SYMBOL_GPL(acpi_dev_pm_add_dependent);
/**
* acpi_dev_pm_remove_dependent - Remove physical device depending for PM.
* @handle: Handle of ACPI device node.
* @depdev: Device depending on that node for PM.
*/
void acpi_dev_pm_remove_dependent(acpi_handle handle, struct device *depdev)
{
struct acpi_device_physical_node *dep;
struct acpi_device *adev;
if (!depdev || acpi_bus_get_device(handle, &adev))
return;
mutex_lock(&adev->physical_node_lock);
list_for_each_entry(dep, &adev->power_dependent, node)
if (dep->dev == depdev) {
list_del(&dep->node);
kfree(dep);
break;
}
mutex_unlock(&adev->physical_node_lock);
}
EXPORT_SYMBOL_GPL(acpi_dev_pm_remove_dependent);
#endif /* CONFIG_PM */ #endif /* CONFIG_PM */
...@@ -999,7 +999,6 @@ int acpi_device_add(struct acpi_device *device, ...@@ -999,7 +999,6 @@ int acpi_device_add(struct acpi_device *device,
INIT_LIST_HEAD(&device->wakeup_list); INIT_LIST_HEAD(&device->wakeup_list);
INIT_LIST_HEAD(&device->physical_node_list); INIT_LIST_HEAD(&device->physical_node_list);
mutex_init(&device->physical_node_lock); mutex_init(&device->physical_node_lock);
INIT_LIST_HEAD(&device->power_dependent);
new_bus_id = kzalloc(sizeof(struct acpi_device_bus_id), GFP_KERNEL); new_bus_id = kzalloc(sizeof(struct acpi_device_bus_id), GFP_KERNEL);
if (!new_bus_id) { if (!new_bus_id) {
......
...@@ -311,7 +311,6 @@ struct acpi_device { ...@@ -311,7 +311,6 @@ struct acpi_device {
unsigned int physical_node_count; unsigned int physical_node_count;
struct list_head physical_node_list; struct list_head physical_node_list;
struct mutex physical_node_lock; struct mutex physical_node_lock;
struct list_head power_dependent;
void (*remove)(struct acpi_device *); void (*remove)(struct acpi_device *);
}; };
...@@ -456,8 +455,6 @@ acpi_status acpi_add_pm_notifier(struct acpi_device *adev, ...@@ -456,8 +455,6 @@ acpi_status acpi_add_pm_notifier(struct acpi_device *adev,
acpi_status acpi_remove_pm_notifier(struct acpi_device *adev, acpi_status acpi_remove_pm_notifier(struct acpi_device *adev,
acpi_notify_handler handler); acpi_notify_handler handler);
int acpi_pm_device_sleep_state(struct device *, int *, int); int acpi_pm_device_sleep_state(struct device *, int *, int);
void acpi_dev_pm_add_dependent(acpi_handle handle, struct device *depdev);
void acpi_dev_pm_remove_dependent(acpi_handle handle, struct device *depdev);
#else #else
static inline acpi_status acpi_add_pm_notifier(struct acpi_device *adev, static inline acpi_status acpi_add_pm_notifier(struct acpi_device *adev,
acpi_notify_handler handler, acpi_notify_handler handler,
...@@ -478,10 +475,6 @@ static inline int acpi_pm_device_sleep_state(struct device *d, int *p, int m) ...@@ -478,10 +475,6 @@ static inline int acpi_pm_device_sleep_state(struct device *d, int *p, int m)
return (m >= ACPI_STATE_D0 && m <= ACPI_STATE_D3_COLD) ? return (m >= ACPI_STATE_D0 && m <= ACPI_STATE_D3_COLD) ?
m : ACPI_STATE_D0; m : ACPI_STATE_D0;
} }
static inline void acpi_dev_pm_add_dependent(acpi_handle handle,
struct device *depdev) {}
static inline void acpi_dev_pm_remove_dependent(acpi_handle handle,
struct device *depdev) {}
#endif #endif
#ifdef CONFIG_PM_RUNTIME #ifdef CONFIG_PM_RUNTIME
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册