diff mbox series

[v4,1/9] serial: 8250: dw: Move definitions to the shared header

Message ID 20220330132038.808679-2-miquel.raynal@bootlin.com (mailing list archive)
State Superseded
Delegated to: Geert Uytterhoeven
Headers show
Series serial: 8250: dw: RZN1 DMA support | expand

Commit Message

Miquel Raynal March 30, 2022, 1:20 p.m. UTC
From: Phil Edworthy <phil.edworthy@renesas.com>

Move the per-device structure and a helper out of the main .c file, into
a shared header as they will both be reused from another .c file.

There is no functional change.

Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
[miquel.raynal@bootlin.com: Extracted from a bigger change]
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/tty/serial/8250/8250_dw.c    | 21 ---------------------
 drivers/tty/serial/8250/8250_dwlib.h | 26 ++++++++++++++++++++++++++
 2 files changed, 26 insertions(+), 21 deletions(-)

Comments

Andy Shevchenko March 30, 2022, 2:08 p.m. UTC | #1
On Wed, Mar 30, 2022 at 03:20:30PM +0200, Miquel Raynal wrote:
> From: Phil Edworthy <phil.edworthy@renesas.com>
> 
> Move the per-device structure and a helper out of the main .c file, into
> a shared header as they will both be reused from another .c file.
> 
> There is no functional change.

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

> Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
> [miquel.raynal@bootlin.com: Extracted from a bigger change]
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---
>  drivers/tty/serial/8250/8250_dw.c    | 21 ---------------------
>  drivers/tty/serial/8250/8250_dwlib.h | 26 ++++++++++++++++++++++++++
>  2 files changed, 26 insertions(+), 21 deletions(-)
> 
> diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
> index 96a62e95726b..1666041513a5 100644
> --- a/drivers/tty/serial/8250/8250_dw.c
> +++ b/drivers/tty/serial/8250/8250_dw.c
> @@ -42,27 +42,6 @@
>  #define DW_UART_QUIRK_ARMADA_38X	BIT(1)
>  #define DW_UART_QUIRK_SKIP_SET_RATE	BIT(2)
>  
> -struct dw8250_data {
> -	struct dw8250_port_data	data;
> -
> -	u8			usr_reg;
> -	int			msr_mask_on;
> -	int			msr_mask_off;
> -	struct clk		*clk;
> -	struct clk		*pclk;
> -	struct notifier_block	clk_notifier;
> -	struct work_struct	clk_work;
> -	struct reset_control	*rst;
> -
> -	unsigned int		skip_autocfg:1;
> -	unsigned int		uart_16550_compatible:1;
> -};
> -
> -static inline struct dw8250_data *to_dw8250_data(struct dw8250_port_data *data)
> -{
> -	return container_of(data, struct dw8250_data, data);
> -}
> -
>  static inline struct dw8250_data *clk_to_dw8250_data(struct notifier_block *nb)
>  {
>  	return container_of(nb, struct dw8250_data, clk_notifier);
> diff --git a/drivers/tty/serial/8250/8250_dwlib.h b/drivers/tty/serial/8250/8250_dwlib.h
> index 83d528e5cc21..72e7dbcccad0 100644
> --- a/drivers/tty/serial/8250/8250_dwlib.h
> +++ b/drivers/tty/serial/8250/8250_dwlib.h
> @@ -1,10 +1,15 @@
>  /* SPDX-License-Identifier: GPL-2.0+ */
>  /* Synopsys DesignWare 8250 library header file. */
>  
> +#include <linux/notifier.h>
>  #include <linux/types.h>
> +#include <linux/workqueue.h>
>  
>  #include "8250.h"
>  
> +struct clk;
> +struct reset_control;
> +
>  struct dw8250_port_data {
>  	/* Port properties */
>  	int			line;
> @@ -16,5 +21,26 @@ struct dw8250_port_data {
>  	u8			dlf_size;
>  };
>  
> +struct dw8250_data {
> +	struct dw8250_port_data	data;
> +
> +	u8			usr_reg;
> +	int			msr_mask_on;
> +	int			msr_mask_off;
> +	struct clk		*clk;
> +	struct clk		*pclk;
> +	struct notifier_block	clk_notifier;
> +	struct work_struct	clk_work;
> +	struct reset_control	*rst;
> +
> +	unsigned int		skip_autocfg:1;
> +	unsigned int		uart_16550_compatible:1;
> +};
> +
>  void dw8250_do_set_termios(struct uart_port *p, struct ktermios *termios, struct ktermios *old);
>  void dw8250_setup_port(struct uart_port *p);
> +
> +static inline struct dw8250_data *to_dw8250_data(struct dw8250_port_data *data)
> +{
> +	return container_of(data, struct dw8250_data, data);
> +}
> -- 
> 2.27.0
>
diff mbox series

Patch

diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
index 96a62e95726b..1666041513a5 100644
--- a/drivers/tty/serial/8250/8250_dw.c
+++ b/drivers/tty/serial/8250/8250_dw.c
@@ -42,27 +42,6 @@ 
 #define DW_UART_QUIRK_ARMADA_38X	BIT(1)
 #define DW_UART_QUIRK_SKIP_SET_RATE	BIT(2)
 
-struct dw8250_data {
-	struct dw8250_port_data	data;
-
-	u8			usr_reg;
-	int			msr_mask_on;
-	int			msr_mask_off;
-	struct clk		*clk;
-	struct clk		*pclk;
-	struct notifier_block	clk_notifier;
-	struct work_struct	clk_work;
-	struct reset_control	*rst;
-
-	unsigned int		skip_autocfg:1;
-	unsigned int		uart_16550_compatible:1;
-};
-
-static inline struct dw8250_data *to_dw8250_data(struct dw8250_port_data *data)
-{
-	return container_of(data, struct dw8250_data, data);
-}
-
 static inline struct dw8250_data *clk_to_dw8250_data(struct notifier_block *nb)
 {
 	return container_of(nb, struct dw8250_data, clk_notifier);
diff --git a/drivers/tty/serial/8250/8250_dwlib.h b/drivers/tty/serial/8250/8250_dwlib.h
index 83d528e5cc21..72e7dbcccad0 100644
--- a/drivers/tty/serial/8250/8250_dwlib.h
+++ b/drivers/tty/serial/8250/8250_dwlib.h
@@ -1,10 +1,15 @@ 
 /* SPDX-License-Identifier: GPL-2.0+ */
 /* Synopsys DesignWare 8250 library header file. */
 
+#include <linux/notifier.h>
 #include <linux/types.h>
+#include <linux/workqueue.h>
 
 #include "8250.h"
 
+struct clk;
+struct reset_control;
+
 struct dw8250_port_data {
 	/* Port properties */
 	int			line;
@@ -16,5 +21,26 @@  struct dw8250_port_data {
 	u8			dlf_size;
 };
 
+struct dw8250_data {
+	struct dw8250_port_data	data;
+
+	u8			usr_reg;
+	int			msr_mask_on;
+	int			msr_mask_off;
+	struct clk		*clk;
+	struct clk		*pclk;
+	struct notifier_block	clk_notifier;
+	struct work_struct	clk_work;
+	struct reset_control	*rst;
+
+	unsigned int		skip_autocfg:1;
+	unsigned int		uart_16550_compatible:1;
+};
+
 void dw8250_do_set_termios(struct uart_port *p, struct ktermios *termios, struct ktermios *old);
 void dw8250_setup_port(struct uart_port *p);
+
+static inline struct dw8250_data *to_dw8250_data(struct dw8250_port_data *data)
+{
+	return container_of(data, struct dw8250_data, data);
+}