diff mbox series

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

Message ID 20201219103947.2.I6577055c4135c458341143d9011963899c877bdd@changeid
State Accepted
Commit f05a7c5ba452c3cee34378ed2ecc206c1605fce1
Delegated to: Simon Glass
Headers show
Series dm: Preparation for enhanced of-platdata (part C) | expand

Commit Message

Simon Glass Dec. 19, 2020, 5:39 p.m. UTC
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@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

Comments

Simon Glass Dec. 28, 2020, 4:26 p.m. UTC | #1
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@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

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

Patch

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@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)
 {