Skip to content

Commit d5a8fb6

Browse files
committed
perf: qcom_l2_pmu: ACPI: Use ACPI_COMPANION() directly
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]>
1 parent f0b2731 commit d5a8fb6

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

drivers/perf/qcom_l2_pmu.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -840,17 +840,14 @@ static int l2_cache_pmu_probe_cluster(struct device *dev, void *data)
840840
{
841841
struct platform_device *pdev = to_platform_device(dev->parent);
842842
struct platform_device *sdev = to_platform_device(dev);
843+
struct acpi_device *adev = ACPI_COMPANION(dev);
843844
struct l2cache_pmu *l2cache_pmu = data;
844845
struct cluster_pmu *cluster;
845-
struct acpi_device *device;
846846
unsigned long fw_cluster_id;
847847
int err;
848848
int irq;
849849

850-
if (acpi_bus_get_device(ACPI_HANDLE(dev), &device))
851-
return -ENODEV;
852-
853-
if (kstrtoul(device->pnp.unique_id, 10, &fw_cluster_id) < 0) {
850+
if (!adev || kstrtoul(adev->pnp.unique_id, 10, &fw_cluster_id) < 0) {
854851
dev_err(&pdev->dev, "unable to read ACPI uid\n");
855852
return -ENODEV;
856853
}

0 commit comments

Comments
 (0)