Skip to content

Commit

Permalink
Merge tag 'devicetree-fixes-for-5.4-2' of git://git.kernel.org/pub/sc…
Browse files Browse the repository at this point in the history
…m/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
  • Loading branch information
torvalds committed Oct 24, 2019
2 parents 7f65d35 + 5dba517 commit 39a38bc
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
29 changes: 13 additions & 16 deletions Documentation/devicetree/bindings/riscv/cpus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,17 @@ description: |
properties:
compatible:
items:
- enum:
- sifive,rocket0
- sifive,e5
- sifive,e51
- sifive,u54-mc
- sifive,u54
- sifive,u5
- const: riscv
oneOf:
- items:
- enum:
- sifive,rocket0
- sifive,e5
- sifive,e51
- sifive,u54-mc
- sifive,u54
- sifive,u5
- const: riscv
- const: riscv # Simulator only
description:
Identifies that the hart uses the RISC-V instruction set
and identifies the type of the hart.
Expand Down Expand Up @@ -66,12 +68,8 @@ properties:
insensitive, letters in the riscv,isa string must be all
lowercase to simplify parsing.

timebase-frequency:
type: integer
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.
# RISC-V requires 'timebase-frequency' in /cpus, so disallow it here
timebase-frequency: false

interrupt-controller:
type: object
Expand All @@ -93,7 +91,6 @@ properties:

required:
- riscv,isa
- timebase-frequency
- interrupt-controller

examples:
Expand Down
4 changes: 3 additions & 1 deletion drivers/of/of_reserved_mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,10 @@ int of_reserved_mem_device_init_by_idx(struct device *dev,
if (!target)
return -ENODEV;

if (!of_device_is_available(target))
if (!of_device_is_available(target)) {
of_node_put(target);
return 0;
}

rmem = __find_rmem(target);
of_node_put(target);
Expand Down
1 change: 1 addition & 0 deletions drivers/of/unittest.c
Original file line number Diff line number Diff line change
Expand Up @@ -1207,6 +1207,7 @@ static int __init unittest_data_add(void)
of_fdt_unflatten_tree(unittest_data, NULL, &unittest_data_node);
if (!unittest_data_node) {
pr_warn("%s: No tree to attach; not running tests\n", __func__);
kfree(unittest_data);
return -ENODATA;
}

Expand Down

0 comments on commit 39a38bc

Please sign in to comment.