diff mbox series

[01/20] sandbox: Drop ad-hoc device declarations in SPL

Message ID 20201003173142.3213123-2-sjg@chromium.org
State Accepted
Commit c14732984759d64634350d01d58daca8cf44d23f
Delegated to: Simon Glass
Headers show
Series [01/20] sandbox: Drop ad-hoc device declarations in SPL | expand

Commit Message

Simon Glass Oct. 3, 2020, 5:31 p.m. UTC
Since sandbox's SPL is build with of-platadata, we should not use
U_BOOT_DEVICE() declarations as well. Drop them.

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

 board/sandbox/sandbox.c             | 2 ++
 drivers/serial/sandbox.c            | 3 +++
 drivers/sysreset/sysreset_sandbox.c | 2 ++
 3 files changed, 7 insertions(+)

Comments

Simon Glass Oct. 27, 2020, 1:01 a.m. UTC | #1
Since sandbox's SPL is build with of-platadata, we should not use
U_BOOT_DEVICE() declarations as well. Drop them.

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

 board/sandbox/sandbox.c             | 2 ++
 drivers/serial/sandbox.c            | 3 +++
 drivers/sysreset/sysreset_sandbox.c | 2 ++
 3 files changed, 7 insertions(+)

Applied to u-boot-dm, thanks!
diff mbox series

Patch

diff --git a/board/sandbox/sandbox.c b/board/sandbox/sandbox.c
index 937ce284111..18a605de026 100644
--- a/board/sandbox/sandbox.c
+++ b/board/sandbox/sandbox.c
@@ -21,10 +21,12 @@ 
  */
 gd_t *gd;
 
+#if !CONFIG_IS_ENABLED(OF_PLATDATA)
 /* Add a simple GPIO device */
 U_BOOT_DEVICE(gpio_sandbox) = {
 	.name = "sandbox_gpio",
 };
+#endif
 
 void flush_cache(unsigned long start, unsigned long size)
 {
diff --git a/drivers/serial/sandbox.c b/drivers/serial/sandbox.c
index f09d291e043..db2fbac6295 100644
--- a/drivers/serial/sandbox.c
+++ b/drivers/serial/sandbox.c
@@ -267,6 +267,7 @@  U_BOOT_DRIVER(sandbox_serial) = {
 	.flags = DM_FLAG_PRE_RELOC,
 };
 
+#if !CONFIG_IS_ENABLED(OF_PLATDATA)
 static const struct sandbox_serial_platdata platdata_non_fdt = {
 	.colour = -1,
 };
@@ -275,4 +276,6 @@  U_BOOT_DEVICE(serial_sandbox_non_fdt) = {
 	.name = "sandbox_serial",
 	.platdata = &platdata_non_fdt,
 };
+#endif
+
 #endif /* CONFIG_IS_ENABLED(OF_CONTROL) */
diff --git a/drivers/sysreset/sysreset_sandbox.c b/drivers/sysreset/sysreset_sandbox.c
index 69c22a70008..71cabd19568 100644
--- a/drivers/sysreset/sysreset_sandbox.c
+++ b/drivers/sysreset/sysreset_sandbox.c
@@ -130,7 +130,9 @@  U_BOOT_DRIVER(warm_sysreset_sandbox) = {
 	.ops		= &sandbox_warm_sysreset_ops,
 };
 
+#if !CONFIG_IS_ENABLED(OF_PLATDATA)
 /* This is here in case we don't have a device tree */
 U_BOOT_DEVICE(sysreset_sandbox_non_fdt) = {
 	.name = "sysreset_sandbox",
 };
+#endif