Skip to content

Commit cb6fe2c

Browse files
committed
Merge tag 'devicetree-for-6.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux
Pull more devicetree updates from Rob Herring: - First part of DT header detangling dropping cpu.h from of_device.h and replacing some includes with forward declarations. A handful of drivers needed some adjustment to their includes as a result. - Refactor of_device.h to be used by bus drivers rather than various device drivers. This moves non-bus related functions out of of_device.h. The end goal is for of_platform.h and of_device.h to stop including each other. - Refactor open coded parsing of "ranges" in some bus drivers to use DT address parsing functions - Add some new address parsing functions of_property_read_reg(), of_range_count(), and of_range_to_resource() in preparation to convert more open coded parsing of DT addresses to use them. - Treewide clean-ups to use of_property_read_bool() and of_property_present() as appropriate. The ones here are the ones that didn't get picked up elsewhere. * tag 'devicetree-for-6.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (34 commits) bus: tegra-gmi: Replace of_platform.h with explicit includes hte: Use of_property_present() for testing DT property presence w1: w1-gpio: Use of_property_read_bool() for boolean properties virt: fsl: Use of_property_present() for testing DT property presence soc: fsl: Use of_property_present() for testing DT property presence sbus: display7seg: Use of_property_read_bool() for boolean properties sparc: Use of_property_read_bool() for boolean properties sparc: Use of_property_present() for testing DT property presence bus: mvebu-mbus: Remove open coded "ranges" parsing of/address: Add of_property_read_reg() helper of/address: Add of_range_count() helper of/address: Add support for 3 address cell bus of/address: Add of_range_to_resource() helper of: unittest: Add bus address range parsing tests of: Drop cpu.h include from of_device.h OPP: Adjust includes to remove of_device.h irqchip: loongson-eiointc: Add explicit include for cpuhotplug.h cpuidle: Adjust includes to remove of_device.h cpufreq: sun50i: Add explicit include for cpu.h cpufreq: Adjust includes to remove of_device.h ...
2 parents d42b1c4 + 1c5e917 commit cb6fe2c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+566
-373
lines changed

arch/arm/kernel/cpuidle.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
#include <linux/cpuidle.h>
77
#include <linux/of.h>
8-
#include <linux/of_device.h>
98
#include <asm/cpuidle.h>
109

1110
extern struct of_cpuidle_method __cpuidle_method_of_table[];

arch/arm/mach-sunxi/mc_smp.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include <linux/irqchip/arm-gic.h>
2020
#include <linux/of.h>
2121
#include <linux/of_address.h>
22-
#include <linux/of_device.h>
2322
#include <linux/smp.h>
2423

2524
#include <asm/cacheflush.h>

arch/riscv/kernel/cacheinfo.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
#include <linux/cpu.h>
77
#include <linux/of.h>
8-
#include <linux/of_device.h>
98
#include <asm/cacheinfo.h>
109

1110
static struct riscv_cacheinfo_ops *rv_cache_ops;

arch/riscv/kernel/setup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
* Nick Kossifidis <[email protected]>
99
*/
1010

11+
#include <linux/cpu.h>
1112
#include <linux/init.h>
1213
#include <linux/mm.h>
1314
#include <linux/memblock.h>
1415
#include <linux/sched.h>
1516
#include <linux/console.h>
1617
#include <linux/screen_info.h>
1718
#include <linux/of_fdt.h>
18-
#include <linux/of_platform.h>
1919
#include <linux/sched/task.h>
2020
#include <linux/smp.h>
2121
#include <linux/efi.h>

arch/sparc/include/asm/prom.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,14 @@
1919
#include <linux/mutex.h>
2020
#include <linux/atomic.h>
2121
#include <linux/irqdomain.h>
22+
#include <linux/spinlock.h>
2223

2324
#define of_compat_cmp(s1, s2, l) strncmp((s1), (s2), (l))
2425
#define of_prop_cmp(s1, s2) strcasecmp((s1), (s2))
2526
#define of_node_cmp(s1, s2) strcmp((s1), (s2))
2627

28+
extern raw_spinlock_t devtree_lock;
29+
2730
struct of_irq_controller {
2831
unsigned int (*irq_build)(struct device_node *, unsigned int, void *);
2932
void *data;

arch/sparc/kernel/of_device_32.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ static int of_bus_pci_match(struct device_node *np)
2929
* parent as-is, not with the PCI translate
3030
* method which chops off the top address cell.
3131
*/
32-
if (!of_find_property(np, "ranges", NULL))
32+
if (!of_property_present(np, "ranges"))
3333
return 0;
3434

3535
return 1;
@@ -223,7 +223,7 @@ static int __init build_one_resource(struct device_node *parent,
223223
static int __init use_1to1_mapping(struct device_node *pp)
224224
{
225225
/* If we have a ranges property in the parent, use it. */
226-
if (of_find_property(pp, "ranges", NULL) != NULL)
226+
if (of_property_present(pp, "ranges"))
227227
return 0;
228228

229229
/* Some SBUS devices use intermediate nodes to express

arch/sparc/kernel/of_device_64.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static int of_bus_pci_match(struct device_node *np)
5858
* parent as-is, not with the PCI translate
5959
* method which chops off the top address cell.
6060
*/
61-
if (!of_find_property(np, "ranges", NULL))
61+
if (!of_property_present(np, "ranges"))
6262
return 0;
6363

6464
return 1;
@@ -78,7 +78,7 @@ static int of_bus_simba_match(struct device_node *np)
7878
* simba.
7979
*/
8080
if (of_node_name_eq(np, "pci")) {
81-
if (!of_find_property(np, "ranges", NULL))
81+
if (!of_property_present(np, "ranges"))
8282
return 1;
8383
}
8484

@@ -283,7 +283,7 @@ static int __init build_one_resource(struct device_node *parent,
283283
static int __init use_1to1_mapping(struct device_node *pp)
284284
{
285285
/* If we have a ranges property in the parent, use it. */
286-
if (of_find_property(pp, "ranges", NULL) != NULL)
286+
if (of_property_present(pp, "ranges"))
287287
return 0;
288288

289289
/* If the parent is the dma node of an ISA bus, pass

arch/sparc/kernel/of_device_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ int of_bus_sbus_match(struct device_node *np)
162162
* don't have some intervening real bus that provides
163163
* ranges based translations.
164164
*/
165-
if (of_find_property(dp, "ranges", NULL) != NULL)
165+
if (of_property_present(dp, "ranges"))
166166
break;
167167

168168
dp = dp->parent;

arch/sparc/kernel/pci_schizo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1270,7 +1270,7 @@ static void schizo_pbm_hw_init(struct pci_pbm_info *pbm)
12701270
pbm->chip_version >= 0x2)
12711271
tmp |= 0x3UL << SCHIZO_PCICTRL_PTO_SHIFT;
12721272

1273-
if (!of_find_property(pbm->op->dev.of_node, "no-bus-parking", NULL))
1273+
if (!of_property_read_bool(pbm->op->dev.of_node, "no-bus-parking"))
12741274
tmp |= SCHIZO_PCICTRL_PARK;
12751275
else
12761276
tmp &= ~SCHIZO_PCICTRL_PARK;

arch/sparc/kernel/power.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ static int has_button_interrupt(unsigned int irq, struct device_node *dp)
2828
{
2929
if (irq == 0xffffffff)
3030
return 0;
31-
if (!of_find_property(dp, "button", NULL))
31+
if (!of_property_read_bool(dp, "button"))
3232
return 0;
3333

3434
return 1;

0 commit comments

Comments
 (0)