mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Fabio Forni via B4 Relay <devnull+development.redaril.me@kernel.org>
To: "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>,
	"Jonathan Cameron" <jic23@kernel.org>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>
Cc: driver-core@lists.linux.dev, linux-kernel@vger.kernel.org,
	 linux-iio@vger.kernel.org, Fabio Forni <development@redaril.me>
Subject: [PATCH v2 0/2] iio: afe: rescale: Get driver data using platform_get_match_data()
Date: Sat, 28 Nov 2026 00:22:08 +0100	[thread overview]
Message-ID: <20261128-iio_rescale_platform_ids-v2-0-4c35f16c4f77@redaril.me> (raw)

Add a new helper to get data when drivers are bound using platform_device
plus swnodes, that typically happpens when such drivers are dynamically
instantiated.

As swnodes do not implement device_get_match_data(), a fallback mechanism
is needed to access driver_data inside platform_device_id structs. While
drivers can have such logic locally, Andy Shevchenko suggested to add a
global helper for this situation. See discussion in v1. 

v1 was about adding the logic above in iio-rescale: the same goal applies
to this revision. iio-rescale is modified to call the new
platform_get_match_data() helper.

Signed-off-by: Fabio Forni <development@redaril.me>
---
Changes in v2:
- Add platform_get_match_data()
- Use platform_get_match_data() in iio-rescale
- Use imperative mood throughout commits and cover letter
- Link to v1: https://lore.kernel.org/r/20261008-iio_rescale_platform_ids-v1-1-019f1c144022@redaril.me

---
Fabio Forni (2):
      drivers: core: platform: Add platform_get_match_data() helper
      iio: afe: iio-rescale: Add platform IDs

 drivers/base/platform.c         | 28 ++++++++++++++++++++++++++++
 drivers/iio/afe/iio-rescale.c   | 18 +++++++++++++++++-
 include/linux/platform_device.h |  2 ++
 3 files changed, 47 insertions(+), 1 deletion(-)
---
base-commit: 4dce97c6c265544342e716e62fd24bbb232590c5
change-id: 20261008-iio_rescale_platform_ids-0d2a7dac974a

Best regards,
-- 
Fabio Forni <development@redaril.me>



             reply	other threads:[~2026-11-27 23:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27 23:22 Fabio Forni via B4 Relay [this message]
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-27 23:22 ` [PATCH v2 2/2] iio: afe: iio-rescale: Add platform IDs Fabio Forni via B4 Relay

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=20261128-iio_rescale_platform_ids-v2-0-4c35f16c4f77@redaril.me \
    --to=devnull+development.redaril.me@kernel.org \
    --cc=andy@kernel.org \
    --cc=dakr@kernel.org \
    --cc=development@redaril.me \
    --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®