Re: [PATCH v5 2/4] ACPI: of: match PRP0001 in of_match_device
From: Markus Probst
Date: Mon Mar 30 2026 - 15:25:36 EST
On Mon, 2026-03-30 at 14:22 -0500, Rob Herring wrote:
> On Mon, Mar 30, 2026 at 07:04:21PM +0000, Markus Probst wrote:
> > On Mon, 2026-03-30 at 09:00 +0200, Krzysztof Kozlowski wrote:
> > > On Sun, Mar 29, 2026 at 08:02:16PM +0200, Markus Probst wrote:
> > > > Export `acpi_of_match_device` function and use it to match for PRP0001
> > > > in `of_match_device`, if the device does not have a device node.
> > > >
> > > > This fixes the match data being NULL when using ACPI PRP0001, even though
> > > > the device was matched against an of device table.
> > >
> > > Fixes tag?
> > >
> > > I don't see how this is going to fix !ACPI case - the
> > > acpi_of_match_device() will just return false.
> > While trying to argue I found out that there already is
> > `device_get_match_data`, which takes PRP0001 into account.
> >
> > I will now instead make a patch, which will make rust use this function
> > instead of calling `of_match_device` and `acpi_match_device`
> > individually, which ignores PRP0001.
>
> IIRC, the rust binding already gives you the data pointer in probe.
Yes, but that pointer is obtained by calling `acpi_match_device` and
`of_match_device` [1].
Thanks
- Markus Probst
[1]
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/rust/kernel/driver.rs?id=7aaa8047eafd0bd628065b15757d9b48c5f9c07d
>
> > There are still a lot of drivers only using `of_match_device`, which
> > makes it impossible to use PRP0001 with them. But this is not relevant
> > for this driver.
>
> Usually using of_match_device() in drivers is wrong. You generally just
> want the data pointer. There's a whole bunch of drivers still doing the
> old way.
>
> Rob
Attachment:
signature.asc
Description: This is a digitally signed message part