]> Git Repo - linux.git/commitdiff
perf: qcom_l2_pmu: ACPI: Use ACPI_COMPANION() directly
authorRafael J. Wysocki <[email protected]>
Wed, 13 Oct 2021 16:15:33 +0000 (18:15 +0200)
committerRafael J. Wysocki <[email protected]>
Wed, 27 Oct 2021 18:38:22 +0000 (20:38 +0200)
The ACPI_HANDLE() macro is a wrapper arond the ACPI_COMPANION()
macro and the ACPI handle produced by the former comes from the
ACPI device object produced by the latter, so it is way more
straightforward to evaluate the latter directly instead of passing
the handle produced by the former to acpi_bus_get_device().

Modify l2_cache_pmu_probe_cluster() accordingly (no intentional
functional impact).

While at it, rename the ACPI device pointer to adev for more
clarity.

Signed-off-by: Rafael J. Wysocki <[email protected]>
drivers/perf/qcom_l2_pmu.c

index 5b093badd0f65522739ef544f30b94d25e9c5456..7640491aab123c6e1dc71c1bca49d68bc31e268d 100644 (file)
@@ -840,17 +840,14 @@ static int l2_cache_pmu_probe_cluster(struct device *dev, void *data)
 {
        struct platform_device *pdev = to_platform_device(dev->parent);
        struct platform_device *sdev = to_platform_device(dev);
+       struct acpi_device *adev = ACPI_COMPANION(dev);
        struct l2cache_pmu *l2cache_pmu = data;
        struct cluster_pmu *cluster;
-       struct acpi_device *device;
        unsigned long fw_cluster_id;
        int err;
        int irq;
 
-       if (acpi_bus_get_device(ACPI_HANDLE(dev), &device))
-               return -ENODEV;
-
-       if (kstrtoul(device->pnp.unique_id, 10, &fw_cluster_id) < 0) {
+       if (!adev || kstrtoul(adev->pnp.unique_id, 10, &fw_cluster_id) < 0) {
                dev_err(&pdev->dev, "unable to read ACPI uid\n");
                return -ENODEV;
        }
This page took 0.059611 seconds and 4 git commands to generate.