Skip to content

Commit 9cde625

Browse files
andy-shevrafaeljw
authored andcommitted
perf: qcom_l2_pmu: Refactor _UID handling to use acpi_dev_uid_to_integer()
ACPI utils provide acpi_dev_uid_to_integer() helper to extract _UID as an integer. Use it instead of custom approach. Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 3ddaf13 commit 9cde625

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/perf/qcom_l2_pmu.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -840,16 +840,16 @@ 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);
844843
struct l2cache_pmu *l2cache_pmu = data;
845844
struct cluster_pmu *cluster;
846-
unsigned long fw_cluster_id;
845+
u64 fw_cluster_id;
847846
int err;
848847
int irq;
849848

850-
if (!adev || kstrtoul(adev->pnp.unique_id, 10, &fw_cluster_id) < 0) {
849+
err = acpi_dev_uid_to_integer(ACPI_COMPANION(dev), &fw_cluster_id);
850+
if (err) {
851851
dev_err(&pdev->dev, "unable to read ACPI uid\n");
852-
return -ENODEV;
852+
return err;
853853
}
854854

855855
cluster = devm_kzalloc(&pdev->dev, sizeof(*cluster), GFP_KERNEL);
@@ -879,7 +879,7 @@ static int l2_cache_pmu_probe_cluster(struct device *dev, void *data)
879879
}
880880

881881
dev_info(&pdev->dev,
882-
"Registered L2 cache PMU cluster %ld\n", fw_cluster_id);
882+
"Registered L2 cache PMU cluster %lld\n", fw_cluster_id);
883883

884884
spin_lock_init(&cluster->pmu_lock);
885885

0 commit comments

Comments
 (0)