Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp820934rwl; Wed, 29 Mar 2023 08:54:45 -0700 (PDT) X-Google-Smtp-Source: AKy350aBrLojJlmLrht3OKuWtimgLyKXPjDPx6N3RecbKPqtZMFrvm78kDPGmq/5nJ5hKBaAP7bV X-Received: by 2002:a17:906:408a:b0:933:2dfd:2f50 with SMTP id u10-20020a170906408a00b009332dfd2f50mr2939312ejj.30.1680105284972; Wed, 29 Mar 2023 08:54:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680105284; cv=none; d=google.com; s=arc-20160816; b=igXGzr/neXYW8FpTk3NOI0GQPTBM8TCY9GLK0DWRwWXoQgcXQTikaOY80puXDqIQnC /eYCMvC5vgYXbGN7x0x3DbB57hZPsiGDBcrbP+WaaO4dsgxDKG5T6hth+mRVAeo/uoGe 0PIq2d4b3JYRC9JykJeieADZi6t6wpuYUDr3r09na6t1E8oDRUckEvvDChc8vpi22drD uc5NKDFrN4QXkMhOr3v4cKJnhURPHYpMkK7TnFDSHBVahuRNedb/ylIQmLhvNCFovxfE bcgNDSYONU28FI+NTvieq5rD8Eob57tc8OCf/qawCrGfJUTzlMgUaMR2jrplOKwUT5dy SIfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:content-transfer-encoding:mime-version :message-id:date:subject:from; bh=myNahkzgyzJXsmSpdQrVTovV/3CgUWg7sSEu7RQwjG0=; b=qX2x6Tye4HaURTfFRVi58yNtqS9k1616F+4k+UVZDXD4B4JWaXDGx2GJLlvQjBbo7Z DduI7mdpTKQDZTzrUVJeUcOrQAVQP/BDcD2gnOId9/KBTwU7gv/mEfrydidGKy+VlWPS 9NC2N1IqgA9QT3w7L376k9nHl0ldPwEsKihQ9JywyATCsG9n7M82RORRjeEtOsDgb7LY 7gChhDN2wFVwuIe5dLijHvs9dTILOhcGQP0Iht5TVjPuk8ifWtsfemWk2oBdXtVFzGBO BUSCV/raKlobU0wBsH+nMu6NiieoGNShJGFLBO2gahaeGVOO1v4AP7FOXOVfcfWbNMF2 H8ww== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h8-20020a1709063b4800b0093001429138si27110512ejf.13.2023.03.29.08.54.18; Wed, 29 Mar 2023 08:54:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231234AbjC2Px0 (ORCPT + 99 others); Wed, 29 Mar 2023 11:53:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230451AbjC2Pwy (ORCPT ); Wed, 29 Mar 2023 11:52:54 -0400 Received: from mail-oa1-f45.google.com (mail-oa1-f45.google.com [209.85.160.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2430F4699; Wed, 29 Mar 2023 08:52:48 -0700 (PDT) Received: by mail-oa1-f45.google.com with SMTP id 586e51a60fabf-177ca271cb8so16672938fac.2; Wed, 29 Mar 2023 08:52:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680105167; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=myNahkzgyzJXsmSpdQrVTovV/3CgUWg7sSEu7RQwjG0=; b=ngkOe9Z72mD8HC3/d2+1lk6z5+1V3QH4z5Irmiw976IM9bZPBQplBzSPx7vlr2paUY Clgj2oaSX5WoSz/FJwpGektZCJMLkk8f6m6mfApZl8ZCzVGHkQO+HPE6qcNLhWap3pxw KVRIkh/+fBn/VQDZbHTZjV8exMsuEsUQoSQ7AMQaqlAyKJlE2GSbJ0X9f1zkGZkWLp38 o7ZyJ87yM6sBSTpvbVNoA9Xod9aa7ER/8aRt2r2FREwn0ep2Ad/gn24mkEgrqJ6rqNJv 24y5hhgMPM33ytXJo1uiC4wz/ujfuTYToh6t/sc+HX0C03pxr8RV0uZwDz3rUTY0IBqg wwiQ== X-Gm-Message-State: AAQBX9fiK+xxJYUIlNLZJ3aJ0ZLOqsKxq9STe1oLv4TSHb4uIiMhWKpo Y17BHifALbbc2iEB7vxMGw== X-Received: by 2002:a05:6870:eca0:b0:177:baf4:5b10 with SMTP id eo32-20020a056870eca000b00177baf45b10mr12821109oab.31.1680105167283; Wed, 29 Mar 2023 08:52:47 -0700 (PDT) Received: from robh_at_kernel.org (66-90-144-107.dyn.grandenetworks.net. [66.90.144.107]) by smtp.gmail.com with ESMTPSA id hv12-20020a056870f98c00b00176209a6d6asm11896178oab.10.2023.03.29.08.52.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Mar 2023 08:52:46 -0700 (PDT) Received: (nullmailer pid 3198060 invoked by uid 1000); Wed, 29 Mar 2023 15:52:45 -0000 From: Rob Herring Subject: [PATCH 00/19] DT header disentangling, part 1 Date: Wed, 29 Mar 2023 10:51:57 -0500 Message-Id: <20230329-dt-cpu-header-cleanups-v1-0-581e2605fe47@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAJ1eJGQC/x2NywoCMQwAf2XJ2UBtER+/Ih7SNNpCqaWxi7Dsv xs8zsAwG6iMIgq3ZYMha9HybgbHwwKcqb0ESzIG73xwwV8xfZD7xCyUZCBXoTa7Ip+jpAu7GE4 eLI6kgnFQ42x5m7Wa7EOe5fu/3R/7/gPTb5swfQAAAA== 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@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-riscv@lists.infradead.org, linux-pm@vger.kernel.org, linux-mediatek@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-tegra@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-mips@vger.kernel.org X-Mailer: b4 0.13-dev X-Spam-Status: No, score=0.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 /* 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 --- 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