This reverts commit 2d4c2259930b91fe5e7a2f92db32c03fe640ed60.

This patch is part of a series which has never been reviewed and
has not been generally accepted by the community.

Signed-off-by: Wolfgang Denk <w...@denx.de>

Cc: Albert Aribaud <albert.u.b...@aribaud.net>
Cc: Alexander Graf <ag...@suse.de>
Cc: Alexey Brodkin <alexey.brod...@synopsys.com>
Cc: Anatolij Gustschin <ag...@denx.de>
Cc: Andre Przywara <andre.przyw...@arm.com>,
Cc: Andreas Bießmann <andreas.de...@googlemail.com>
Cc: Angelo Dureghello <ang...@sysam.it>
Cc: Bin Meng <bmeng...@gmail.com>
Cc: Daniel Hellstrom <dan...@gaisler.com>
Cc: Daniel Schwierzeck <daniel.schwierz...@googlemail.com>
Cc: Heiko Schocher <h...@denx.de>
Cc: Heinrich Schuchardt <xypron.deb...@gmx.de>
Cc: Huan Wang <alison.w...@freescale.com>
Cc: Jagan Teki <jt...@openedev.com>
Cc: Joe Hershberger <joe.hershber...@ni.com>
Cc: Kim Phillips <kim.phill...@freescale.com>
Cc: Kyungmin Park <kmp...@infradead.org>
Cc: Lukasz Majewski <lu...@denx.de>
Cc: Macpaul Lin <macp...@andestech.com>
Cc: Marek Vasut <marek.va...@gmail.com>
Cc: Marek Vasut <ma...@denx.de>
Cc: Masahiro Yamada <yamada.masah...@socionext.com>
Cc: Michal Simek <mon...@monstr.eu>
Cc: Minkyu Kang <mk7.k...@samsung.com>
Cc: Nobuhiro Iwamatsu <iwama...@nigauri.org>
Cc: Pantelis Antoniou <pa...@antoniou-consulting.com>
Cc: Prafulla Wadaskar <prafu...@marvell.com>
Cc: Przemyslaw Marczak <p.marc...@samsung.com>
Cc: Robert Nelson <robertcnel...@gmail.com>
Cc: Scott Wood  <scottw...@freescale.com>
Cc: Simon Glass <s...@chromium.org>
Cc: Sonic Zhang <sonic....@gmail.com>
Cc: Stanislav Galabov <sgala...@gmail.com>
Cc: Stefan Roese <s...@denx.de>
Cc: Stefano Babic <sba...@denx.de>
Cc: Stephen Warren <swar...@wwwdotorg.org>
Cc: Thomas Chou <tho...@wytron.com.tw>
Cc: Tom Rini <tr...@konsulko.com>
Cc: Tom Warren <twar...@nvidia.com>
Cc: u-boot@lists.denx.de
Cc: Vagrant Cascadian <vagr...@debian.org>
Cc: Vipin Kumar <vk.vi...@gmail.com>
Cc: York Sun <york...@freescale.com>
---
 scripts/dtc/checks.c                | 231 ------------------------------------
 scripts/dtc/dtc.c                   |   2 +-
 scripts/dtc/dtc.h                   |   6 -
 scripts/dtc/libfdt/fdt_empty_tree.c |   1 +
 scripts/dtc/libfdt/fdt_ro.c         |   4 +-
 scripts/dtc/libfdt/fdt_rw.c         |  24 +---
 scripts/dtc/libfdt/fdt_sw.c         |  16 +--
 scripts/dtc/libfdt/fdt_wip.c        |   4 +-
 scripts/dtc/libfdt/libfdt.h         |  68 +----------
 scripts/dtc/livetree.c              |   3 +-
 scripts/dtc/version_gen.h           |   2 +-
 11 files changed, 16 insertions(+), 345 deletions(-)

diff --git a/scripts/dtc/checks.c b/scripts/dtc/checks.c
index afabf64337..38f548e582 100644
--- a/scripts/dtc/checks.c
+++ b/scripts/dtc/checks.c
@@ -681,229 +681,6 @@ static void check_ranges_format(struct check *c, struct 
dt_info *dti,
 }
 WARNING(ranges_format, check_ranges_format, NULL, &addr_size_cells);
 
-static const struct bus_type pci_bus = {
-       .name = "PCI",
-};
-
-static void check_pci_bridge(struct check *c, struct dt_info *dti, struct node 
*node)
-{
-       struct property *prop;
-       cell_t *cells;
-
-       prop = get_property(node, "device_type");
-       if (!prop || !streq(prop->val.val, "pci"))
-               return;
-
-       node->bus = &pci_bus;
-
-       if (!strneq(node->name, "pci", node->basenamelen) &&
-           !strneq(node->name, "pcie", node->basenamelen))
-               FAIL(c, dti, "Node %s node name is not \"pci\" or \"pcie\"",
-                            node->fullpath);
-
-       prop = get_property(node, "ranges");
-       if (!prop)
-               FAIL(c, dti, "Node %s missing ranges for PCI bridge (or not a 
bridge)",
-                            node->fullpath);
-
-       if (node_addr_cells(node) != 3)
-               FAIL(c, dti, "Node %s incorrect #address-cells for PCI bridge",
-                            node->fullpath);
-       if (node_size_cells(node) != 2)
-               FAIL(c, dti, "Node %s incorrect #size-cells for PCI bridge",
-                            node->fullpath);
-
-       prop = get_property(node, "bus-range");
-       if (!prop) {
-               FAIL(c, dti, "Node %s missing bus-range for PCI bridge",
-                            node->fullpath);
-               return;
-       }
-       if (prop->val.len != (sizeof(cell_t) * 2)) {
-               FAIL(c, dti, "Node %s bus-range must be 2 cells",
-                            node->fullpath);
-               return;
-       }
-       cells = (cell_t *)prop->val.val;
-       if (fdt32_to_cpu(cells[0]) > fdt32_to_cpu(cells[1]))
-               FAIL(c, dti, "Node %s bus-range 1st cell must be less than or 
equal to 2nd cell",
-                            node->fullpath);
-       if (fdt32_to_cpu(cells[1]) > 0xff)
-               FAIL(c, dti, "Node %s bus-range maximum bus number must be less 
than 256",
-                            node->fullpath);
-}
-WARNING(pci_bridge, check_pci_bridge, NULL,
-       &device_type_is_string, &addr_size_cells);
-
-static void check_pci_device_bus_num(struct check *c, struct dt_info *dti, 
struct node *node)
-{
-       struct property *prop;
-       unsigned int bus_num, min_bus, max_bus;
-       cell_t *cells;
-
-       if (!node->parent || (node->parent->bus != &pci_bus))
-               return;
-
-       prop = get_property(node, "reg");
-       if (!prop)
-               return;
-
-       cells = (cell_t *)prop->val.val;
-       bus_num = (fdt32_to_cpu(cells[0]) & 0x00ff0000) >> 16;
-
-       prop = get_property(node->parent, "bus-range");
-       if (!prop) {
-               min_bus = max_bus = 0;
-       } else {
-               cells = (cell_t *)prop->val.val;
-               min_bus = fdt32_to_cpu(cells[0]);
-               max_bus = fdt32_to_cpu(cells[0]);
-       }
-       if ((bus_num < min_bus) || (bus_num > max_bus))
-               FAIL(c, dti, "Node %s PCI bus number %d out of range, expected 
(%d - %d)",
-                    node->fullpath, bus_num, min_bus, max_bus);
-}
-WARNING(pci_device_bus_num, check_pci_device_bus_num, NULL, &reg_format, 
&pci_bridge);
-
-static void check_pci_device_reg(struct check *c, struct dt_info *dti, struct 
node *node)
-{
-       struct property *prop;
-       const char *unitname = get_unitname(node);
-       char unit_addr[5];
-       unsigned int dev, func, reg;
-       cell_t *cells;
-
-       if (!node->parent || (node->parent->bus != &pci_bus))
-               return;
-
-       prop = get_property(node, "reg");
-       if (!prop) {
-               FAIL(c, dti, "Node %s missing PCI reg property", 
node->fullpath);
-               return;
-       }
-
-       cells = (cell_t *)prop->val.val;
-       if (cells[1] || cells[2])
-               FAIL(c, dti, "Node %s PCI reg config space address cells 2 and 
3 must be 0",
-                            node->fullpath);
-
-       reg = fdt32_to_cpu(cells[0]);
-       dev = (reg & 0xf800) >> 11;
-       func = (reg & 0x700) >> 8;
-
-       if (reg & 0xff000000)
-               FAIL(c, dti, "Node %s PCI reg address is not configuration 
space",
-                            node->fullpath);
-       if (reg & 0x000000ff)
-               FAIL(c, dti, "Node %s PCI reg config space address register 
number must be 0",
-                            node->fullpath);
-
-       if (func == 0) {
-               snprintf(unit_addr, sizeof(unit_addr), "%x", dev);
-               if (streq(unitname, unit_addr))
-                       return;
-       }
-
-       snprintf(unit_addr, sizeof(unit_addr), "%x,%x", dev, func);
-       if (streq(unitname, unit_addr))
-               return;
-
-       FAIL(c, dti, "Node %s PCI unit address format error, expected \"%s\"",
-            node->fullpath, unit_addr);
-}
-WARNING(pci_device_reg, check_pci_device_reg, NULL, &reg_format, &pci_bridge);
-
-static const struct bus_type simple_bus = {
-       .name = "simple-bus",
-};
-
-static bool node_is_compatible(struct node *node, const char *compat)
-{
-       struct property *prop;
-       const char *str, *end;
-
-       prop = get_property(node, "compatible");
-       if (!prop)
-               return false;
-
-       for (str = prop->val.val, end = str + prop->val.len; str < end;
-            str += strnlen(str, end - str) + 1) {
-               if (strneq(str, compat, end - str))
-                       return true;
-       }
-       return false;
-}
-
-static void check_simple_bus_bridge(struct check *c, struct dt_info *dti, 
struct node *node)
-{
-       if (node_is_compatible(node, "simple-bus"))
-               node->bus = &simple_bus;
-}
-WARNING(simple_bus_bridge, check_simple_bus_bridge, NULL, &addr_size_cells);
-
-static void check_simple_bus_reg(struct check *c, struct dt_info *dti, struct 
node *node)
-{
-       struct property *prop;
-       const char *unitname = get_unitname(node);
-       char unit_addr[17];
-       unsigned int size;
-       uint64_t reg = 0;
-       cell_t *cells = NULL;
-
-       if (!node->parent || (node->parent->bus != &simple_bus))
-               return;
-
-       prop = get_property(node, "reg");
-       if (prop)
-               cells = (cell_t *)prop->val.val;
-       else {
-               prop = get_property(node, "ranges");
-               if (prop && prop->val.len)
-                       /* skip of child address */
-                       cells = ((cell_t *)prop->val.val) + 
node_addr_cells(node);
-       }
-
-       if (!cells) {
-               if (node->parent->parent && !(node->bus == &simple_bus))
-                       FAIL(c, dti, "Node %s missing or empty reg/ranges 
property", node->fullpath);
-               return;
-       }
-
-       size = node_addr_cells(node->parent);
-       while (size--)
-               reg = (reg << 32) | fdt32_to_cpu(*(cells++));
-
-       snprintf(unit_addr, sizeof(unit_addr), "%"PRIx64, reg);
-       if (!streq(unitname, unit_addr))
-               FAIL(c, dti, "Node %s simple-bus unit address format error, 
expected \"%s\"",
-                    node->fullpath, unit_addr);
-}
-WARNING(simple_bus_reg, check_simple_bus_reg, NULL, &reg_format, 
&simple_bus_bridge);
-
-static void check_unit_address_format(struct check *c, struct dt_info *dti,
-                                     struct node *node)
-{
-       const char *unitname = get_unitname(node);
-
-       if (node->parent && node->parent->bus)
-               return;
-
-       if (!unitname[0])
-               return;
-
-       if (!strncmp(unitname, "0x", 2)) {
-               FAIL(c, dti, "Node %s unit name should not have leading \"0x\"",
-                   node->fullpath);
-               /* skip over 0x for next test */
-               unitname += 2;
-       }
-       if (unitname[0] == '0' && isxdigit(unitname[1]))
-               FAIL(c, dti, "Node %s unit name should not have leading 0s",
-                   node->fullpath);
-}
-WARNING(unit_address_format, check_unit_address_format, NULL,
-       &node_name_format, &pci_bridge, &simple_bus_bridge);
-
 /*
  * Style checks
  */
@@ -975,14 +752,6 @@ static struct check *check_table[] = {
        &addr_size_cells, &reg_format, &ranges_format,
 
        &unit_address_vs_reg,
-       &unit_address_format,
-
-       &pci_bridge,
-       &pci_device_reg,
-       &pci_device_bus_num,
-
-       &simple_bus_bridge,
-       &simple_bus_reg,
 
        &avoid_default_addr_size,
        &obsolete_chosen_interrupt_controller,
diff --git a/scripts/dtc/dtc.c b/scripts/dtc/dtc.c
index 5ed873c72a..f5eed9d72c 100644
--- a/scripts/dtc/dtc.c
+++ b/scripts/dtc/dtc.c
@@ -31,7 +31,7 @@ int reservenum;               /* Number of memory reservation 
slots */
 int minsize;           /* Minimum blob size */
 int padsize;           /* Additional padding to blob */
 int alignsize;         /* Additional padding to blob accroding to the 
alignsize */
-int phandle_format = PHANDLE_EPAPR;    /* Use linux,phandle or phandle 
properties */
+int phandle_format = PHANDLE_BOTH;     /* Use linux,phandle or phandle 
properties */
 int generate_symbols;  /* enable symbols & fixup support */
 int generate_fixups;           /* suppress generation of fixups on symbol 
support */
 int auto_label_aliases;                /* auto generate labels -> aliases */
diff --git a/scripts/dtc/dtc.h b/scripts/dtc/dtc.h
index 409db76c94..403b79deab 100644
--- a/scripts/dtc/dtc.h
+++ b/scripts/dtc/dtc.h
@@ -31,7 +31,6 @@
 #include <ctype.h>
 #include <errno.h>
 #include <unistd.h>
-#include <inttypes.h>
 
 #include <libfdt_env.h>
 #include <fdt.h>
@@ -136,10 +135,6 @@ struct label {
        struct label *next;
 };
 
-struct bus_type {
-       const char *name;
-};
-
 struct property {
        bool deleted;
        char *name;
@@ -166,7 +161,6 @@ struct node {
        int addr_cells, size_cells;
 
        struct label *labels;
-       const struct bus_type *bus;
 };
 
 #define for_each_label_withdel(l0, l) \
diff --git a/scripts/dtc/libfdt/fdt_empty_tree.c 
b/scripts/dtc/libfdt/fdt_empty_tree.c
index f2ae9b77c2..f72d13b1d1 100644
--- a/scripts/dtc/libfdt/fdt_empty_tree.c
+++ b/scripts/dtc/libfdt/fdt_empty_tree.c
@@ -81,3 +81,4 @@ int fdt_create_empty_tree(void *buf, int bufsize)
 
        return fdt_open_into(buf, buf, bufsize);
 }
+
diff --git a/scripts/dtc/libfdt/fdt_ro.c b/scripts/dtc/libfdt/fdt_ro.c
index 08de2cce67..3d00d2eee0 100644
--- a/scripts/dtc/libfdt/fdt_ro.c
+++ b/scripts/dtc/libfdt/fdt_ro.c
@@ -60,7 +60,7 @@ static int _fdt_nodename_eq(const void *fdt, int offset,
 {
        const char *p = fdt_offset_ptr(fdt, offset + FDT_TAGSIZE, len+1);
 
-       if (!p)
+       if (! p)
                /* short match */
                return 0;
 
@@ -327,7 +327,7 @@ const void *fdt_getprop_namelen(const void *fdt, int 
nodeoffset,
        const struct fdt_property *prop;
 
        prop = fdt_get_property_namelen(fdt, nodeoffset, name, namelen, lenp);
-       if (!prop)
+       if (! prop)
                return NULL;
 
        return prop->data;
diff --git a/scripts/dtc/libfdt/fdt_rw.c b/scripts/dtc/libfdt/fdt_rw.c
index 5c3a2bb0bc..3fd5847377 100644
--- a/scripts/dtc/libfdt/fdt_rw.c
+++ b/scripts/dtc/libfdt/fdt_rw.c
@@ -207,7 +207,7 @@ static int _fdt_resize_property(void *fdt, int nodeoffset, 
const char *name,
        int err;
 
        *prop = fdt_get_property_w(fdt, nodeoffset, name, &oldlen);
-       if (!*prop)
+       if (! (*prop))
                return oldlen;
 
        if ((err = _fdt_splice_struct(fdt, (*prop)->data, FDT_TAGALIGN(oldlen),
@@ -269,8 +269,8 @@ int fdt_set_name(void *fdt, int nodeoffset, const char 
*name)
        return 0;
 }
 
-int fdt_setprop_placeholder(void *fdt, int nodeoffset, const char *name,
-                           int len, void **prop_data)
+int fdt_setprop(void *fdt, int nodeoffset, const char *name,
+               const void *val, int len)
 {
        struct fdt_property *prop;
        int err;
@@ -283,22 +283,8 @@ int fdt_setprop_placeholder(void *fdt, int nodeoffset, 
const char *name,
        if (err)
                return err;
 
-       *prop_data = prop->data;
-       return 0;
-}
-
-int fdt_setprop(void *fdt, int nodeoffset, const char *name,
-               const void *val, int len)
-{
-       void *prop_data;
-       int err;
-
-       err = fdt_setprop_placeholder(fdt, nodeoffset, name, len, &prop_data);
-       if (err)
-               return err;
-
        if (len)
-               memcpy(prop_data, val, len);
+               memcpy(prop->data, val, len);
        return 0;
 }
 
@@ -337,7 +323,7 @@ int fdt_delprop(void *fdt, int nodeoffset, const char *name)
        FDT_RW_CHECK_HEADER(fdt);
 
        prop = fdt_get_property_w(fdt, nodeoffset, name, &len);
-       if (!prop)
+       if (! prop)
                return len;
 
        proplen = sizeof(*prop) + FDT_TAGALIGN(len);
diff --git a/scripts/dtc/libfdt/fdt_sw.c b/scripts/dtc/libfdt/fdt_sw.c
index 2bd15e7aef..6a804859fd 100644
--- a/scripts/dtc/libfdt/fdt_sw.c
+++ b/scripts/dtc/libfdt/fdt_sw.c
@@ -220,7 +220,7 @@ static int _fdt_find_add_string(void *fdt, const char *s)
        return offset;
 }
 
-int fdt_property_placeholder(void *fdt, const char *name, int len, void **valp)
+int fdt_property(void *fdt, const char *name, const void *val, int len)
 {
        struct fdt_property *prop;
        int nameoff;
@@ -238,19 +238,7 @@ int fdt_property_placeholder(void *fdt, const char *name, 
int len, void **valp)
        prop->tag = cpu_to_fdt32(FDT_PROP);
        prop->nameoff = cpu_to_fdt32(nameoff);
        prop->len = cpu_to_fdt32(len);
-       *valp = prop->data;
-       return 0;
-}
-
-int fdt_property(void *fdt, const char *name, const void *val, int len)
-{
-       void *ptr;
-       int ret;
-
-       ret = fdt_property_placeholder(fdt, name, len, &ptr);
-       if (ret)
-               return ret;
-       memcpy(ptr, val, len);
+       memcpy(prop->data, val, len);
        return 0;
 }
 
diff --git a/scripts/dtc/libfdt/fdt_wip.c b/scripts/dtc/libfdt/fdt_wip.c
index 5e85919862..6aaab39992 100644
--- a/scripts/dtc/libfdt/fdt_wip.c
+++ b/scripts/dtc/libfdt/fdt_wip.c
@@ -82,7 +82,7 @@ int fdt_setprop_inplace(void *fdt, int nodeoffset, const char 
*name,
        int proplen;
 
        propval = fdt_getprop(fdt, nodeoffset, name, &proplen);
-       if (!propval)
+       if (! propval)
                return proplen;
 
        if (proplen != len)
@@ -107,7 +107,7 @@ int fdt_nop_property(void *fdt, int nodeoffset, const char 
*name)
        int len;
 
        prop = fdt_get_property_w(fdt, nodeoffset, name, &len);
-       if (!prop)
+       if (! prop)
                return len;
 
        _fdt_nop_region(prop, len + sizeof(*prop));
diff --git a/scripts/dtc/libfdt/libfdt.h b/scripts/dtc/libfdt/libfdt.h
index 7f83023ee1..9e71bb9e03 100644
--- a/scripts/dtc/libfdt/libfdt.h
+++ b/scripts/dtc/libfdt/libfdt.h
@@ -143,9 +143,7 @@
 /* Low-level functions (you probably don't need these)                */
 /**********************************************************************/
 
-#ifndef SWIG /* This function is not useful in Python */
 const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int checklen);
-#endif
 static inline void *fdt_offset_ptr_w(void *fdt, int offset, int checklen)
 {
        return (void *)(uintptr_t)fdt_offset_ptr(fdt, offset, checklen);
@@ -212,6 +210,7 @@ int fdt_next_subnode(const void *fdt, int offset);
 /**********************************************************************/
 /* General functions                                                  */
 /**********************************************************************/
+
 #define fdt_get_header(fdt, field) \
        (fdt32_to_cpu(((const struct fdt_header *)(fdt))->field))
 #define fdt_magic(fdt)                 (fdt_get_header(fdt, magic))
@@ -355,10 +354,8 @@ int fdt_get_mem_rsv(const void *fdt, int n, uint64_t 
*address, uint64_t *size);
  * useful for finding subnodes based on a portion of a larger string,
  * such as a full path.
  */
-#ifndef SWIG /* Not available in Python */
 int fdt_subnode_offset_namelen(const void *fdt, int parentoffset,
                               const char *name, int namelen);
-#endif
 /**
  * fdt_subnode_offset - find a subnode of a given node
  * @fdt: pointer to the device tree blob
@@ -394,9 +391,7 @@ int fdt_subnode_offset(const void *fdt, int parentoffset, 
const char *name);
  * Identical to fdt_path_offset(), but only consider the first namelen
  * characters of path as the path name.
  */
-#ifndef SWIG /* Not available in Python */
 int fdt_path_offset_namelen(const void *fdt, const char *path, int namelen);
-#endif
 
 /**
  * fdt_path_offset - find a tree node by its full path
@@ -555,12 +550,10 @@ const struct fdt_property 
*fdt_get_property_by_offset(const void *fdt,
  * Identical to fdt_get_property(), but only examine the first namelen
  * characters of name for matching the property name.
  */
-#ifndef SWIG /* Not available in Python */
 const struct fdt_property *fdt_get_property_namelen(const void *fdt,
                                                    int nodeoffset,
                                                    const char *name,
                                                    int namelen, int *lenp);
-#endif
 
 /**
  * fdt_get_property - find a given property in a given node
@@ -631,10 +624,8 @@ static inline struct fdt_property *fdt_get_property_w(void 
*fdt, int nodeoffset,
  *             -FDT_ERR_BADSTRUCTURE,
  *             -FDT_ERR_TRUNCATED, standard meanings
  */
-#ifndef SWIG /* This function is not useful in Python */
 const void *fdt_getprop_by_offset(const void *fdt, int offset,
                                  const char **namep, int *lenp);
-#endif
 
 /**
  * fdt_getprop_namelen - get property value based on substring
@@ -647,7 +638,6 @@ const void *fdt_getprop_by_offset(const void *fdt, int 
offset,
  * Identical to fdt_getprop(), but only examine the first namelen
  * characters of name for matching the property name.
  */
-#ifndef SWIG /* Not available in Python */
 const void *fdt_getprop_namelen(const void *fdt, int nodeoffset,
                                const char *name, int namelen, int *lenp);
 static inline void *fdt_getprop_namelen_w(void *fdt, int nodeoffset,
@@ -657,7 +647,6 @@ static inline void *fdt_getprop_namelen_w(void *fdt, int 
nodeoffset,
        return (void *)(uintptr_t)fdt_getprop_namelen(fdt, nodeoffset, name,
                                                      namelen, lenp);
 }
-#endif
 
 /**
  * fdt_getprop - retrieve the value of a given property
@@ -718,10 +707,8 @@ uint32_t fdt_get_phandle(const void *fdt, int nodeoffset);
  * Identical to fdt_get_alias(), but only examine the first namelen
  * characters of name for matching the alias name.
  */
-#ifndef SWIG /* Not available in Python */
 const char *fdt_get_alias_namelen(const void *fdt,
                                  const char *name, int namelen);
-#endif
 
 /**
  * fdt_get_alias - retrieve the path referenced by a given alias
@@ -1119,12 +1106,10 @@ int fdt_size_cells(const void *fdt, int nodeoffset);
  * of the name. It is useful when you want to manipulate only one value of
  * an array and you have a string that doesn't end with \0.
  */
-#ifndef SWIG /* Not available in Python */
 int fdt_setprop_inplace_namelen_partial(void *fdt, int nodeoffset,
                                        const char *name, int namelen,
                                        uint32_t idx, const void *val,
                                        int len);
-#endif
 
 /**
  * fdt_setprop_inplace - change a property's value, but not its size
@@ -1154,10 +1139,8 @@ int fdt_setprop_inplace_namelen_partial(void *fdt, int 
nodeoffset,
  *     -FDT_ERR_BADSTRUCTURE,
  *     -FDT_ERR_TRUNCATED, standard meanings
  */
-#ifndef SWIG /* Not available in Python */
 int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name,
                        const void *val, int len);
-#endif
 
 /**
  * fdt_setprop_inplace_u32 - change the value of a 32-bit integer property
@@ -1314,22 +1297,6 @@ static inline int fdt_property_cell(void *fdt, const 
char *name, uint32_t val)
 {
        return fdt_property_u32(fdt, name, val);
 }
-
-/**
- * fdt_property_placeholder - add a new property and return a ptr to its value
- *
- * @fdt: pointer to the device tree blob
- * @name: name of property to add
- * @len: length of property value in bytes
- * @valp: returns a pointer to where where the value should be placed
- *
- * returns:
- *     0, on success
- *     -FDT_ERR_BADMAGIC,
- *     -FDT_ERR_NOSPACE, standard meanings
- */
-int fdt_property_placeholder(void *fdt, const char *name, int len, void 
**valp);
-
 #define fdt_property_string(fdt, name, str) \
        fdt_property(fdt, name, str, strlen(str)+1)
 int fdt_end_node(void *fdt);
@@ -1449,37 +1416,6 @@ int fdt_setprop(void *fdt, int nodeoffset, const char 
*name,
                const void *val, int len);
 
 /**
- * fdt_setprop _placeholder - allocate space for a property
- * @fdt: pointer to the device tree blob
- * @nodeoffset: offset of the node whose property to change
- * @name: name of the property to change
- * @len: length of the property value
- * @prop_data: return pointer to property data
- *
- * fdt_setprop_placeholer() allocates the named property in the given node.
- * If the property exists it is resized. In either case a pointer to the
- * property data is returned.
- *
- * This function may insert or delete data from the blob, and will
- * therefore change the offsets of some existing nodes.
- *
- * returns:
- *     0, on success
- *     -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
- *             contain the new property value
- *     -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
- *     -FDT_ERR_BADLAYOUT,
- *     -FDT_ERR_BADMAGIC,
- *     -FDT_ERR_BADVERSION,
- *     -FDT_ERR_BADSTATE,
- *     -FDT_ERR_BADSTRUCTURE,
- *     -FDT_ERR_BADLAYOUT,
- *     -FDT_ERR_TRUNCATED, standard meanings
- */
-int fdt_setprop_placeholder(void *fdt, int nodeoffset, const char *name,
-                           int len, void **prop_data);
-
-/**
  * fdt_setprop_u32 - set a property to a 32-bit integer
  * @fdt: pointer to the device tree blob
  * @nodeoffset: offset of the node whose property to change
@@ -1798,10 +1734,8 @@ int fdt_delprop(void *fdt, int nodeoffset, const char 
*name);
  * creating subnodes based on a portion of a larger string, such as a
  * full path.
  */
-#ifndef SWIG /* Not available in Python */
 int fdt_add_subnode_namelen(void *fdt, int parentoffset,
                            const char *name, int namelen);
-#endif
 
 /**
  * fdt_add_subnode - creates a new node
diff --git a/scripts/dtc/livetree.c b/scripts/dtc/livetree.c
index aecd27875f..3673de07e4 100644
--- a/scripts/dtc/livetree.c
+++ b/scripts/dtc/livetree.c
@@ -478,8 +478,7 @@ struct node *get_node_by_path(struct node *tree, const char 
*path)
        p = strchr(path, '/');
 
        for_each_child(tree, child) {
-               if (p && (strlen(child->name) == p-path) &&
-                               strneq(path, child->name, p-path))
+               if (p && strneq(path, child->name, p-path))
                        return get_node_by_path(child, p+1);
                else if (!p && streq(path, child->name))
                        return child;
diff --git a/scripts/dtc/version_gen.h b/scripts/dtc/version_gen.h
index b5ed715ecc..859564e8b4 100644
--- a/scripts/dtc/version_gen.h
+++ b/scripts/dtc/version_gen.h
@@ -1 +1 @@
-#define DTC_VERSION "DTC 1.4.4-gfe50bd1e"
+#define DTC_VERSION "DTC 1.4.4"
-- 
2.13.3

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to