From cff7dcf3fd0de0120cd40c0c28864cb045143f97 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 15 Mar 2021 17:25:11 +1300 Subject: [PATCH] dtoc: Drop use of DECL() macros We can use extern instead, so let's drop these macros. It adds one more thing to learn about and doesn't make the code any clearer. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- tools/dtoc/dtb_platdata.py | 8 ++--- tools/dtoc/test_dtoc.py | 64 +++++++++++++++++++------------------- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/tools/dtoc/dtb_platdata.py b/tools/dtoc/dtb_platdata.py index f5b5ad5f71..b5c449ebb4 100644 --- a/tools/dtoc/dtb_platdata.py +++ b/tools/dtoc/dtb_platdata.py @@ -902,14 +902,14 @@ class DtbPlatdata(): self.buf( '/* driver declarations - these allow DM_DRIVER_GET() to be used */\n') for node in nodes_to_output: - self.buf('DM_DRIVER_DECL(%s);\n' % node.struct_name); + self.buf('extern U_BOOT_DRIVER(%s);\n' % node.struct_name); self.buf('\n') if self._instantiate: self.buf( '/* device declarations - these allow DM_DEVICE_REF() to be used */\n') for node in nodes_to_output: - self.buf('DM_DEVICE_DECL(%s);\n' % node.var_name) + self.buf('extern DM_DEVICE_INST(%s);\n' % node.var_name) self.buf('\n') uclass_list = self._valid_uclasses @@ -917,13 +917,13 @@ class DtbPlatdata(): self.buf( '/* uclass driver declarations - needed for DM_UCLASS_DRIVER_REF() */\n') for uclass in uclass_list: - self.buf('DM_UCLASS_DRIVER_DECL(%s);\n' % uclass.name) + self.buf('extern UCLASS_DRIVER(%s);\n' % uclass.name) if self._instantiate: self.buf('\n') self.buf('/* uclass declarations - needed for DM_UCLASS_REF() */\n') for uclass in uclass_list: - self.buf('DM_UCLASS_DECL(%s);\n' % uclass.name) + self.buf('extern DM_UCLASS_INST(%s);\n' % uclass.name) self.out(''.join(self.get_buf())) def assign_seqs(self): diff --git a/tools/dtoc/test_dtoc.py b/tools/dtoc/test_dtoc.py index bb689f3b6e..1912a8723f 100755 --- a/tools/dtoc/test_dtoc.py +++ b/tools/dtoc/test_dtoc.py @@ -241,52 +241,52 @@ class TestDtoc(unittest.TestCase): #include /* driver declarations - these allow DM_DRIVER_GET() to be used */ -DM_DRIVER_DECL(sandbox_i2c); -DM_DRIVER_DECL(sandbox_pmic); -DM_DRIVER_DECL(sandbox_spl_test); -DM_DRIVER_DECL(sandbox_spl_test); -DM_DRIVER_DECL(sandbox_spl_test); +extern U_BOOT_DRIVER(sandbox_i2c); +extern U_BOOT_DRIVER(sandbox_pmic); +extern U_BOOT_DRIVER(sandbox_spl_test); +extern U_BOOT_DRIVER(sandbox_spl_test); +extern U_BOOT_DRIVER(sandbox_spl_test); /* uclass driver declarations - needed for DM_UCLASS_DRIVER_REF() */ -DM_UCLASS_DRIVER_DECL(i2c); -DM_UCLASS_DRIVER_DECL(misc); -DM_UCLASS_DRIVER_DECL(pmic); +extern UCLASS_DRIVER(i2c); +extern UCLASS_DRIVER(misc); +extern UCLASS_DRIVER(pmic); ''' decl_text_inst = DECL_HEADER + ''' #include #include /* driver declarations - these allow DM_DRIVER_GET() to be used */ -DM_DRIVER_DECL(sandbox_i2c); -DM_DRIVER_DECL(root_driver); -DM_DRIVER_DECL(denx_u_boot_test_bus); -DM_DRIVER_DECL(sandbox_spl_test); -DM_DRIVER_DECL(sandbox_spl_test); -DM_DRIVER_DECL(denx_u_boot_fdt_test); -DM_DRIVER_DECL(denx_u_boot_fdt_test); +extern U_BOOT_DRIVER(sandbox_i2c); +extern U_BOOT_DRIVER(root_driver); +extern U_BOOT_DRIVER(denx_u_boot_test_bus); +extern U_BOOT_DRIVER(sandbox_spl_test); +extern U_BOOT_DRIVER(sandbox_spl_test); +extern U_BOOT_DRIVER(denx_u_boot_fdt_test); +extern U_BOOT_DRIVER(denx_u_boot_fdt_test); /* device declarations - these allow DM_DEVICE_REF() to be used */ -DM_DEVICE_DECL(i2c); -DM_DEVICE_DECL(root); -DM_DEVICE_DECL(some_bus); -DM_DEVICE_DECL(spl_test); -DM_DEVICE_DECL(spl_test3); -DM_DEVICE_DECL(test); -DM_DEVICE_DECL(test0); +extern DM_DEVICE_INST(i2c); +extern DM_DEVICE_INST(root); +extern DM_DEVICE_INST(some_bus); +extern DM_DEVICE_INST(spl_test); +extern DM_DEVICE_INST(spl_test3); +extern DM_DEVICE_INST(test); +extern DM_DEVICE_INST(test0); /* uclass driver declarations - needed for DM_UCLASS_DRIVER_REF() */ -DM_UCLASS_DRIVER_DECL(i2c); -DM_UCLASS_DRIVER_DECL(misc); -DM_UCLASS_DRIVER_DECL(root); -DM_UCLASS_DRIVER_DECL(testbus); -DM_UCLASS_DRIVER_DECL(testfdt); +extern UCLASS_DRIVER(i2c); +extern UCLASS_DRIVER(misc); +extern UCLASS_DRIVER(root); +extern UCLASS_DRIVER(testbus); +extern UCLASS_DRIVER(testfdt); /* uclass declarations - needed for DM_UCLASS_REF() */ -DM_UCLASS_DECL(i2c); -DM_UCLASS_DECL(misc); -DM_UCLASS_DECL(root); -DM_UCLASS_DECL(testbus); -DM_UCLASS_DECL(testfdt); +extern DM_UCLASS_INST(i2c); +extern DM_UCLASS_INST(misc); +extern DM_UCLASS_INST(root); +extern DM_UCLASS_INST(testbus); +extern DM_UCLASS_INST(testfdt); ''' struct_text = HEADER + ''' struct dtd_sandbox_i2c { -- 2.39.5