All of lore.kernel.org
 help / color / mirror / Atom feed
From: Walter Lozano <walter.lozano@collabora.com>
To: u-boot@lists.denx.de
Subject: [PATCH 2/2] dtoc: remove compatible string aliases support
Date: Thu, 16 Jul 2020 17:48:13 -0300	[thread overview]
Message-ID: <20200716204813.21839-3-walter.lozano@collabora.com> (raw)
In-Reply-To: <20200716204813.21839-1-walter.lozano@collabora.com>

After latest improvements in dtoc, compatible strings are checked
against driver and driver alias list to get a valid driver name. With
this new feature the list of compatible string  aliases seems not
useful any more.

Signed-off-by: Walter Lozano <walter.lozano@collabora.com>
---

 tools/dtoc/dtb_platdata.py | 13 ------------
 tools/dtoc/test_dtoc.py    | 43 --------------------------------------
 2 files changed, 56 deletions(-)

diff --git a/tools/dtoc/dtb_platdata.py b/tools/dtoc/dtb_platdata.py
index b1b082e508..c28768f4a2 100644
--- a/tools/dtoc/dtb_platdata.py
+++ b/tools/dtoc/dtb_platdata.py
@@ -139,9 +139,6 @@ class DtbPlatdata(object):
         _outfile: The current output file (sys.stdout or a real file)
         _warning_disabled: true to disable warnings about driver names not found
         _lines: Stashed list of output lines for outputting in the future
-        _aliases: Dict that hold aliases for compatible strings
-            key: First compatible string declared in a node
-            value: List of additional compatible strings declared in a node
         _drivers: List of valid driver names found in drivers/
         _driver_aliases: Dict that holds aliases for driver names
             key: Driver alias declared with
@@ -157,7 +154,6 @@ class DtbPlatdata(object):
         self._outfile = None
         self._warning_disabled = warning_disabled
         self._lines = []
-        self._aliases = {}
         self._drivers = []
         self._driver_aliases = {}
         self._links = []
@@ -483,10 +479,6 @@ class DtbPlatdata(object):
                     prop.Widen(struct[name])
             upto += 1
 
-            struct_name, aliases = self.get_normalized_compat_name(node)
-            for alias in aliases:
-                self._aliases[alias] = struct_name
-
         return structs
 
     def scan_phandles(self):
@@ -549,11 +541,6 @@ class DtbPlatdata(object):
                 self.out(';\n')
             self.out('};\n')
 
-        for alias, struct_name in self._aliases.items():
-            if alias not in sorted(structs):
-                self.out('#define %s%s %s%s\n'% (STRUCT_PREFIX, alias,
-                                                 STRUCT_PREFIX, struct_name))
-
     def output_node(self, node):
         """Output the C code for a node
 
diff --git a/tools/dtoc/test_dtoc.py b/tools/dtoc/test_dtoc.py
index edb3912e94..169ecd6e6e 100755
--- a/tools/dtoc/test_dtoc.py
+++ b/tools/dtoc/test_dtoc.py
@@ -290,7 +290,6 @@ struct dtd_sandbox_gpio {
 \tbool\t\tgpio_controller;
 \tfdt32_t\t\tsandbox_gpio_count;
 };
-#define dtd_sandbox_gpio_alias dtd_sandbox_gpio
 ''', data)
 
         self.run_test(['platdata'], dtb_file, output)
@@ -555,48 +554,6 @@ void dm_populate_phandle_data(void) {
         self.assertIn("Node 'phandle-target' has no cells property",
                       str(e.exception))
 
-    def test_aliases(self):
-        """Test output from a node with multiple compatible strings"""
-        dtb_file = get_dtb_file('dtoc_test_aliases.dts')
-        output = tools.GetOutputFilename('output')
-        self.run_test(['struct'], dtb_file, output)
-        with open(output) as infile:
-            data = infile.read()
-        self._CheckStrings(HEADER + '''
-struct dtd_compat1 {
-\tfdt32_t\t\tintval;
-};
-struct dtd_simple_bus {
-\tfdt32_t\t\tintval;
-};
-#define dtd_compat2_1_fred dtd_compat1
-#define dtd_compat3 dtd_compat1
-''', data)
-
-        self.run_test(['platdata'], dtb_file, output)
-        with open(output) as infile:
-            data = infile.read()
-        self._CheckStrings(C_HEADER + '''
-static struct dtd_compat1 dtv_spl_test = {
-\t.intval\t\t\t= 0x1,
-};
-U_BOOT_DEVICE(spl_test) = {
-\t.name\t\t= "compat1",
-\t.platdata\t= &dtv_spl_test,
-\t.platdata_size\t= sizeof(dtv_spl_test),
-};
-
-static struct dtd_simple_bus dtv_spl_test2 = {
-\t.intval\t\t\t= 0x1,
-};
-U_BOOT_DEVICE(spl_test2) = {
-\t.name\t\t= "simple_bus",
-\t.platdata\t= &dtv_spl_test2,
-\t.platdata_size\t= sizeof(dtv_spl_test2),
-};
-
-''' + C_EMPTY_POPULATE_PHANDLE_DATA, data)
-
     def test_addresses64(self):
         """Test output from a node with a 'reg' property with na=2, ns=2"""
         dtb_file = get_dtb_file('dtoc_test_addr64.dts')
-- 
2.20.1

      parent reply	other threads:[~2020-07-16 20:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-16 20:48 [PATCH 0/2] dtoc: improve compatible string aliases support Walter Lozano
2020-07-16 20:48 ` [PATCH 1/2] dtoc: look for compatible string aliases in driver list Walter Lozano
2020-07-16 20:48 ` Walter Lozano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200716204813.21839-3-walter.lozano@collabora.com \
    --to=walter.lozano@collabora.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.