Commit 105350fe authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Will Deacon

drivers/perf: thunderx2_pmu: Replace open coded acpi_match_acpi_device()

Replace open coded acpi_match_acpi_device() in get_tx2_pmu_type().
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20240404170016.2466898-1-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarWill Deacon <will@kernel.org>
parent f66ae597
...@@ -504,24 +504,19 @@ static void tx2_uncore_event_update(struct perf_event *event) ...@@ -504,24 +504,19 @@ static void tx2_uncore_event_update(struct perf_event *event)
static enum tx2_uncore_type get_tx2_pmu_type(struct acpi_device *adev) static enum tx2_uncore_type get_tx2_pmu_type(struct acpi_device *adev)
{ {
int i = 0; struct acpi_device_id devices[] = {
struct acpi_tx2_pmu_device {
__u8 id[ACPI_ID_LEN];
enum tx2_uncore_type type;
} devices[] = {
{"CAV901D", PMU_TYPE_L3C}, {"CAV901D", PMU_TYPE_L3C},
{"CAV901F", PMU_TYPE_DMC}, {"CAV901F", PMU_TYPE_DMC},
{"CAV901E", PMU_TYPE_CCPI2}, {"CAV901E", PMU_TYPE_CCPI2},
{"", PMU_TYPE_INVALID} {}
}; };
const struct acpi_device_id *id;
while (devices[i].type != PMU_TYPE_INVALID) { id = acpi_match_acpi_device(devices, adev);
if (!strcmp(acpi_device_hid(adev), devices[i].id)) if (!id)
break; return PMU_TYPE_INVALID;
i++;
}
return devices[i].type; return (enum tx2_uncore_type)id->driver_data;
} }
static bool tx2_uncore_validate_event(struct pmu *pmu, static bool tx2_uncore_validate_event(struct pmu *pmu,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment