diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-10-17 09:44:48 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-10-17 09:44:48 -0400 |
commit | 2421ad48f4aed63bc890e8f3c53ed581a542fb66 (patch) | |
tree | f0d8fe117cfc0e8227816cace9d5434503bedf0e | |
parent | b08fc109ce4a32ce2f73f6e0437abc94ab1dd023 (diff) |
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: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | drivers/acpi/device_pm.c | 56 | ||||
-rw-r--r-- | drivers/acpi/scan.c | 1 | ||||
-rw-r--r-- | include/acpi/acpi_bus.h | 7 |
3 files changed, 0 insertions, 64 deletions
diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c index 59d3202f6b36..a94383d1f350 100644 --- a/drivers/acpi/device_pm.c +++ b/drivers/acpi/device_pm.c | |||
@@ -1025,60 +1025,4 @@ void acpi_dev_pm_detach(struct device *dev, bool power_off) | |||
1025 | } | 1025 | } |
1026 | } | 1026 | } |
1027 | EXPORT_SYMBOL_GPL(acpi_dev_pm_detach); | 1027 | EXPORT_SYMBOL_GPL(acpi_dev_pm_detach); |
1028 | |||
1029 | /** | ||
1030 | * acpi_dev_pm_add_dependent - Add physical device depending for PM. | ||
1031 | * @handle: Handle of ACPI device node. | ||
1032 | * @depdev: Device depending on that node for PM. | ||
1033 | */ | ||
1034 | void acpi_dev_pm_add_dependent(acpi_handle handle, struct device *depdev) | ||
1035 | { | ||
1036 | struct acpi_device_physical_node *dep; | ||
1037 | struct acpi_device *adev; | ||
1038 | |||
1039 | if (!depdev || acpi_bus_get_device(handle, &adev)) | ||
1040 | return; | ||
1041 | |||
1042 | mutex_lock(&adev->physical_node_lock); | ||
1043 | |||
1044 | list_for_each_entry(dep, &adev->power_dependent, node) | ||
1045 | if (dep->dev == depdev) | ||
1046 | goto out; | ||
1047 | |||
1048 | dep = kzalloc(sizeof(*dep), GFP_KERNEL); | ||
1049 | if (dep) { | ||
1050 | dep->dev = depdev; | ||
1051 | list_add_tail(&dep->node, &adev->power_dependent); | ||
1052 | } | ||
1053 | |||
1054 | out: | ||
1055 | mutex_unlock(&adev->physical_node_lock); | ||
1056 | } | ||
1057 | EXPORT_SYMBOL_GPL(acpi_dev_pm_add_dependent); | ||
1058 | |||
1059 | /** | ||
1060 | * acpi_dev_pm_remove_dependent - Remove physical device depending for PM. | ||
1061 | * @handle: Handle of ACPI device node. | ||
1062 | * @depdev: Device depending on that node for PM. | ||
1063 | */ | ||
1064 | void acpi_dev_pm_remove_dependent(acpi_handle handle, struct device *depdev) | ||
1065 | { | ||
1066 | struct acpi_device_physical_node *dep; | ||
1067 | struct acpi_device *adev; | ||
1068 | |||
1069 | if (!depdev || acpi_bus_get_device(handle, &adev)) | ||
1070 | return; | ||
1071 | |||
1072 | mutex_lock(&adev->physical_node_lock); | ||
1073 | |||
1074 | list_for_each_entry(dep, &adev->power_dependent, node) | ||
1075 | if (dep->dev == depdev) { | ||
1076 | list_del(&dep->node); | ||
1077 | kfree(dep); | ||
1078 | break; | ||
1079 | } | ||
1080 | |||
1081 | mutex_unlock(&adev->physical_node_lock); | ||
1082 | } | ||
1083 | EXPORT_SYMBOL_GPL(acpi_dev_pm_remove_dependent); | ||
1084 | #endif /* CONFIG_PM */ | 1028 | #endif /* CONFIG_PM */ |
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 407ad13cac2f..fee8a297c7d9 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
@@ -999,7 +999,6 @@ int acpi_device_add(struct acpi_device *device, | |||
999 | INIT_LIST_HEAD(&device->wakeup_list); | 999 | INIT_LIST_HEAD(&device->wakeup_list); |
1000 | INIT_LIST_HEAD(&device->physical_node_list); | 1000 | INIT_LIST_HEAD(&device->physical_node_list); |
1001 | mutex_init(&device->physical_node_lock); | 1001 | mutex_init(&device->physical_node_lock); |
1002 | INIT_LIST_HEAD(&device->power_dependent); | ||
1003 | 1002 | ||
1004 | new_bus_id = kzalloc(sizeof(struct acpi_device_bus_id), GFP_KERNEL); | 1003 | new_bus_id = kzalloc(sizeof(struct acpi_device_bus_id), GFP_KERNEL); |
1005 | if (!new_bus_id) { | 1004 | if (!new_bus_id) { |
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 02e113bb8b7d..d9019821aa60 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
@@ -311,7 +311,6 @@ struct acpi_device { | |||
311 | unsigned int physical_node_count; | 311 | unsigned int physical_node_count; |
312 | struct list_head physical_node_list; | 312 | struct list_head physical_node_list; |
313 | struct mutex physical_node_lock; | 313 | struct mutex physical_node_lock; |
314 | struct list_head power_dependent; | ||
315 | void (*remove)(struct acpi_device *); | 314 | void (*remove)(struct acpi_device *); |
316 | }; | 315 | }; |
317 | 316 | ||
@@ -456,8 +455,6 @@ acpi_status acpi_add_pm_notifier(struct acpi_device *adev, | |||
456 | acpi_status acpi_remove_pm_notifier(struct acpi_device *adev, | 455 | acpi_status acpi_remove_pm_notifier(struct acpi_device *adev, |
457 | acpi_notify_handler handler); | 456 | acpi_notify_handler handler); |
458 | int acpi_pm_device_sleep_state(struct device *, int *, int); | 457 | int acpi_pm_device_sleep_state(struct device *, int *, int); |
459 | void acpi_dev_pm_add_dependent(acpi_handle handle, struct device *depdev); | ||
460 | void acpi_dev_pm_remove_dependent(acpi_handle handle, struct device *depdev); | ||
461 | #else | 458 | #else |
462 | static inline acpi_status acpi_add_pm_notifier(struct acpi_device *adev, | 459 | static inline acpi_status acpi_add_pm_notifier(struct acpi_device *adev, |
463 | acpi_notify_handler handler, | 460 | acpi_notify_handler handler, |
@@ -478,10 +475,6 @@ static inline int acpi_pm_device_sleep_state(struct device *d, int *p, int m) | |||
478 | return (m >= ACPI_STATE_D0 && m <= ACPI_STATE_D3_COLD) ? | 475 | return (m >= ACPI_STATE_D0 && m <= ACPI_STATE_D3_COLD) ? |
479 | m : ACPI_STATE_D0; | 476 | m : ACPI_STATE_D0; |
480 | } | 477 | } |
481 | static inline void acpi_dev_pm_add_dependent(acpi_handle handle, | ||
482 | struct device *depdev) {} | ||
483 | static inline void acpi_dev_pm_remove_dependent(acpi_handle handle, | ||
484 | struct device *depdev) {} | ||
485 | #endif | 478 | #endif |
486 | 479 | ||
487 | #ifdef CONFIG_PM_RUNTIME | 480 | #ifdef CONFIG_PM_RUNTIME |