Commit b8ede90c authored by Paul Gortmaker's avatar Paul Gortmaker Committed by Greg Kroah-Hartman

m32r_sio: remove dependency on struct serial_uart_config

The struct serial_uart_config is hardly used at all, and the
use case like this one are somewhat needless.  Remove the
trivial usage so that we can remove serial_uart_config.

Since the type field isn't really used at all, we also delete
the initialization and references of it here as well.

Cc: Hirokazu Takata <takata@linux-m32r.org>
Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
Acked-by: default avatarAlan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 833462e9
...@@ -44,8 +44,6 @@ ...@@ -44,8 +44,6 @@
#include <asm/io.h> #include <asm/io.h>
#include <asm/irq.h> #include <asm/irq.h>
#define PORT_M32R_BASE PORT_M32R_SIO
#define PORT_INDEX(x) (x - PORT_M32R_BASE + 1)
#define BAUD_RATE 115200 #define BAUD_RATE 115200
#include <linux/serial_core.h> #include <linux/serial_core.h>
...@@ -132,22 +130,6 @@ struct irq_info { ...@@ -132,22 +130,6 @@ struct irq_info {
static struct irq_info irq_lists[NR_IRQS]; static struct irq_info irq_lists[NR_IRQS];
/*
* Here we define the default xmit fifo size used for each type of UART.
*/
static const struct serial_uart_config uart_config[] = {
[PORT_UNKNOWN] = {
.name = "unknown",
.dfl_xmit_fifo_size = 1,
.flags = 0,
},
[PORT_INDEX(PORT_M32R_SIO)] = {
.name = "M32RSIO",
.dfl_xmit_fifo_size = 1,
.flags = 0,
},
};
#ifdef CONFIG_SERIAL_M32R_PLDSIO #ifdef CONFIG_SERIAL_M32R_PLDSIO
#define __sio_in(x) inw((unsigned long)(x)) #define __sio_in(x) inw((unsigned long)(x))
...@@ -907,8 +889,7 @@ static void m32r_sio_config_port(struct uart_port *port, int unused) ...@@ -907,8 +889,7 @@ static void m32r_sio_config_port(struct uart_port *port, int unused)
spin_lock_irqsave(&up->port.lock, flags); spin_lock_irqsave(&up->port.lock, flags);
up->port.type = (PORT_M32R_SIO - PORT_M32R_BASE + 1); up->port.fifosize = 1;
up->port.fifosize = uart_config[up->port.type].dfl_xmit_fifo_size;
spin_unlock_irqrestore(&up->port.lock, flags); spin_unlock_irqrestore(&up->port.lock, flags);
} }
...@@ -916,23 +897,11 @@ static void m32r_sio_config_port(struct uart_port *port, int unused) ...@@ -916,23 +897,11 @@ static void m32r_sio_config_port(struct uart_port *port, int unused)
static int static int
m32r_sio_verify_port(struct uart_port *port, struct serial_struct *ser) m32r_sio_verify_port(struct uart_port *port, struct serial_struct *ser)
{ {
if (ser->irq >= nr_irqs || ser->irq < 0 || if (ser->irq >= nr_irqs || ser->irq < 0 || ser->baud_base < 9600)
ser->baud_base < 9600 || ser->type < PORT_UNKNOWN ||
ser->type >= ARRAY_SIZE(uart_config))
return -EINVAL; return -EINVAL;
return 0; return 0;
} }
static const char *
m32r_sio_type(struct uart_port *port)
{
int type = port->type;
if (type >= ARRAY_SIZE(uart_config))
type = 0;
return uart_config[type].name;
}
static struct uart_ops m32r_sio_pops = { static struct uart_ops m32r_sio_pops = {
.tx_empty = m32r_sio_tx_empty, .tx_empty = m32r_sio_tx_empty,
.set_mctrl = m32r_sio_set_mctrl, .set_mctrl = m32r_sio_set_mctrl,
...@@ -946,7 +915,6 @@ static struct uart_ops m32r_sio_pops = { ...@@ -946,7 +915,6 @@ static struct uart_ops m32r_sio_pops = {
.shutdown = m32r_sio_shutdown, .shutdown = m32r_sio_shutdown,
.set_termios = m32r_sio_set_termios, .set_termios = m32r_sio_set_termios,
.pm = m32r_sio_pm, .pm = m32r_sio_pm,
.type = m32r_sio_type,
.release_port = m32r_sio_release_port, .release_port = m32r_sio_release_port,
.request_port = m32r_sio_request_port, .request_port = m32r_sio_request_port,
.config_port = m32r_sio_config_port, .config_port = m32r_sio_config_port,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment