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

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

Merge branch 'acpi-scan'

* acpi-scan: (30 commits)
  ACPI / scan: Fix acpi_bus_get_device() check in acpi_match_device()
  ACPI / scan: Make namespace scanning and trimming mutually exclusive
  ACPI / scan: Make it clear that acpi_bus_trim() cannot fail
  ACPI / scan: Drop acpi_bus_add() and use acpi_bus_scan() instead
  ACPI: update ej_event interface to take acpi_device
  ACPI / scan: Add second pass to acpi_bus_trim()
  ACPI / scan: Change the implementation of acpi_bus_trim()
  ACPI / scan: Drop the second argument of acpi_bus_trim()
  ACPI / scan: Drop the second argument of acpi_device_unregister()
  ACPI: Remove the ops field from struct acpi_device
  ACPI: remove unused acpi_op_bind and acpi_op_unbind
  ACPI / scan: Fix check of device_attach() return value.
  ACPI / scan: Treat power resources in a special way
  ACPI: Remove unused struct acpi_pci_root.id member
  ACPI: Drop ACPI device .bind() and .unbind() callbacks
  ACPI / PCI: Move the _PRT setup and cleanup code to pci-acpi.c
  ACPI / PCI: Rework the setup and cleanup of device wakeup
  ACPI: Add .setup() and .cleanup() callbacks to struct acpi_bus_type
  ACPI: Make acpi_bus_scan() and acpi_bus_add() take only one argument
  ACPI: Replace ACPI device add_type field with a match_driver flag
  ...
parents 836dc9e3 0613e1f7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ acpi-y += resource.o
acpi-y				+= processor_core.o
acpi-y				+= ec.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				+= power.o
acpi-y				+= event.o
+7 −19
Original line number Diff line number Diff line
@@ -157,38 +157,26 @@ static int
acpi_memory_get_device(acpi_handle handle,
		       struct acpi_memory_device **mem_device)
{
	acpi_status status;
	acpi_handle phandle;
	struct acpi_device *device = NULL;
	struct acpi_device *pdevice = NULL;
	int result;


	if (!acpi_bus_get_device(handle, &device) && device)
		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
	 * and invokes .add function
	 */
	result = acpi_bus_add(&device, pdevice, handle, ACPI_BUS_TYPE_DEVICE);
	result = acpi_bus_scan(handle);
	if (result) {
		acpi_handle_warn(handle, "Cannot add acpi bus\n");
		return -EINVAL;
	}
	result = acpi_bus_get_device(handle, &device);
	if (result) {
		acpi_handle_warn(handle, "Missing device object\n");
		return -EINVAL;
	}

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

		ej_event->handle = handle;
		ej_event->device = device;
		ej_event->event = ACPI_NOTIFY_EJECT_REQUEST;
		acpi_os_hotplug_execute(acpi_bus_hot_remove_device,
					(void *)ej_event);
+6 −25
Original line number Diff line number Diff line
@@ -135,30 +135,6 @@ static int acpi_container_remove(struct acpi_device *device, int type)
	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)
{
	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)
			break;

		result = container_device_add(&device, handle);
		result = acpi_bus_scan(handle);
		if (result) {
			acpi_handle_warn(handle, "Failed to add container\n");
			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);
		ost_code = ACPI_OST_SC_SUCCESS;
+1 −1
Original line number 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.
 * @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);
	struct acpi_device *adev;
+6 −17
Original line number 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)
{
	struct acpi_device *device;
	struct acpi_device *parent_device;
	acpi_handle parent;
	int ret;

	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,
		 * so we should create one.
		 */
		acpi_get_parent(handle, &parent);
		if (acpi_bus_get_device(parent, &parent_device))
			parent_device = NULL;

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

		acpi_bus_get_device(handle, &device);
	}
	return device;
}
@@ -343,13 +336,9 @@ static struct acpi_device * dock_create_acpi_device(acpi_handle handle)
static void dock_remove_acpi_device(acpi_handle handle)
{
	struct acpi_device *device;
	int ret;

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

/**
Loading