diff options
Diffstat (limited to 'drivers/thunderbolt/acpi.c')
-rw-r--r-- | drivers/thunderbolt/acpi.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/thunderbolt/acpi.c b/drivers/thunderbolt/acpi.c index 38fefd0e5268..c9b6bb46111c 100644 --- a/drivers/thunderbolt/acpi.c +++ b/drivers/thunderbolt/acpi.c @@ -12,7 +12,7 @@ #include "tb.h" static acpi_status tb_acpi_add_link(acpi_handle handle, u32 level, void *data, - void **return_value) + void **ret) { struct acpi_device *adev = acpi_fetch_acpi_dev(handle); struct fwnode_handle *fwnode; @@ -84,6 +84,7 @@ static acpi_status tb_acpi_add_link(acpi_handle handle, u32 level, void *data, if (link) { dev_dbg(&nhi->pdev->dev, "created link from %s\n", dev_name(&pdev->dev)); + *(bool *)ret = true; } else { dev_warn(&nhi->pdev->dev, "device link creation from %s failed\n", dev_name(&pdev->dev)); @@ -104,22 +105,29 @@ out_put: * Goes over ACPI namespace finding tunneled ports that reference to * @nhi ACPI node. For each reference a device link is added. The link * is automatically removed by the driver core. + * + * Returns %true if at least one link was created. */ -void tb_acpi_add_links(struct tb_nhi *nhi) +bool tb_acpi_add_links(struct tb_nhi *nhi) { acpi_status status; + bool ret = false; if (!has_acpi_companion(&nhi->pdev->dev)) - return; + return false; /* * Find all devices that have usb4-host-controller interface * property that references to this NHI. */ status = acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, 32, - tb_acpi_add_link, NULL, nhi, NULL); - if (ACPI_FAILURE(status)) + tb_acpi_add_link, NULL, nhi, (void **)&ret); + if (ACPI_FAILURE(status)) { dev_warn(&nhi->pdev->dev, "failed to enumerate tunneled ports\n"); + return false; + } + + return ret; } /** |