mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/2] iio: afe: rescale: Get driver data using platform_get_match_data()
@ 2026-11-27 23:22 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-27 23:22 ` [PATCH v2 2/2] iio: afe: iio-rescale: Add platform IDs Fabio Forni via B4 Relay
  0 siblings, 2 replies; 3+ messages in thread
From: Fabio Forni via B4 Relay @ 2026-11-27 23:22 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
	Johan Hovold, Peter Rosin, Jonathan Cameron, David Lechner,
	Nuno Sá,
	Andy Shevchenko
  Cc: driver-core, linux-kernel, linux-iio, Fabio Forni

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>



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-27 23:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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-27 23:22 ` [PATCH v2 2/2] iio: afe: iio-rescale: Add platform IDs Fabio Forni via B4 Relay

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®