Skip to content

Commit

Permalink
m32r_sio: remove dependency on struct serial_uart_config
Browse files Browse the repository at this point in the history
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: Paul Gortmaker <paul.gortmaker@windriver.com>
Acked-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Paul Gortmaker authored and Greg Kroah-Hartman committed Sep 5, 2012
1 parent 833462e commit b8ede90
Showing 1 changed file with 2 additions and 34 deletions.
36 changes: 2 additions & 34 deletions drivers/tty/serial/m32r_sio.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@
#include <asm/io.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

#include <linux/serial_core.h>
Expand Down Expand Up @@ -132,22 +130,6 @@ struct irq_info {

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

#define __sio_in(x) inw((unsigned long)(x))
Expand Down Expand Up @@ -907,32 +889,19 @@ static void m32r_sio_config_port(struct uart_port *port, int unused)

spin_lock_irqsave(&up->port.lock, flags);

up->port.type = (PORT_M32R_SIO - PORT_M32R_BASE + 1);
up->port.fifosize = uart_config[up->port.type].dfl_xmit_fifo_size;
up->port.fifosize = 1;

spin_unlock_irqrestore(&up->port.lock, flags);
}

static int
m32r_sio_verify_port(struct uart_port *port, struct serial_struct *ser)
{
if (ser->irq >= nr_irqs || ser->irq < 0 ||
ser->baud_base < 9600 || ser->type < PORT_UNKNOWN ||
ser->type >= ARRAY_SIZE(uart_config))
if (ser->irq >= nr_irqs || ser->irq < 0 || ser->baud_base < 9600)
return -EINVAL;
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 = {
.tx_empty = m32r_sio_tx_empty,
.set_mctrl = m32r_sio_set_mctrl,
Expand All @@ -946,7 +915,6 @@ static struct uart_ops m32r_sio_pops = {
.shutdown = m32r_sio_shutdown,
.set_termios = m32r_sio_set_termios,
.pm = m32r_sio_pm,
.type = m32r_sio_type,
.release_port = m32r_sio_release_port,
.request_port = m32r_sio_request_port,
.config_port = m32r_sio_config_port,
Expand Down

0 comments on commit b8ede90

Please sign in to comment.