diff mbox series

[01/26] sandbox: serial: Move priv into a header file

Message ID 20201219103947.1.I427a5dd4b053a0ee590f64f7a41ca4d3e6af26d8@changeid
State Accepted
Commit bfae6cc48afa5bc22703c93af70b27501900f56a
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/serial.h | 30 ++++++++++++++++++++++++++++++
 drivers/serial/sandbox.c          | 16 +---------------
 2 files changed, 31 insertions(+), 15 deletions(-)
 create mode 100644 arch/sandbox/include/asm/serial.h

Comments

Andy Shevchenko Dec. 21, 2020, 11:38 a.m. UTC | #1
On Sat, Dec 19, 2020 at 10:39:53AM -0700, Simon Glass wrote:
> Move this struct into a header file so that dtoc can include it in its
> dt-platdata.c file.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
> 
>  arch/sandbox/include/asm/serial.h | 30 ++++++++++++++++++++++++++++++
>  drivers/serial/sandbox.c          | 16 +---------------
>  2 files changed, 31 insertions(+), 15 deletions(-)
>  create mode 100644 arch/sandbox/include/asm/serial.h
> 
> diff --git a/arch/sandbox/include/asm/serial.h b/arch/sandbox/include/asm/serial.h
> new file mode 100644
> index 00000000000..bc82aebd0ea
> --- /dev/null
> +++ b/arch/sandbox/include/asm/serial.h
> @@ -0,0 +1,30 @@
> +/* SPDX-License-Identifier: GPL-2.0+ */
> +/*
> + * Copyright 2020 Google LLC
> + * Written by Simon Glass <sjg@chromium.org>
> + */
> +
> +#ifndef __asm_serial_h
> +#define __asm_serial_h
> +
> +#include <dt-structs.h>
> +
> +struct sandbox_serial_plat {
> +#if CONFIG_IS_ENABLED(OF_PLATDATA)
> +	struct dtd_sandbox_serial dtplat;
> +#endif
> +	int colour;	/* Text colour to use for output, -1 for none */
> +};
> +
> +/**
> + * struct sandbox_serial_priv - Private data for this driver
> + *
> + * @buf: holds input characters available to be read by this driver
> + */
> +struct sandbox_serial_priv {
> +	struct membuff buf;
> +	char serial_buf[16];
> +	bool start_of_line;
> +};
> +
> +#endif /* __asm_serial_h */
> diff --git a/drivers/serial/sandbox.c b/drivers/serial/sandbox.c
> index a05c56458b0..19368ba2560 100644
> --- a/drivers/serial/sandbox.c
> +++ b/drivers/serial/sandbox.c
> @@ -17,25 +17,11 @@
>  #include <serial.h>
>  #include <video.h>
>  #include <linux/compiler.h>
> +#include <asm/serial.h>
>  #include <asm/state.h>
>  
>  DECLARE_GLOBAL_DATA_PTR;
>  
> -struct sandbox_serial_plat {
> -	int colour;	/* Text colour to use for output, -1 for none */
> -};
> -
> -/**
> - * struct sandbox_serial_priv - Private data for this driver
> - *
> - * @buf: holds input characters available to be read by this driver
> - */
> -struct sandbox_serial_priv {
> -	struct membuff buf;
> -	char serial_buf[16];
> -	bool start_of_line;
> -};
> -
>  /**
>   * output_ansi_colour() - Output an ANSI colour code
>   *
> -- 
> 2.29.2.684.gfbc64c5ab5-goog
>
Simon Glass Dec. 28, 2020, 4:26 p.m. UTC | #2
On Sat, Dec 19, 2020 at 10:39:53AM -0700, Simon Glass wrote:
> Move this struct into a header file so that dtoc can include it in its
> dt-platdata.c file.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
>  arch/sandbox/include/asm/serial.h | 30 ++++++++++++++++++++++++++++++
>  drivers/serial/sandbox.c          | 16 +---------------
>  2 files changed, 31 insertions(+), 15 deletions(-)
>  create mode 100644 arch/sandbox/include/asm/serial.h
>
Applied to u-boot-dm/next, thanks!
diff mbox series

Patch

diff --git a/arch/sandbox/include/asm/serial.h b/arch/sandbox/include/asm/serial.h
new file mode 100644
index 00000000000..bc82aebd0ea
--- /dev/null
+++ b/arch/sandbox/include/asm/serial.h
@@ -0,0 +1,30 @@ 
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2020 Google LLC
+ * Written by Simon Glass <sjg@chromium.org>
+ */
+
+#ifndef __asm_serial_h
+#define __asm_serial_h
+
+#include <dt-structs.h>
+
+struct sandbox_serial_plat {
+#if CONFIG_IS_ENABLED(OF_PLATDATA)
+	struct dtd_sandbox_serial dtplat;
+#endif
+	int colour;	/* Text colour to use for output, -1 for none */
+};
+
+/**
+ * struct sandbox_serial_priv - Private data for this driver
+ *
+ * @buf: holds input characters available to be read by this driver
+ */
+struct sandbox_serial_priv {
+	struct membuff buf;
+	char serial_buf[16];
+	bool start_of_line;
+};
+
+#endif /* __asm_serial_h */
diff --git a/drivers/serial/sandbox.c b/drivers/serial/sandbox.c
index a05c56458b0..19368ba2560 100644
--- a/drivers/serial/sandbox.c
+++ b/drivers/serial/sandbox.c
@@ -17,25 +17,11 @@ 
 #include <serial.h>
 #include <video.h>
 #include <linux/compiler.h>
+#include <asm/serial.h>
 #include <asm/state.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
-struct sandbox_serial_plat {
-	int colour;	/* Text colour to use for output, -1 for none */
-};
-
-/**
- * struct sandbox_serial_priv - Private data for this driver
- *
- * @buf: holds input characters available to be read by this driver
- */
-struct sandbox_serial_priv {
-	struct membuff buf;
-	char serial_buf[16];
-	bool start_of_line;
-};
-
 /**
  * output_ansi_colour() - Output an ANSI colour code
  *