All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Cc: Tom Rini <trini@konsulko.com>, Simon Glass <sjg@chromium.org>,
	Marek Vasut <marex@denx.de>,
	Pavel Herrmann <morpheus.ibis@gmail.com>
Subject: [PATCH 10/12] dm: doc: Add a note about of-platdata header files
Date: Sat,  7 Aug 2021 07:24:10 -0600	[thread overview]
Message-ID: <20210807132413.3513724-11-sjg@chromium.org> (raw)
In-Reply-To: <20210807132413.3513724-1-sjg@chromium.org>

This error can be confusing so mention it specifically in the
documentation.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 doc/develop/driver-model/of-plat.rst | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/doc/develop/driver-model/of-plat.rst b/doc/develop/driver-model/of-plat.rst
index 61aa2bc3ed9..921178cd4aa 100644
--- a/doc/develop/driver-model/of-plat.rst
+++ b/doc/develop/driver-model/of-plat.rst
@@ -634,7 +634,7 @@ then dtoc looks at the first compatible string ("rockchip,rk3188-grf"),
 converts that to a C identifier (rockchip_rk3188_grf) and then looks for that.
 
 Various things can cause dtoc to fail to find the driver and it tries to
-warn about these. For example:
+warn about these. For example::
 
    rockchip_rk3188_uart: Missing .compatible in drivers/serial/serial_rockchip.c
                     : WARNING: the driver rockchip_rk3188_uart was not found in the driver list
@@ -649,6 +649,30 @@ Checks are also made to confirm that the referenced driver has a .compatible
 member and a .id member. The first provides the array of compatible strings and
 the second provides the uclass ID.
 
+Another error that can crop up is something like::
+
+   spl/dts/dt-device.c:257:38: error: invalid application of ‘sizeof’ to
+         incomplete type ‘struct sandbox_irq_priv’
+      257 | u8 _sandbox_irq_priv_irq_sbox[sizeof(struct sandbox_irq_priv)]
+          |                                      ^~~~~~
+
+This indicates that `struct sandbox_irq_priv` is not defined anywhere. The
+solution is to add a DM_HEADER() line, as below, so this is included in the
+dt-device.c file::
+
+   U_BOOT_DRIVER(sandbox_irq) = {
+      .name		= "sandbox_irq",
+      .id		= UCLASS_IRQ,
+      .of_match	= sandbox_irq_ids,
+      .ops		= &sandbox_irq_ops,
+      .priv_auto	= sizeof(struct sandbox_irq_priv),
+      DM_HEADER(<asm/irq.h>)
+   };
+
+Note that there is no dependency checking on the above, so U-Boot will not
+regenerate the dt-device.c file when you update the source file (here,
+`irq_sandbox.c`). You need to run `make mrproper` first to get a fresh build.
+
 
 Caveats
 -------
-- 
2.32.0.605.g8dce9f2422-goog


  parent reply	other threads:[~2021-08-07 13:26 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-07 13:24 [PATCH 00/12] dm: Expand of-platdata support to GPIOs and clean up Simon Glass
2021-08-07 13:24 ` [PATCH 01/12] treewide: fdt: Move fdt_get_config_... to ofnode_conf_read Simon Glass
2021-08-07 13:24 ` [PATCH 02/12] fdt: Create a new OF_REAL Kconfig Simon Glass
2021-08-07 13:24 ` [PATCH 03/12] treewide: Simply conditions with the new OF_REAL Simon Glass
2021-08-07 13:24 ` [PATCH 04/12] treewide: Use OF_REAL instead of !OF_PLATDATA Simon Glass
2021-08-07 13:24 ` [PATCH 05/12] mmc: nds32: ftsdc010: Convert to livetree Simon Glass
     [not found]   ` <HK0PR03MB299419BC349724622E422920C1F69@HK0PR03MB2994.apcprd03.prod.outlook.com>
2021-08-09  2:42     ` Rick Chen
2021-08-12 22:22   ` Jaehoon Chung
2021-09-26 18:40   ` Simon Glass
2021-08-07 13:24 ` [PATCH 06/12] treewide: Try to avoid the preprocessor with OF_REAL Simon Glass
2021-08-07 13:24 ` [PATCH 07/12] fdt: Update Makefile rules with the new OF_REAL Kconfig Simon Glass
2021-08-07 13:24 ` [PATCH 08/12] dm: Add comments to dt-structs contents Simon Glass
2021-08-07 13:24 ` [PATCH 09/12] clk: Rename clk_get_by_driver_info() Simon Glass
2021-08-09 16:41   ` Sean Anderson
2021-09-26 18:40   ` Simon Glass
2021-08-07 13:24 ` Simon Glass [this message]
2021-08-07 13:24 ` [PATCH 11/12] irq: Tidy up of-platdata irq support Simon Glass
2021-08-07 13:24 ` [PATCH 12/12] dm: gpio: Add of-platdata support Simon Glass
2021-09-26 18:40 ` Simon Glass
2021-09-26 18:40 ` [PATCH 11/12] irq: Tidy up of-platdata irq support Simon Glass
2021-09-26 18:40 ` [PATCH 10/12] dm: doc: Add a note about of-platdata header files Simon Glass
2021-09-26 18:40 ` [PATCH 08/12] dm: Add comments to dt-structs contents Simon Glass
2021-09-26 18:40 ` [PATCH 06/12] treewide: Try to avoid the preprocessor with OF_REAL Simon Glass
2021-09-26 18:40 ` [PATCH 07/12] fdt: Update Makefile rules with the new OF_REAL Kconfig Simon Glass
2021-09-26 18:40 ` [PATCH 04/12] treewide: Use OF_REAL instead of !OF_PLATDATA Simon Glass
2021-09-26 18:40 ` [PATCH 03/12] treewide: Simply conditions with the new OF_REAL Simon Glass
2021-09-26 18:40 ` [PATCH 01/12] treewide: fdt: Move fdt_get_config_... to ofnode_conf_read Simon Glass
2021-09-26 18:40 ` [PATCH 02/12] fdt: Create a new OF_REAL Kconfig Simon Glass

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=20210807132413.3513724-11-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=marex@denx.de \
    --cc=morpheus.ibis@gmail.com \
    --cc=trini@konsulko.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.