[PATCH v1 02/12] serial: cpm_uart: Remove stale prototypes and table and macros

From: Christophe Leroy
Date: Thu Aug 03 2023 - 10:21:11 EST


cpm_uart_init_portdesc()
smc1_lineif()
smc2_lineif()
scc1_lineif()
scc2_lineif()
scc3_lineif()
scc4_lineif()

Those functions were removed by commit 0b2a2e5b7747 ("cpm_uart: Remove
!CONFIG_PPC_CPM_NEW_BINDING code"). Remove stale prototypes.

UART_SMC{1..2} and UART_SCC{1..4} and SCC_WAIT_CLOSING macros are not
used anymore since the above commit.

cpm_uart_ports[] isn't used outside cpm_uart_core.c since the
same commit, so make it static.

cpm_uart_init_smc() and cpm_uart_init_scc() don't need a forward
declaration.

FLAG_DISCARDING and IS_DISCARDING have never been used since at
least 2.6.12 and the start of git repository for kernel.

Signed-off-by: Christophe Leroy <christophe.leroy@xxxxxxxxxx>
---
drivers/tty/serial/cpm_uart/cpm_uart.h | 21 ---------------------
drivers/tty/serial/cpm_uart/cpm_uart_core.c | 4 +---
2 files changed, 1 insertion(+), 24 deletions(-)

diff --git a/drivers/tty/serial/cpm_uart/cpm_uart.h b/drivers/tty/serial/cpm_uart/cpm_uart.h
index 46c03ed71c31..687b48fc6fb6 100644
--- a/drivers/tty/serial/cpm_uart/cpm_uart.h
+++ b/drivers/tty/serial/cpm_uart/cpm_uart.h
@@ -25,18 +25,9 @@ struct gpio_desc;
#define SERIAL_CPM_MINOR 46

#define IS_SMC(pinfo) (pinfo->flags & FLAG_SMC)
-#define IS_DISCARDING(pinfo) (pinfo->flags & FLAG_DISCARDING)
-#define FLAG_DISCARDING 0x00000004 /* when set, don't discard */
#define FLAG_SMC 0x00000002
#define FLAG_CONSOLE 0x00000001

-#define UART_SMC1 fsid_smc1_uart
-#define UART_SMC2 fsid_smc2_uart
-#define UART_SCC1 fsid_scc1_uart
-#define UART_SCC2 fsid_scc2_uart
-#define UART_SCC3 fsid_scc3_uart
-#define UART_SCC4 fsid_scc4_uart
-
#define UART_NR fs_uart_nr

#define RX_NUM_FIFO 4
@@ -44,8 +35,6 @@ struct gpio_desc;
#define TX_NUM_FIFO 4
#define TX_BUF_SIZE 32

-#define SCC_WAIT_CLOSING 100
-
#define GPIO_CTS 0
#define GPIO_RTS 1
#define GPIO_DCD 2
@@ -85,24 +74,14 @@ struct uart_cpm_port {
struct gpio_desc *gpios[NUM_GPIOS];
};

-extern struct uart_cpm_port cpm_uart_ports[UART_NR];
-
/* these are located in their respective files */
void cpm_line_cr_cmd(struct uart_cpm_port *port, int cmd);
void __iomem *cpm_uart_map_pram(struct uart_cpm_port *port,
struct device_node *np);
void cpm_uart_unmap_pram(struct uart_cpm_port *port, void __iomem *pram);
-int cpm_uart_init_portdesc(void);
int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con);
void cpm_uart_freebuf(struct uart_cpm_port *pinfo);

-void smc1_lineif(struct uart_cpm_port *pinfo);
-void smc2_lineif(struct uart_cpm_port *pinfo);
-void scc1_lineif(struct uart_cpm_port *pinfo);
-void scc2_lineif(struct uart_cpm_port *pinfo);
-void scc3_lineif(struct uart_cpm_port *pinfo);
-void scc4_lineif(struct uart_cpm_port *pinfo);
-
/*
virtual to phys transtalion
*/
diff --git a/drivers/tty/serial/cpm_uart/cpm_uart_core.c b/drivers/tty/serial/cpm_uart/cpm_uart_core.c
index 71366a4cea22..d804dd4019c0 100644
--- a/drivers/tty/serial/cpm_uart/cpm_uart_core.c
+++ b/drivers/tty/serial/cpm_uart/cpm_uart_core.c
@@ -48,8 +48,6 @@
/**************************************************************/

static int cpm_uart_tx_pump(struct uart_port *port);
-static void cpm_uart_init_smc(struct uart_cpm_port *pinfo);
-static void cpm_uart_init_scc(struct uart_cpm_port *pinfo);
static void cpm_uart_initbd(struct uart_cpm_port *pinfo);

/**************************************************************/
@@ -1128,7 +1126,7 @@ static const struct uart_ops cpm_uart_pops = {
#endif
};

-struct uart_cpm_port cpm_uart_ports[UART_NR];
+static struct uart_cpm_port cpm_uart_ports[UART_NR];

static int cpm_uart_init_port(struct device_node *np,
struct uart_cpm_port *pinfo)
--
2.41.0