devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/13] of: Add wrappers to match root node with OF device ID tables
@ 2025-11-06 19:07 Krzysztof Kozlowski
  2025-11-06 19:07 ` [PATCH 01/13] " Krzysztof Kozlowski
                   ` (13 more replies)
  0 siblings, 14 replies; 36+ messages in thread
From: Krzysztof Kozlowski @ 2025-11-06 19:07 UTC (permalink / raw)
  To: Rob Herring, Saravana Kannan, Rafael J. Wysocki, Viresh Kumar,
	Matthias Brugger, AngeloGioacchino Del Regno, Yangtao Li,
	Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Lorenzo Pieralisi,
	Daniel Lezcano, Bjorn Andersson, Konrad Dybcio, Thomas Gleixner,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Maximilian Luz,
	Hans de Goede, Ilpo Järvinen, Daniel Lezcano, Thierry Reding,
	Jonathan Hunter
  Cc: devicetree, linux-kernel, linux-pm, linux-arm-kernel,
	linux-mediatek, linux-sunxi, linux-arm-msm, platform-driver-x86,
	linux-tegra, Krzysztof Kozlowski

Dependency/merging
==================
All patches depend on the first patch, thus everything could go via
Rob's tree with people's acks.

Description
===========
Several drivers duplicate same code for getting reference to the root
node, matching it against 'struct of_device_id' table and getting out
the match data from the table entry.

There is a of_machine_compatible_match() wrapper but it takes array of
strings, which is not suitable for many drivers since they want the
driver data associated with each compatible.

Add two wrappers, similar to existing of_device_get_match_data():
1. of_machine_device_match() doing only matching against 'struct
   of_device_id' and returning bool.
2. of_machine_get_match_data() doing the matching and returning
   associated driver data for found compatible.

Best regards,
Krzysztof

---
Krzysztof Kozlowski (13):
      of: Add wrappers to match root node with OF device ID tables
      cpufreq: dt-platdev: Simplify with of_machine_get_match_data()
      cpufreq: mediatek: Simplify with of_machine_get_match_data()
      cpufreq: sun50i: Simplify with of_machine_device_match()
      cpufreq: ti: Simplify with of_machine_device_match()
      cpuidle: big_little: Simplify with of_machine_device_match()
      firmware: qcom: scm: Simplify with of_machine_device_match()
      irqchip/atmel-aic: Simplify with of_machine_get_match_data()
      platform: surface: Simplify with of_machine_get_match_data()
      powercap: dtpm: Simplify with of_machine_get_match_data()
      soc: qcom: Simplify with of_machine_get_match_data()
      soc: qcom: ubwc: Simplify with of_machine_get_match_data()
      soc: tegra: Simplify with of_machine_device_match()

 drivers/cpufreq/cpufreq-dt-platdev.c               | 15 ++-----
 drivers/cpufreq/mediatek-cpufreq.c                 | 12 +-----
 drivers/cpufreq/sun50i-cpufreq-nvmem.c             | 11 +----
 drivers/cpufreq/ti-cpufreq.c                       | 13 +-----
 drivers/cpuidle/cpuidle-big_little.c               | 11 +----
 drivers/firmware/qcom/qcom_scm.c                   | 17 +-------
 drivers/irqchip/irq-atmel-aic-common.c             | 15 ++-----
 drivers/of/base.c                                  | 47 ++++++++++++++++++++++
 .../platform/surface/surface_aggregator_registry.c | 13 +-----
 drivers/powercap/dtpm.c                            | 16 +-------
 drivers/soc/qcom/qcom_pd_mapper.c                  | 17 +-------
 drivers/soc/qcom/ubwc_config.c                     | 14 ++-----
 drivers/soc/tegra/common.c                         | 12 +-----
 include/linux/of.h                                 | 13 ++++++
 14 files changed, 82 insertions(+), 144 deletions(-)
---
base-commit: e5efebeef746a24f45b98dbdfcf334285848b32a
change-id: 20251106-b4-of-match-matchine-data-4a64bf046814

Best regards,
-- 
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>


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

end of thread, other threads:[~2025-11-11 21:14 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-06 19:07 [PATCH 00/13] of: Add wrappers to match root node with OF device ID tables Krzysztof Kozlowski
2025-11-06 19:07 ` [PATCH 01/13] " Krzysztof Kozlowski
2025-11-06 19:53   ` Frank Li
2025-11-07  7:00     ` Krzysztof Kozlowski
2025-11-07 17:11       ` Frank Li
2025-11-06 19:07 ` [PATCH 02/13] cpufreq: dt-platdev: Simplify with of_machine_get_match_data() Krzysztof Kozlowski
2025-11-10 11:07   ` Viresh Kumar
2025-11-06 19:07 ` [PATCH 03/13] cpufreq: mediatek: " Krzysztof Kozlowski
2025-11-10 11:07   ` Viresh Kumar
2025-11-06 19:07 ` [PATCH 04/13] cpufreq: sun50i: Simplify with of_machine_device_match() Krzysztof Kozlowski
2025-11-07 13:12   ` Chen-Yu Tsai
2025-11-10 11:07   ` Viresh Kumar
2025-11-06 19:07 ` [PATCH 05/13] cpufreq: ti: " Krzysztof Kozlowski
2025-11-08 14:38   ` Krzysztof Kozlowski
2025-11-06 19:07 ` [PATCH 06/13] cpuidle: big_little: " Krzysztof Kozlowski
2025-11-06 19:07 ` [PATCH 07/13] firmware: qcom: scm: " Krzysztof Kozlowski
2025-11-07  8:45   ` Konrad Dybcio
2025-11-06 19:07 ` [PATCH 08/13] irqchip/atmel-aic: Simplify with of_machine_get_match_data() Krzysztof Kozlowski
2025-11-10 14:10   ` Nicolas Ferre
2025-11-11 21:14   ` Thomas Gleixner
2025-11-06 19:07 ` [PATCH 09/13] platform: surface: " Krzysztof Kozlowski
2025-11-10 11:49   ` Ilpo Järvinen
2025-11-06 19:07 ` [PATCH 10/13] powercap: dtpm: " Krzysztof Kozlowski
2025-11-06 19:07 ` [PATCH 11/13] soc: qcom: " Krzysztof Kozlowski
2025-11-07  3:19   ` Dmitry Baryshkov
2025-11-07  7:02     ` Krzysztof Kozlowski
2025-11-07  7:08       ` Krzysztof Kozlowski
2025-11-07 14:23         ` Dmitry Baryshkov
2025-11-07 14:58           ` Krzysztof Kozlowski
2025-11-08 16:31             ` Dmitry Baryshkov
2025-11-09 19:06               ` Krzysztof Kozlowski
2025-11-06 19:07 ` [PATCH 12/13] soc: qcom: ubwc: " Krzysztof Kozlowski
2025-11-07  3:19   ` Dmitry Baryshkov
2025-11-06 19:07 ` [PATCH 13/13] soc: tegra: Simplify with of_machine_device_match() Krzysztof Kozlowski
2025-11-07 10:41   ` Jon Hunter
2025-11-07  9:12 ` [PATCH 00/13] of: Add wrappers to match root node with OF device ID tables AngeloGioacchino Del Regno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).