From: Fabio Forni <development@redaril.me>
To: Jonathan Cameron <jic23@kernel.org>,
Fabio Forni via B4 Relay
<devnull+development.redaril.me@kernel.org>
Cc: development@redaril.me,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
"Danilo Krummrich" <dakr@kernel.org>,
"Johan Hovold" <johan@kernel.org>,
"Peter Rosin" <peda@lysator.liu.se>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
driver-core@lists.linux.dev, linux-kernel@vger.kernel.org,
linux-iio@vger.kernel.org
Subject: Re: [PATCH v2 1/2] drivers: core: platform: Add platform_get_match_data() helper
Date: Sat, 28 Nov 2026 10:04:48 +0100 [thread overview]
Message-ID: <a08267fa-5a8d-4945-85f9-a9476a476b04@redaril.me> (raw)
In-Reply-To: <20261128002732.7c47a16d@jic23-hlaptop>
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@kernel.org> wrote:
>
>> From: Fabio Forni <development@redaril.me>
>>
>> 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.
> I'd have added a reference to similar cases like i2c_get_match_data()
> 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.
next prev parent reply other threads:[~2026-11-28 9:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 23:22 [PATCH v2 0/2] iio: afe: rescale: Get driver data using platform_get_match_data() Fabio Forni via B4 Relay
2026-11-27 23:22 ` [PATCH v2 1/2] drivers: core: platform: Add platform_get_match_data() helper Fabio Forni via B4 Relay
2026-11-28 0:27 ` Jonathan Cameron
2026-11-28 9:04 ` Fabio Forni [this message]
2026-11-28 18:38 ` Jonathan Cameron
2026-11-27 23:22 ` [PATCH v2 2/2] iio: afe: iio-rescale: Add platform IDs Fabio Forni via B4 Relay
2026-11-28 0:30 ` Jonathan Cameron
2026-11-28 9:21 ` Fabio Forni
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=a08267fa-5a8d-4945-85f9-a9476a476b04@redaril.me \
--to=development@redaril.me \
--cc=andy@kernel.org \
--cc=dakr@kernel.org \
--cc=devnull+development.redaril.me@kernel.org \
--cc=dlechner@baylibre.com \
--cc=driver-core@lists.linux.dev \
--cc=gregkh@linuxfoundation.org \
--cc=jic23@kernel.org \
--cc=johan@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=peda@lysator.liu.se \
--cc=rafael@kernel.org \
/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
all inboxes | Powered by JetHome®