public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Kartik Rajput <kkartik@nvidia.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: lenb@kernel.org, sakari.ailus@linux.intel.com,
	mika.westerberg@linux.intel.com,
	andriy.shevchenko@linux.intel.com, thierry.reding@gmail.com,
	jonathanh@nvidia.com, linux-acpi@vger.kernel.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH v2] ACPI: bus: Use OF match data for PRP0001 matched devices
Date: Thu, 8 Jan 2026 16:53:40 +0530	[thread overview]
Message-ID: <a794af2f-beba-45ba-8ce3-4bf5bb0111c9@nvidia.com> (raw)
In-Reply-To: <CAJZ5v0gbqXrj+Zq42CWL11-d4uJPb6NcGKrnf+ZQWvBSJGqZxA@mail.gmail.com>

On 07/01/26 18:24, Rafael J. Wysocki wrote:
> External email: Use caution opening links or attachments
> 
> 
> On Wed, Jan 7, 2026 at 1:03 PM Kartik Rajput <kkartik@nvidia.com> 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).
>>
>> 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)
> 
> You still need to check acpi_ids against NULL or (better) check adev
> against NULL.
> 

Hi Rafael,

Thanks for reviewing the patch.

Yes, it looks like adev should be NULL-checked. acpi_of_device_get_match_data()
also uses the adev reference and passes it to acpi_of_match_device(), which checks
it against NULL.

I will make this change in the next revision.

Thanks,
Kartik

  reply	other threads:[~2026-01-08 11:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2026-01-07 15:47 ` Andy Shevchenko
2026-01-08 12:27   ` Kartik Rajput
2026-01-08 18:05     ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a794af2f-beba-45ba-8ce3-4bf5bb0111c9@nvidia.com \
    --to=kkartik@nvidia.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=jonathanh@nvidia.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=rafael@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=stable@vger.kernel.org \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox