Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2421ad48 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

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: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent b08fc109
Loading
Loading
Loading
Loading
+0 −56
Original line number Diff line number Diff line
@@ -1025,60 +1025,4 @@ void acpi_dev_pm_detach(struct device *dev, bool power_off)
	}
}
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 */
+0 −1
Original line number Diff line number Diff line
@@ -999,7 +999,6 @@ int acpi_device_add(struct acpi_device *device,
	INIT_LIST_HEAD(&device->wakeup_list);
	INIT_LIST_HEAD(&device->physical_node_list);
	mutex_init(&device->physical_node_lock);
	INIT_LIST_HEAD(&device->power_dependent);

	new_bus_id = kzalloc(sizeof(struct acpi_device_bus_id), GFP_KERNEL);
	if (!new_bus_id) {
+0 −7
Original line number Diff line number Diff line
@@ -311,7 +311,6 @@ struct acpi_device {
	unsigned int physical_node_count;
	struct list_head physical_node_list;
	struct mutex physical_node_lock;
	struct list_head power_dependent;
	void (*remove)(struct acpi_device *);
};

@@ -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_notify_handler handler);
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
static inline acpi_status acpi_add_pm_notifier(struct acpi_device *adev,
					       acpi_notify_handler handler,
@@ -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) ?
		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

#ifdef CONFIG_PM_RUNTIME