All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/19] DT header disentangling, part 1
@ 2023-03-29 15:51 ` Rob Herring
  0 siblings, 0 replies; 112+ messages in thread
From: Rob Herring @ 2023-03-29 15:51 UTC (permalink / raw)
  To: David S. Miller, Rob Herring, Frank Rowand, Russell King,
	Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Greg Kroah-Hartman, Rafael J. Wysocki,
	Daniel Lezcano, Thomas Gleixner, Amit Daniel Kachhap,
	Viresh Kumar, Lukasz Luba, Amit Kucheria, Zhang Rui,
	Matthias Brugger, AngeloGioacchino Del Regno, Michael Ellerman,
	Nicholas Piggin, Christophe Leroy, Thierry Reding,
	Jonathan Hunter, Yangtao Li, Lorenzo Pieralisi, Sudeep Holla,
	Andy Gross, Bjorn Andersson, Konrad Dybcio, Anup Patel,
	Huacai Chen, Jiaxun Yang, Marc Zyngier, Viresh Kumar,
	Nishanth Menon, Stephen Boyd
  Cc: sparclinux, linux-kernel, devicetree, linux-arm-kernel,
	linux-sunxi, linux-riscv, linux-pm, linux-mediatek, linuxppc-dev,
	linux-tegra, linux-arm-msm, linux-mips

This is the first of a series of clean-ups to disentangle the DT 
includes. There's a decade plus old comment in of_device.h:

 #include <linux/of_platform.h> /* temporary until merge */

Who's this Grant person that wrote this? ;)

It gets better. of_device.h also pulls in of.h, and of_platform.h 
includes of_device.h. So naturally, drivers include all combinations of 
those 3 headers and sometimes they actually need them. 

I started on fixing this years ago, but just dropping the circular 
includes and fixing all the fallout was massive and didn't sit well. 
Pulling in of_device.h in all the drivers that happen to call only
of_device_get_match_data/of_match_device didn't seem great when the rest 
of of_device.h would never be needed. of_device.h being everything that 
works on a struct device is not a great split because several types of 
users deal with struct device. The better split seems to be by user 
(subsys driver vs. consumer) which several subsystems now do. For 
of_device.h, the users can primarily be split between bus 
implementations and device drivers. Device drivers also typically need 
of.h to read properties. So let's move of_device.h towards just bus 
related functions and move device driver related functions to of.h.

This series is just the first step. It makes a couple of clean-ups to 
replace some includes with forward declarations. It moves 
of_device_get_match_data() and of_cpu_device_node_get() to of.h. The 
former move is transparent for now and preparation for the next series.
The last part of the series updates drivers using 
of_cpu_device_node_get() and/or relying on the implicit cpu.h include 
which is removed in the last patch.

Signed-off-by: Rob Herring <robh@kernel.org>
---
Rob Herring (19):
      of: Make devtree_lock declaration private
      of: Move of_device_(add|register|unregister) to of_platform.h
      of: Move of_device_get_match_data() declaration
      of: Move CPU node related functions to their own file
      of: Drop unnecessary includes in headers
      ARM: sunxi: Drop of_device.h include
      ARM: cpuidle: Drop of_device.h include
      riscv: Add explicit include for cpu.h
      riscv: cacheinfo: Adjust includes to remove of_device.h
      cacheinfo: Adjust includes to remove of_device.h
      clocksource: ingenic: Add explicit include for cpuhotplug.h
      thermal: cpuidle_cooling: Adjust includes to remove of_device.h
      soc: mediatek: mtk-svs: Add explicit include for cpu.h
      cpufreq: Adjust includes to remove of_device.h
      cpufreq: sun50i: Add explicit include for cpu.h
      cpuidle: Adjust includes to remove of_device.h
      irqchip: loongson-eiointc: Add explicit include for cpuhotplug.h
      OPP: Adjust includes to remove of_device.h
      of: Drop cpu.h include from of_device.h

 arch/arm/kernel/cpuidle.c              |   1 -
 arch/arm/mach-sunxi/mc_smp.c           |   1 -
 arch/riscv/kernel/cacheinfo.c          |   1 -
 arch/riscv/kernel/setup.c              |   2 +-
 arch/sparc/include/asm/prom.h          |   3 +
 drivers/base/cacheinfo.c               |   2 +-
 drivers/clocksource/ingenic-timer.c    |   3 +-
 drivers/cpufreq/cpufreq-dt-platdev.c   |   1 -
 drivers/cpufreq/kirkwood-cpufreq.c     |   2 +-
 drivers/cpufreq/maple-cpufreq.c        |   2 +-
 drivers/cpufreq/pmac32-cpufreq.c       |   2 +-
 drivers/cpufreq/pmac64-cpufreq.c       |   2 +-
 drivers/cpufreq/qcom-cpufreq-hw.c      |   4 +-
 drivers/cpufreq/spear-cpufreq.c        |   2 +-
 drivers/cpufreq/sun50i-cpufreq-nvmem.c |   3 +-
 drivers/cpufreq/tegra124-cpufreq.c     |   1 -
 drivers/cpufreq/tegra20-cpufreq.c      |   2 +-
 drivers/cpuidle/cpuidle-psci.c         |   1 -
 drivers/cpuidle/cpuidle-qcom-spm.c     |   3 +-
 drivers/cpuidle/cpuidle-riscv-sbi.c    |   2 +-
 drivers/cpuidle/dt_idle_states.c       |   1 -
 drivers/irqchip/irq-loongson-eiointc.c |   5 +-
 drivers/of/Makefile                    |   2 +-
 drivers/of/base.c                      | 187 -----------------------------
 drivers/of/cpu.c                       | 210 +++++++++++++++++++++++++++++++++
 drivers/of/of_private.h                |   1 +
 drivers/opp/of.c                       |   2 +-
 drivers/soc/mediatek/mtk-svs.c         |   1 +
 drivers/thermal/cpuidle_cooling.c      |   3 +-
 include/linux/cpufreq.h                |   1 -
 include/linux/of.h                     |  28 +++--
 include/linux/of_device.h              |  24 +---
 include/linux/of_platform.h            |  10 +-
 33 files changed, 261 insertions(+), 254 deletions(-)
---
base-commit: fe15c26ee26efa11741a7b632e9f23b01aca4cc6
change-id: 20230329-dt-cpu-header-cleanups-c7bed8c0b352

Best regards,
-- 
Rob Herring <robh@kernel.org>


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

end of thread, other threads:[~2023-04-29 18:26 UTC | newest]

Thread overview: 112+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-29 15:51 [PATCH 00/19] DT header disentangling, part 1 Rob Herring
2023-03-29 15:51 ` Rob Herring
2023-03-29 15:51 ` Rob Herring
2023-03-29 15:51 ` [PATCH 01/19] of: Make devtree_lock declaration private Rob Herring
2023-03-29 15:51   ` Rob Herring
2023-03-29 15:51   ` Rob Herring
2023-03-29 15:51 ` [PATCH 02/19] of: Move of_device_(add|register|unregister) to of_platform.h Rob Herring
2023-03-29 15:51   ` Rob Herring
2023-03-29 15:51   ` Rob Herring
2023-03-29 15:52 ` [PATCH 03/19] of: Move of_device_get_match_data() declaration Rob Herring
2023-03-29 15:52   ` Rob Herring
2023-03-29 15:52   ` Rob Herring
2023-03-29 15:52 ` [PATCH 04/19] of: Move CPU node related functions to their own file Rob Herring
2023-03-29 15:52   ` Rob Herring
2023-03-29 15:52   ` Rob Herring
2023-03-29 18:14   ` Sudeep Holla
2023-03-29 18:14     ` Sudeep Holla
2023-03-29 18:14     ` Sudeep Holla
2023-03-29 15:52 ` [PATCH 05/19] of: Drop unnecessary includes in headers Rob Herring
2023-03-29 15:52   ` Rob Herring
2023-03-29 15:52   ` Rob Herring
2023-03-29 15:52 ` [PATCH 06/19] ARM: sunxi: Drop of_device.h include Rob Herring
2023-03-29 15:52   ` Rob Herring
2023-03-29 15:52   ` Rob Herring
2023-03-29 15:56   ` Chen-Yu Tsai
2023-03-29 15:56     ` Chen-Yu Tsai
2023-03-29 15:56     ` Chen-Yu Tsai
2023-03-29 15:52 ` [PATCH 07/19] ARM: cpuidle: " Rob Herring
2023-03-29 15:52   ` Rob Herring
2023-03-29 15:52   ` Rob Herring
2023-03-29 15:52 ` [PATCH 08/19] riscv: Add explicit include for cpu.h Rob Herring
2023-03-29 15:52   ` Rob Herring
2023-03-29 15:52   ` Rob Herring
2023-04-29 18:24   ` Palmer Dabbelt
2023-04-29 18:24     ` Palmer Dabbelt
2023-04-29 18:24     ` Palmer Dabbelt
2023-03-29 15:52 ` [PATCH 09/19] riscv: cacheinfo: Adjust includes to remove of_device.h Rob Herring
2023-03-29 15:52   ` Rob Herring
2023-03-29 15:52   ` Rob Herring
2023-04-29 18:24   ` Palmer Dabbelt
2023-04-29 18:24     ` Palmer Dabbelt
2023-04-29 18:24     ` Palmer Dabbelt
2023-03-29 15:52 ` [PATCH 10/19] " Rob Herring
2023-03-29 15:52   ` Rob Herring
2023-03-29 15:52   ` Rob Herring
2023-03-29 16:22   ` Greg Kroah-Hartman
2023-03-29 16:22     ` Greg Kroah-Hartman
2023-03-29 16:22     ` Greg Kroah-Hartman
2023-03-29 18:15   ` Sudeep Holla
2023-03-29 18:15     ` Sudeep Holla
2023-03-29 18:15     ` Sudeep Holla
2023-03-29 15:52 ` [PATCH 11/19] clocksource: ingenic: Add explicit include for cpuhotplug.h Rob Herring
2023-03-29 15:52   ` Rob Herring
2023-03-29 15:52   ` Rob Herring
2023-04-01 19:22   ` Daniel Lezcano
2023-04-01 19:22     ` Daniel Lezcano
2023-04-01 19:22     ` Daniel Lezcano
2023-03-29 15:52 ` [PATCH 12/19] thermal: cpuidle_cooling: Adjust includes to remove of_device.h Rob Herring
2023-03-29 15:52   ` Rob Herring
2023-03-29 15:52   ` Rob Herring
2023-03-29 15:59   ` Rafael J. Wysocki
2023-03-29 15:59     ` Rafael J. Wysocki
2023-03-29 15:59     ` Rafael J. Wysocki
2023-04-01 19:22   ` Daniel Lezcano
2023-04-01 19:22     ` Daniel Lezcano
2023-04-01 19:22     ` Daniel Lezcano
2023-03-29 15:52 ` [PATCH 13/19] soc: mediatek: mtk-svs: Add explicit include for cpu.h Rob Herring
2023-03-29 15:52   ` Rob Herring
2023-03-29 15:52   ` Rob Herring
2023-03-29 15:52 ` [PATCH 14/19] cpufreq: Adjust includes to remove of_device.h Rob Herring
2023-03-29 15:52   ` Rob Herring
2023-03-29 15:52   ` Rob Herring
2023-03-29 15:57   ` Rafael J. Wysocki
2023-03-29 15:57     ` Rafael J. Wysocki
2023-03-29 15:57     ` Rafael J. Wysocki
2023-03-29 20:51   ` kernel test robot
2023-03-30  3:54   ` Viresh Kumar
2023-03-30  3:54     ` Viresh Kumar
2023-03-30  3:54     ` Viresh Kumar
2023-03-29 15:52 ` [PATCH 15/19] cpufreq: sun50i: Add explicit include for cpu.h Rob Herring
2023-03-29 15:52   ` Rob Herring
2023-03-29 15:52   ` Rob Herring
2023-03-29 16:05   ` Jernej Škrabec
2023-03-29 16:05     ` Jernej Škrabec
2023-03-29 16:05     ` Jernej Škrabec
2023-03-30  3:54   ` Viresh Kumar
2023-03-30  3:54     ` Viresh Kumar
2023-03-30  3:54     ` Viresh Kumar
2023-03-29 15:52 ` [PATCH 16/19] cpuidle: Adjust includes to remove of_device.h Rob Herring
2023-03-29 15:52   ` Rob Herring
2023-03-29 15:52   ` Rob Herring
2023-03-29 15:57   ` Rafael J. Wysocki
2023-03-29 15:57     ` Rafael J. Wysocki
2023-03-29 15:57     ` Rafael J. Wysocki
2023-03-29 18:17   ` Sudeep Holla
2023-03-29 18:17     ` Sudeep Holla
2023-03-29 18:17     ` Sudeep Holla
2023-03-30  4:02   ` Anup Patel
2023-03-30  4:02     ` Anup Patel
2023-03-30  4:02     ` Anup Patel
2023-03-29 15:52 ` [PATCH 17/19] irqchip: loongson-eiointc: Add explicit include for cpuhotplug.h Rob Herring
2023-03-29 15:52   ` Rob Herring
2023-03-29 15:52   ` Rob Herring
2023-03-29 15:52 ` [PATCH 18/19] OPP: Adjust includes to remove of_device.h Rob Herring
2023-03-29 15:52   ` Rob Herring
2023-03-29 15:52   ` Rob Herring
2023-03-30  3:54   ` Viresh Kumar
2023-03-30  3:54     ` Viresh Kumar
2023-03-30  3:54     ` Viresh Kumar
2023-03-29 15:52 ` [PATCH 19/19] of: Drop cpu.h include from of_device.h Rob Herring
2023-03-29 15:52   ` Rob Herring
2023-03-29 15:52   ` Rob Herring

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.