[PATCH 02/26] sandbox: i2c: Move priv into a header file

Simon Glass sjg at chromium.org
Sat Dec 19 18:39:54 CET 2020


Move this struct into a header file so that dtoc can include it in its
dt-platdata.c file.

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

 arch/sandbox/include/asm/i2c.h | 14 ++++++++++++++
 drivers/i2c/sandbox_i2c.c      |  5 +----
 2 files changed, 15 insertions(+), 4 deletions(-)
 create mode 100644 arch/sandbox/include/asm/i2c.h

diff --git a/arch/sandbox/include/asm/i2c.h b/arch/sandbox/include/asm/i2c.h
new file mode 100644
index 00000000000..b482be485ca
--- /dev/null
+++ b/arch/sandbox/include/asm/i2c.h
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2020 Google LLC
+ * Written by Simon Glass <sjg at chromium.org>
+ */
+
+#ifndef __asn_i2c_h
+#define __asn_i2c_h
+
+struct sandbox_i2c_priv {
+	bool test_mode;
+};
+
+#endif /* __asn_i2c_h */
diff --git a/drivers/i2c/sandbox_i2c.c b/drivers/i2c/sandbox_i2c.c
index a61dfc096b3..c99e6de9332 100644
--- a/drivers/i2c/sandbox_i2c.c
+++ b/drivers/i2c/sandbox_i2c.c
@@ -10,15 +10,12 @@
 #include <errno.h>
 #include <i2c.h>
 #include <log.h>
+#include <asm/i2c.h>
 #include <asm/test.h>
 #include <dm/acpi.h>
 #include <dm/lists.h>
 #include <dm/device-internal.h>
 
-struct sandbox_i2c_priv {
-	bool test_mode;
-};
-
 static int get_emul(struct udevice *dev, struct udevice **devp,
 		    struct dm_i2c_ops **opsp)
 {
-- 
2.29.2.684.gfbc64c5ab5-goog



More information about the U-Boot mailing list