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

Commit 0b357127 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

Merge branch 'acpi-scan' into acpi-lpss

The following commits depend on the 'acpi-scan' material.
parents 7d1f9aef 5993c467
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -37,7 +37,7 @@ acpi-y += resource.o
acpi-y				+= processor_core.o
acpi-y				+= processor_core.o
acpi-y				+= ec.o
acpi-y				+= ec.o
acpi-$(CONFIG_ACPI_DOCK)	+= dock.o
acpi-$(CONFIG_ACPI_DOCK)	+= dock.o
acpi-y				+= pci_root.o pci_link.o pci_irq.o pci_bind.o
acpi-y				+= pci_root.o pci_link.o pci_irq.o
acpi-y				+= acpi_platform.o
acpi-y				+= acpi_platform.o
acpi-y				+= power.o
acpi-y				+= power.o
acpi-y				+= event.o
acpi-y				+= event.o
+7 −19
Original line number Original line Diff line number Diff line
@@ -157,38 +157,26 @@ static int
acpi_memory_get_device(acpi_handle handle,
acpi_memory_get_device(acpi_handle handle,
		       struct acpi_memory_device **mem_device)
		       struct acpi_memory_device **mem_device)
{
{
	acpi_status status;
	acpi_handle phandle;
	struct acpi_device *device = NULL;
	struct acpi_device *device = NULL;
	struct acpi_device *pdevice = NULL;
	int result;
	int result;



	if (!acpi_bus_get_device(handle, &device) && device)
	if (!acpi_bus_get_device(handle, &device) && device)
		goto end;
		goto end;


	status = acpi_get_parent(handle, &phandle);
	if (ACPI_FAILURE(status)) {
		ACPI_EXCEPTION((AE_INFO, status, "Cannot find acpi parent"));
		return -EINVAL;
	}

	/* Get the parent device */
	result = acpi_bus_get_device(phandle, &pdevice);
	if (result) {
		acpi_handle_warn(phandle, "Cannot get acpi bus device\n");
		return -EINVAL;
	}

	/*
	/*
	 * Now add the notified device.  This creates the acpi_device
	 * Now add the notified device.  This creates the acpi_device
	 * and invokes .add function
	 * and invokes .add function
	 */
	 */
	result = acpi_bus_add(&device, pdevice, handle, ACPI_BUS_TYPE_DEVICE);
	result = acpi_bus_add(handle);
	if (result) {
	if (result) {
		acpi_handle_warn(handle, "Cannot add acpi bus\n");
		acpi_handle_warn(handle, "Cannot add acpi bus\n");
		return -EINVAL;
		return -EINVAL;
	}
	}
	result = acpi_bus_get_device(handle, &device);
	if (result) {
		acpi_handle_warn(handle, "Missing device object\n");
		return -EINVAL;
	}


      end:
      end:
	*mem_device = acpi_driver_data(device);
	*mem_device = acpi_driver_data(device);
@@ -355,7 +343,7 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
			break;
			break;
		}
		}


		ej_event->handle = handle;
		ej_event->device = device;
		ej_event->event = ACPI_NOTIFY_EJECT_REQUEST;
		ej_event->event = ACPI_NOTIFY_EJECT_REQUEST;
		acpi_os_hotplug_execute(acpi_bus_hot_remove_device,
		acpi_os_hotplug_execute(acpi_bus_hot_remove_device,
					(void *)ej_event);
					(void *)ej_event);
+6 −25
Original line number Original line Diff line number Diff line
@@ -135,30 +135,6 @@ static int acpi_container_remove(struct acpi_device *device, int type)
	return status;
	return status;
}
}


static int container_device_add(struct acpi_device **device, acpi_handle handle)
{
	acpi_handle phandle;
	struct acpi_device *pdev;
	int result;


	if (acpi_get_parent(handle, &phandle)) {
		return -ENODEV;
	}

	if (acpi_bus_get_device(phandle, &pdev)) {
		return -ENODEV;
	}

	if (acpi_bus_add(device, pdev, handle, ACPI_BUS_TYPE_DEVICE)) {
		return -ENODEV;
	}

	result = acpi_bus_start(*device);

	return result;
}

static void container_notify_cb(acpi_handle handle, u32 type, void *context)
static void container_notify_cb(acpi_handle handle, u32 type, void *context)
{
{
	struct acpi_device *device = NULL;
	struct acpi_device *device = NULL;
@@ -190,11 +166,16 @@ static void container_notify_cb(acpi_handle handle, u32 type, void *context)
		if (!ACPI_FAILURE(status) || device)
		if (!ACPI_FAILURE(status) || device)
			break;
			break;


		result = container_device_add(&device, handle);
		result = acpi_bus_add(handle);
		if (result) {
		if (result) {
			acpi_handle_warn(handle, "Failed to add container\n");
			acpi_handle_warn(handle, "Failed to add container\n");
			break;
			break;
		}
		}
		result = acpi_bus_get_device(handle, &device);
		if (result) {
			acpi_handle_warn(handle, "Missing device object\n");
			break;
		}


		kobject_uevent(&device->dev.kobj, KOBJ_ONLINE);
		kobject_uevent(&device->dev.kobj, KOBJ_ONLINE);
		ost_code = ACPI_OST_SC_SUCCESS;
		ost_code = ACPI_OST_SC_SUCCESS;
+1 −1
Original line number Original line Diff line number Diff line
@@ -353,7 +353,7 @@ int acpi_pm_device_sleep_wake(struct device *dev, bool enable)
 * acpi_dev_pm_get_node - Get ACPI device node for the given physical device.
 * acpi_dev_pm_get_node - Get ACPI device node for the given physical device.
 * @dev: Device to get the ACPI node for.
 * @dev: Device to get the ACPI node for.
 */
 */
static struct acpi_device *acpi_dev_pm_get_node(struct device *dev)
struct acpi_device *acpi_dev_pm_get_node(struct device *dev)
{
{
	acpi_handle handle = DEVICE_ACPI_HANDLE(dev);
	acpi_handle handle = DEVICE_ACPI_HANDLE(dev);
	struct acpi_device *adev;
	struct acpi_device *adev;
+5 −12
Original line number Original line Diff line number Diff line
@@ -310,8 +310,6 @@ static int dock_present(struct dock_station *ds)
static struct acpi_device * dock_create_acpi_device(acpi_handle handle)
static struct acpi_device * dock_create_acpi_device(acpi_handle handle)
{
{
	struct acpi_device *device;
	struct acpi_device *device;
	struct acpi_device *parent_device;
	acpi_handle parent;
	int ret;
	int ret;


	if (acpi_bus_get_device(handle, &device)) {
	if (acpi_bus_get_device(handle, &device)) {
@@ -319,16 +317,11 @@ static struct acpi_device * dock_create_acpi_device(acpi_handle handle)
		 * no device created for this object,
		 * no device created for this object,
		 * so we should create one.
		 * so we should create one.
		 */
		 */
		acpi_get_parent(handle, &parent);
		ret = acpi_bus_add(handle);
		if (acpi_bus_get_device(parent, &parent_device))
		if (ret)
			parent_device = NULL;

		ret = acpi_bus_add(&device, parent_device, handle,
			ACPI_BUS_TYPE_DEVICE);
		if (ret) {
			pr_debug("error adding bus, %x\n", -ret);
			pr_debug("error adding bus, %x\n", -ret);
			return NULL;

		}
		acpi_bus_get_device(handle, &device);
	}
	}
	return device;
	return device;
}
}
@@ -346,7 +339,7 @@ static void dock_remove_acpi_device(acpi_handle handle)
	int ret;
	int ret;


	if (!acpi_bus_get_device(handle, &device)) {
	if (!acpi_bus_get_device(handle, &device)) {
		ret = acpi_bus_trim(device, 1);
		ret = acpi_bus_trim(device);
		if (ret)
		if (ret)
			pr_debug("error removing bus, %x\n", -ret);
			pr_debug("error removing bus, %x\n", -ret);
	}
	}
Loading