Skip to content

Commit 2c94512

Browse files
andy-shevgregkh
authored andcommitted
serial: 8250_dw: Revert "Move definitions to the shared header"
This reverts commit d9666df. The container of the struct dw8250_port_data is private to the actual driver. In particular, 8250_lpss and 8250_dw use different data types that are assigned to the UART port private_data. Hence, it must not be used outside the specific driver. Fix the mistake made in the past by moving the respective definitions to the specific driver. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20240514190730.2787071-3-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 87d80bf commit 2c94512

File tree

2 files changed

+27
-32
lines changed

2 files changed

+27
-32
lines changed

drivers/tty/serial/8250/8250_dw.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,33 @@
5757
#define DW_UART_QUIRK_APMC0D08 BIT(4)
5858
#define DW_UART_QUIRK_CPR_VALUE BIT(5)
5959

60+
struct dw8250_platform_data {
61+
u8 usr_reg;
62+
u32 cpr_value;
63+
unsigned int quirks;
64+
};
65+
66+
struct dw8250_data {
67+
struct dw8250_port_data data;
68+
const struct dw8250_platform_data *pdata;
69+
70+
int msr_mask_on;
71+
int msr_mask_off;
72+
struct clk *clk;
73+
struct clk *pclk;
74+
struct notifier_block clk_notifier;
75+
struct work_struct clk_work;
76+
struct reset_control *rst;
77+
78+
unsigned int skip_autocfg:1;
79+
unsigned int uart_16550_compatible:1;
80+
};
81+
82+
static inline struct dw8250_data *to_dw8250_data(struct dw8250_port_data *data)
83+
{
84+
return container_of(data, struct dw8250_data, data);
85+
}
86+
6087
static inline struct dw8250_data *clk_to_dw8250_data(struct notifier_block *nb)
6188
{
6289
return container_of(nb, struct dw8250_data, clk_notifier);

drivers/tty/serial/8250/8250_dwlib.h

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,10 @@
22
/* Synopsys DesignWare 8250 library header file. */
33

44
#include <linux/io.h>
5-
#include <linux/notifier.h>
65
#include <linux/types.h>
7-
#include <linux/workqueue.h>
86

97
#include "8250.h"
108

11-
struct clk;
12-
struct reset_control;
13-
149
struct dw8250_port_data {
1510
/* Port properties */
1611
int line;
@@ -26,36 +21,9 @@ struct dw8250_port_data {
2621
bool hw_rs485_support;
2722
};
2823

29-
struct dw8250_platform_data {
30-
u8 usr_reg;
31-
u32 cpr_value;
32-
unsigned int quirks;
33-
};
34-
35-
struct dw8250_data {
36-
struct dw8250_port_data data;
37-
const struct dw8250_platform_data *pdata;
38-
39-
int msr_mask_on;
40-
int msr_mask_off;
41-
struct clk *clk;
42-
struct clk *pclk;
43-
struct notifier_block clk_notifier;
44-
struct work_struct clk_work;
45-
struct reset_control *rst;
46-
47-
unsigned int skip_autocfg:1;
48-
unsigned int uart_16550_compatible:1;
49-
};
50-
5124
void dw8250_do_set_termios(struct uart_port *p, struct ktermios *termios, const struct ktermios *old);
5225
void dw8250_setup_port(struct uart_port *p);
5326

54-
static inline struct dw8250_data *to_dw8250_data(struct dw8250_port_data *data)
55-
{
56-
return container_of(data, struct dw8250_data, data);
57-
}
58-
5927
static inline u32 dw8250_readl_ext(struct uart_port *p, int offset)
6028
{
6129
if (p->iotype == UPIO_MEM32BE)

0 commit comments

Comments
 (0)