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

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

driver core / ACPI: Represent ACPI companions using fwnode_handle



Now that we have struct fwnode_handle, we can use that to point to
ACPI companions from struct device objects instead of pointing to
struct acpi_device directly.

There are two benefits from that.  First, the somewhat ugly and
hackish struct acpi_dev_node can be dropped and, second, the same
struct fwnode_handle pointer can be used in the future to point
to other (non-ACPI) firmware device node types.

Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: default avatarGrant Likely <grant.likely@linaro.org>
parent 06e5801b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -102,7 +102,7 @@ struct platform_device *acpi_create_platform_device(struct acpi_device *adev)
	pdevinfo.id = -1;
	pdevinfo.res = resources;
	pdevinfo.num_res = count;
	pdevinfo.acpi_node.companion = adev;
	pdevinfo.fwnode = acpi_fwnode_handle(adev);
	pdevinfo.dma_mask = DMA_BIT_MASK(32);
	pdev = platform_device_register_full(&pdevinfo);
	if (IS_ERR(pdev))
+1 −1
Original line number Diff line number Diff line
@@ -615,7 +615,7 @@ void acpi_dock_add(struct acpi_device *adev)
	memset(&pdevinfo, 0, sizeof(pdevinfo));
	pdevinfo.name = "dock";
	pdevinfo.id = dock_station_count;
	pdevinfo.acpi_node.companion = adev;
	pdevinfo.fwnode = acpi_fwnode_handle(adev);
	pdevinfo.data = &ds;
	pdevinfo.size_data = sizeof(ds);
	dd = platform_device_register_full(&pdevinfo);
+1 −1
Original line number Diff line number Diff line
@@ -454,7 +454,7 @@ struct platform_device *platform_device_register_full(
		goto err_alloc;

	pdev->dev.parent = pdevinfo->parent;
	ACPI_COMPANION_SET(&pdev->dev, pdevinfo->acpi_node.companion);
	pdev->dev.fwnode = pdevinfo->fwnode;

	if (pdevinfo->dma_mask) {
		/*
+2 −0
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@

enum of_gpio_flags;

struct acpi_device;

/**
 * struct acpi_gpio_info - ACPI GPIO specific information
 * @gpioint: if %true this GPIO is of type GpioInt otherwise type is GpioIo
+2 −2
Original line number Diff line number Diff line
@@ -133,7 +133,7 @@ static acpi_status acpi_i2c_add_device(acpi_handle handle, u32 level,
		return AE_OK;

	memset(&info, 0, sizeof(info));
	info.acpi_node.companion = adev;
	info.fwnode = acpi_fwnode_handle(adev);
	info.irq = -1;

	INIT_LIST_HEAD(&resource_list);
@@ -971,7 +971,7 @@ i2c_new_device(struct i2c_adapter *adap, struct i2c_board_info const *info)
	client->dev.bus = &i2c_bus_type;
	client->dev.type = &i2c_client_type;
	client->dev.of_node = info->of_node;
	ACPI_COMPANION_SET(&client->dev, info->acpi_node.companion);
	client->dev.fwnode = info->fwnode;

	i2c_dev_set_name(adap, client);
	status = device_register(&client->dev);
Loading