Skip to content

Commit 0983f6b

Browse files
committed
Merge tag 'devicetree-fixes-for-6.2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux
Pull devicetree fixes from Rob Herring: - Fix handling of multiple OF framebuffer devices - Fix booting on Socionext Synquacer with bad 'dma-ranges' entries - Add DT binding .yamllint to .gitignore * tag 'devicetree-fixes-for-6.2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: dt-bindings: interrupt-controller: arm,gic-v3: Fix typo in description of msi-controller property dt-bindings: Fix .gitignore of/address: Return an error when no valid dma-ranges are found of: Make OF framebuffer device names unique
2 parents 513c1a3 + 707344c commit 0983f6b

File tree

4 files changed

+31
-9
lines changed

4 files changed

+31
-9
lines changed

Documentation/devicetree/bindings/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,8 @@
22
*.example.dts
33
/processed-schema*.yaml
44
/processed-schema*.json
5+
6+
#
7+
# We don't want to ignore the following even if they are dot-files
8+
#
9+
!.yamllint

Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ properties:
108108

109109
msi-controller:
110110
description:
111-
Only present if the Message Based Interrupt functionnality is
111+
Only present if the Message Based Interrupt functionality is
112112
being exposed by the HW, and the mbi-ranges property present.
113113

114114
mbi-ranges:

drivers/of/address.c

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -965,8 +965,19 @@ int of_dma_get_range(struct device_node *np, const struct bus_dma_region **map)
965965
}
966966

967967
of_dma_range_parser_init(&parser, node);
968-
for_each_of_range(&parser, &range)
968+
for_each_of_range(&parser, &range) {
969+
if (range.cpu_addr == OF_BAD_ADDR) {
970+
pr_err("translation of DMA address(%llx) to CPU address failed node(%pOF)\n",
971+
range.bus_addr, node);
972+
continue;
973+
}
969974
num_ranges++;
975+
}
976+
977+
if (!num_ranges) {
978+
ret = -EINVAL;
979+
goto out;
980+
}
970981

971982
r = kcalloc(num_ranges + 1, sizeof(*r), GFP_KERNEL);
972983
if (!r) {
@@ -975,18 +986,16 @@ int of_dma_get_range(struct device_node *np, const struct bus_dma_region **map)
975986
}
976987

977988
/*
978-
* Record all info in the generic DMA ranges array for struct device.
989+
* Record all info in the generic DMA ranges array for struct device,
990+
* returning an error if we don't find any parsable ranges.
979991
*/
980992
*map = r;
981993
of_dma_range_parser_init(&parser, node);
982994
for_each_of_range(&parser, &range) {
983995
pr_debug("dma_addr(%llx) cpu_addr(%llx) size(%llx)\n",
984996
range.bus_addr, range.cpu_addr, range.size);
985-
if (range.cpu_addr == OF_BAD_ADDR) {
986-
pr_err("translation of DMA address(%llx) to CPU address failed node(%pOF)\n",
987-
range.bus_addr, node);
997+
if (range.cpu_addr == OF_BAD_ADDR)
988998
continue;
989-
}
990999
r->cpu_start = range.cpu_addr;
9911000
r->dma_start = range.bus_addr;
9921001
r->size = range.size;

drivers/of/platform.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,7 @@ static int __init of_platform_default_populate_init(void)
525525
if (IS_ENABLED(CONFIG_PPC)) {
526526
struct device_node *boot_display = NULL;
527527
struct platform_device *dev;
528+
int display_number = 0;
528529
int ret;
529530

530531
/* Check if we have a MacOS display without a node spec */
@@ -555,16 +556,23 @@ static int __init of_platform_default_populate_init(void)
555556
if (!of_get_property(node, "linux,opened", NULL) ||
556557
!of_get_property(node, "linux,boot-display", NULL))
557558
continue;
558-
dev = of_platform_device_create(node, "of-display", NULL);
559+
dev = of_platform_device_create(node, "of-display.0", NULL);
560+
of_node_put(node);
559561
if (WARN_ON(!dev))
560562
return -ENOMEM;
561563
boot_display = node;
564+
display_number++;
562565
break;
563566
}
564567
for_each_node_by_type(node, "display") {
568+
char buf[14];
569+
const char *of_display_format = "of-display.%d";
570+
565571
if (!of_get_property(node, "linux,opened", NULL) || node == boot_display)
566572
continue;
567-
of_platform_device_create(node, "of-display", NULL);
573+
ret = snprintf(buf, sizeof(buf), of_display_format, display_number++);
574+
if (ret < sizeof(buf))
575+
of_platform_device_create(node, buf, NULL);
568576
}
569577

570578
} else {

0 commit comments

Comments
 (0)