public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] ACPI: bus: Use OF match data for PRP0001 matched devices
@ 2026-01-07 12:03 Kartik Rajput
  2026-01-07 12:38 ` Sakari Ailus
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Kartik Rajput @ 2026-01-07 12:03 UTC (permalink / raw)
  To: lenb, sakari.ailus, mika.westerberg, andriy.shevchenko,
	thierry.reding, jonathanh, linux-acpi, linux-kernel
  Cc: Kartik Rajput, stable

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).

Explicitly detect PRP0001 and fetch match data from the driver's
of_match_table via acpi_of_device_get_match_data().

Fixes: 886ca88be6b3 ("ACPI / bus: Respect PRP0001 when retrieving device match data")
Cc: stable@vger.kernel.org
Signed-off-by: Kartik Rajput <kkartik@nvidia.com>
---
Changes in v2:
	* Fix build errors.
---
 drivers/acpi/bus.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index 5e110badac7b..6658c4339656 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -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);
 
-	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);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-01-08 18:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-07 12:03 [PATCH v2] ACPI: bus: Use OF match data for PRP0001 matched devices Kartik Rajput
2026-01-07 12:38 ` Sakari Ailus
2026-01-08 11:18   ` Kartik Rajput
2026-01-07 12:54 ` Rafael J. Wysocki
2026-01-08 11:23   ` Kartik Rajput
2026-01-07 15:47 ` Andy Shevchenko
2026-01-08 12:27   ` Kartik Rajput
2026-01-08 18:05     ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox