Re: [PATCH v2 1/2] drivers: core: platform: Add platform_get_match_data() helper
From: Fabio Forni
Date: Sat Nov 28 2026 - 04:05:24 EST
Hello Jonathan,
On 28/11/26 01:27, Jonathan Cameron wrote:
On Sat, 28 Nov 2026 00:22:09 +0100
Fabio Forni via B4 Relay <devnull+development.redaril.me@xxxxxxxxxx> wrote:
From: Fabio Forni <development@xxxxxxxxxx>I'd have added a reference to similar cases like i2c_get_match_data()
device_get_match_data() retrieves driver data through the device's
fwnode. However, software nodes don't implement
fwnode->device_get_match_data(), so for a platform device that is
dynamically instantiated, device_get_match_data() is of no use.
platform_get_device_id() can be used instead, but this doesn't make the
driver code abstract enough.
Add the platform_get_match_data() helper, so that driver data can be
retrieved from platform_device's fwnode *or* device_id as a fallback.
or spi_get_device_match_data()
Good idea, I'll do that in v3. I'll wait a few days to let others add comments.
and perhaps have followed the naming in there for the return variable.
Both call it match.
Alright. I think you want me to return NULL instead of -ENODATA as well?
The other helpers do so.