Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

Pull more DeviceTree fixes vfom Rob Herring:

- revert setting stdout-path as preferred console. This caused
regressions in PowerMACs and other systems.

- yet another fix for stdout-path option parsing.

- fix error path handling in of_irq_parse_one

* tag 'devicetree-fixes-for-4.0-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
Revert "of: Fix premature bootconsole disable with 'stdout-path'"
of: handle both '/' and ':' in path strings
of: unittest: Add option string test case with longer path
of/irq: Fix of_irq_parse_one() returned error codes

+14 -12
+2 -9
drivers/of/base.c
··· 715 715 { 716 716 struct device_node *child; 717 717 int len; 718 - const char *end; 719 718 720 - end = strchr(path, ':'); 721 - if (!end) 722 - end = strchrnul(path, '/'); 723 - 724 - len = end - path; 719 + len = strcspn(path, "/:"); 725 720 if (!len) 726 721 return NULL; 727 722 ··· 1888 1893 name = of_get_property(of_chosen, "linux,stdout-path", NULL); 1889 1894 if (IS_ENABLED(CONFIG_PPC) && !name) 1890 1895 name = of_get_property(of_aliases, "stdout", NULL); 1891 - if (name) { 1896 + if (name) 1892 1897 of_stdout = of_find_node_opts_by_path(name, &of_stdout_options); 1893 - add_preferred_console("stdout-path", 0, NULL); 1894 - } 1895 1898 } 1896 1899 1897 1900 if (!of_aliases)
+7 -3
drivers/of/irq.c
··· 290 290 struct device_node *p; 291 291 const __be32 *intspec, *tmp, *addr; 292 292 u32 intsize, intlen; 293 - int i, res = -EINVAL; 293 + int i, res; 294 294 295 295 pr_debug("of_irq_parse_one: dev=%s, index=%d\n", of_node_full_name(device), index); 296 296 ··· 323 323 324 324 /* Get size of interrupt specifier */ 325 325 tmp = of_get_property(p, "#interrupt-cells", NULL); 326 - if (tmp == NULL) 326 + if (tmp == NULL) { 327 + res = -EINVAL; 327 328 goto out; 329 + } 328 330 intsize = be32_to_cpu(*tmp); 329 331 330 332 pr_debug(" intsize=%d intlen=%d\n", intsize, intlen); 331 333 332 334 /* Check index */ 333 - if ((index + 1) * intsize > intlen) 335 + if ((index + 1) * intsize > intlen) { 336 + res = -EINVAL; 334 337 goto out; 338 + } 335 339 336 340 /* Copy intspec into irq structure */ 337 341 intspec += index * intsize;
+5
drivers/of/unittest.c
··· 97 97 "option path test, subcase #1 failed\n"); 98 98 of_node_put(np); 99 99 100 + np = of_find_node_opts_by_path("/testcase-data/testcase-device1:test/option", &options); 101 + selftest(np && !strcmp("test/option", options), 102 + "option path test, subcase #2 failed\n"); 103 + of_node_put(np); 104 + 100 105 np = of_find_node_opts_by_path("/testcase-data:testoption", NULL); 101 106 selftest(np, "NULL option path test failed\n"); 102 107 of_node_put(np);