[PATCH 05/19] expo: Split out cedit into its own header

Simon Glass sjg at chromium.org
Tue Aug 15 00:40:25 CEST 2023


Before adding more functions to this interface, create a new header for
the configuration editor.

Fix up the expo header guard while we are here.

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

 boot/cedit.c    |  1 +
 cmd/cedit.c     |  1 +
 include/cedit.h | 33 +++++++++++++++++++++++++++++++++
 include/expo.h  | 27 +++------------------------
 4 files changed, 38 insertions(+), 24 deletions(-)
 create mode 100644 include/cedit.h

diff --git a/boot/cedit.c b/boot/cedit.c
index ee24658917bc..2d16086bad63 100644
--- a/boot/cedit.c
+++ b/boot/cedit.c
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <cedit.h>
 #include <cli.h>
 #include <dm.h>
 #include <expo.h>
diff --git a/cmd/cedit.c b/cmd/cedit.c
index 0cae304c4adc..5f0e84403f5b 100644
--- a/cmd/cedit.c
+++ b/cmd/cedit.c
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <cedit.h>
 #include <command.h>
 #include <expo.h>
 #include <fs.h>
diff --git a/include/cedit.h b/include/cedit.h
new file mode 100644
index 000000000000..21de12dfe7a9
--- /dev/null
+++ b/include/cedit.h
@@ -0,0 +1,33 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2023 Google LLC
+ * Written by Simon Glass <sjg at chromium.org>
+ */
+
+#ifndef __CEDIT_H
+#define __CEDIT_H
+
+struct expo;
+struct video_priv;
+
+/**
+ * cedit_arange() - Arrange objects in a configuration-editor scene
+ *
+ * @exp: Expo to update
+ * @vid_priv: Private info of the video device
+ * @scene_id: scene ID to arrange
+ * Returns: 0 if OK, -ve on error
+ */
+int cedit_arange(struct expo *exp, struct video_priv *vid_priv, uint scene_id);
+
+/**
+ * cedit_run() - Run a configuration editor
+ *
+ * This accepts input until the user quits with Escape
+ *
+ * @exp: Expo to use
+ * Returns: 0 if OK, -ve on error
+ */
+int cedit_run(struct expo *exp);
+
+#endif /* __CEDIT_H */
diff --git a/include/expo.h b/include/expo.h
index 0b1d944a169f..da151074d207 100644
--- a/include/expo.h
+++ b/include/expo.h
@@ -4,14 +4,13 @@
  * Written by Simon Glass <sjg at chromium.org>
  */
 
-#ifndef __SCENE_H
-#define __SCENE_H
+#ifndef __EXPO_H
+#define __EXPO_H
 
 #include <dm/ofnode_decl.h>
 #include <linux/list.h>
 
 struct udevice;
-struct video_priv;
 
 /**
  * enum expoact_type - types of actions reported by the expo
@@ -676,24 +675,4 @@ int expo_apply_theme(struct expo *exp, ofnode node);
  */
 int expo_build(ofnode root, struct expo **expp);
 
-/**
- * cedit_arange() - Arrange objects in a configuration-editor scene
- *
- * @exp: Expo to update
- * @vid_priv: Private info of the video device
- * @scene_id: scene ID to arrange
- * Returns: 0 if OK, -ve on error
- */
-int cedit_arange(struct expo *exp, struct video_priv *vid_priv, uint scene_id);
-
-/**
- * cedit_run() - Run a configuration editor
- *
- * This accepts input until the user quits with Escape
- *
- * @exp: Expo to use
- * Returns: 0 if OK, -ve on error
- */
-int cedit_run(struct expo *exp);
-
-#endif /*__SCENE_H */
+#endif /*__EXPO_H */
-- 
2.41.0.694.ge786442a9b-goog



More information about the U-Boot mailing list