Re: [PATCH v2] ACPI: bus: Use OF match data for PRP0001 matched devices
From: Andy Shevchenko
Date: Wed Jan 07 2026 - 10:48:01 EST
On Wed, Jan 07, 2026 at 05:33:18PM +0530, Kartik Rajput wrote:
> When a device is matched via PRP0001, the driver's OF (DT) match table
> must be used to obtain the device match data. If a driver provides both
> an acpi_match_table and an of_match_table, the current
> acpi_device_get_match_data() path consults the driver's acpi_match_table
> and returns NULL (no ACPI ID matches).
Since we have both tables, why the actual ACPI HID of the device in question
(actually which one?) can't be used?
> Explicitly detect PRP0001 and fetch match data from the driver's
> of_match_table via acpi_of_device_get_match_data().
In principle we can go this way, but can you tell a bit more of a story?
Why the device in question can't use existed or a newly allocated ACPI HID for
that?
...
> @@ -1031,8 +1031,9 @@ const void *acpi_device_get_match_data(const struct device *dev)
> {
> const struct acpi_device_id *acpi_ids = dev->driver->acpi_match_table;
> const struct acpi_device_id *match;
> + struct acpi_device *adev = ACPI_COMPANION(dev);
Please, keep it in reversed xmas tree order.
> - if (!acpi_ids)
> + if (!strcmp(ACPI_DT_NAMESPACE_HID, acpi_device_hid(adev)))
> return acpi_of_device_get_match_data(dev);
>
> match = acpi_match_device(acpi_ids, dev);
--
With Best Regards,
Andy Shevchenko