Commit 39a38bcb authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'devicetree-fixes-for-5.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux

Pull Devicetree fixes from Rob Herring:
 "A couple more DT fixes for 5.4: fix a ref count, memory leak, and
  Risc-V cpu schema warnings"

* tag 'devicetree-fixes-for-5.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
  of: reserved_mem: add missing of_node_put() for proper ref-counting
  of: unittest: fix memory leak in unittest_data_add
  dt-bindings: riscv: Fix CPU schema errors
parents 7f65d354 5dba5175
...@@ -24,15 +24,17 @@ description: | ...@@ -24,15 +24,17 @@ description: |
properties: properties:
compatible: compatible:
items: oneOf:
- enum: - items:
- sifive,rocket0 - enum:
- sifive,e5 - sifive,rocket0
- sifive,e51 - sifive,e5
- sifive,u54-mc - sifive,e51
- sifive,u54 - sifive,u54-mc
- sifive,u5 - sifive,u54
- const: riscv - sifive,u5
- const: riscv
- const: riscv # Simulator only
description: description:
Identifies that the hart uses the RISC-V instruction set Identifies that the hart uses the RISC-V instruction set
and identifies the type of the hart. and identifies the type of the hart.
...@@ -66,12 +68,8 @@ properties: ...@@ -66,12 +68,8 @@ properties:
insensitive, letters in the riscv,isa string must be all insensitive, letters in the riscv,isa string must be all
lowercase to simplify parsing. lowercase to simplify parsing.
timebase-frequency: # RISC-V requires 'timebase-frequency' in /cpus, so disallow it here
type: integer timebase-frequency: false
minimum: 1
description:
Specifies the clock frequency of the system timer in Hz.
This value is common to all harts on a single system image.
interrupt-controller: interrupt-controller:
type: object type: object
...@@ -93,7 +91,6 @@ properties: ...@@ -93,7 +91,6 @@ properties:
required: required:
- riscv,isa - riscv,isa
- timebase-frequency
- interrupt-controller - interrupt-controller
examples: examples:
......
...@@ -324,8 +324,10 @@ int of_reserved_mem_device_init_by_idx(struct device *dev, ...@@ -324,8 +324,10 @@ int of_reserved_mem_device_init_by_idx(struct device *dev,
if (!target) if (!target)
return -ENODEV; return -ENODEV;
if (!of_device_is_available(target)) if (!of_device_is_available(target)) {
of_node_put(target);
return 0; return 0;
}
rmem = __find_rmem(target); rmem = __find_rmem(target);
of_node_put(target); of_node_put(target);
......
...@@ -1207,6 +1207,7 @@ static int __init unittest_data_add(void) ...@@ -1207,6 +1207,7 @@ static int __init unittest_data_add(void)
of_fdt_unflatten_tree(unittest_data, NULL, &unittest_data_node); of_fdt_unflatten_tree(unittest_data, NULL, &unittest_data_node);
if (!unittest_data_node) { if (!unittest_data_node) {
pr_warn("%s: No tree to attach; not running tests\n", __func__); pr_warn("%s: No tree to attach; not running tests\n", __func__);
kfree(unittest_data);
return -ENODATA; return -ENODATA;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment