Skip to content

Commit

Permalink
serial: sh-sci: Make sci_regmap[] const
Browse files Browse the repository at this point in the history
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Geert Uytterhoeven authored and Greg Kroah-Hartman committed Oct 4, 2015
1 parent d56a91e commit d3184e6
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions drivers/tty/serial/sh-sci.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ struct plat_sci_reg {
/* Helper for invalidating specific entries of an inherited map. */
#define sci_reg_invalid { .offset = 0, .size = 0 }

static struct plat_sci_reg sci_regmap[SCIx_NR_REGTYPES][SCIx_NR_REGS] = {
static const struct plat_sci_reg sci_regmap[SCIx_NR_REGTYPES][SCIx_NR_REGS] = {
[SCIx_PROBE_REGTYPE] = {
[0 ... SCIx_NR_REGS - 1] = sci_reg_invalid,
},
Expand Down Expand Up @@ -400,7 +400,7 @@ static struct plat_sci_reg sci_regmap[SCIx_NR_REGTYPES][SCIx_NR_REGS] = {
*/
static unsigned int sci_serial_in(struct uart_port *p, int offset)
{
struct plat_sci_reg *reg = sci_getreg(p, offset);
const struct plat_sci_reg *reg = sci_getreg(p, offset);

if (reg->size == 8)
return ioread8(p->membase + (reg->offset << p->regshift));
Expand All @@ -414,7 +414,7 @@ static unsigned int sci_serial_in(struct uart_port *p, int offset)

static void sci_serial_out(struct uart_port *p, int offset, int value)
{
struct plat_sci_reg *reg = sci_getreg(p, offset);
const struct plat_sci_reg *reg = sci_getreg(p, offset);

if (reg->size == 8)
iowrite8(value, p->membase + (reg->offset << p->regshift));
Expand Down Expand Up @@ -552,7 +552,7 @@ static void sci_poll_put_char(struct uart_port *port, unsigned char c)
static void sci_init_pins(struct uart_port *port, unsigned int cflag)
{
struct sci_port *s = to_sci_port(port);
struct plat_sci_reg *reg = sci_regmap[s->cfg->regtype] + SCSPTR;
const struct plat_sci_reg *reg = sci_regmap[s->cfg->regtype] + SCSPTR;

/*
* Use port-specific handler if provided.
Expand Down Expand Up @@ -582,7 +582,7 @@ static void sci_init_pins(struct uart_port *port, unsigned int cflag)

static int sci_txfill(struct uart_port *port)
{
struct plat_sci_reg *reg;
const struct plat_sci_reg *reg;

reg = sci_getreg(port, SCTFDR);
if (reg->size)
Expand All @@ -602,7 +602,7 @@ static int sci_txroom(struct uart_port *port)

static int sci_rxfill(struct uart_port *port)
{
struct plat_sci_reg *reg;
const struct plat_sci_reg *reg;

reg = sci_getreg(port, SCRFDR);
if (reg->size)
Expand Down Expand Up @@ -883,7 +883,7 @@ static int sci_handle_fifo_overrun(struct uart_port *port)
{
struct tty_port *tport = &port->state->port;
struct sci_port *s = to_sci_port(port);
struct plat_sci_reg *reg;
const struct plat_sci_reg *reg;
int copied = 0;
u16 status;

Expand Down Expand Up @@ -1250,7 +1250,7 @@ static unsigned int sci_tx_empty(struct uart_port *port)
static void sci_set_mctrl(struct uart_port *port, unsigned int mctrl)
{
if (mctrl & TIOCM_LOOP) {
struct plat_sci_reg *reg;
const struct plat_sci_reg *reg;

/*
* Standard loopback mode for SCFCR ports.
Expand Down Expand Up @@ -1621,7 +1621,7 @@ static void sci_stop_rx(struct uart_port *port)
static void sci_break_ctl(struct uart_port *port, int break_state)
{
struct sci_port *s = to_sci_port(port);
struct plat_sci_reg *reg = sci_regmap[s->cfg->regtype] + SCSPTR;
const struct plat_sci_reg *reg = sci_regmap[s->cfg->regtype] + SCSPTR;
unsigned short scscr, scsptr;

/* check wheter the port has SCSPTR */
Expand Down Expand Up @@ -1910,7 +1910,7 @@ static void sci_baud_calc_hscif(unsigned int bps, unsigned long freq,

static void sci_reset(struct uart_port *port)
{
struct plat_sci_reg *reg;
const struct plat_sci_reg *reg;
unsigned int status;

do {
Expand All @@ -1928,7 +1928,7 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
struct ktermios *old)
{
struct sci_port *s = to_sci_port(port);
struct plat_sci_reg *reg;
const struct plat_sci_reg *reg;
unsigned int baud, smr_val = 0, max_baud, cks = 0;
int t = -1;
unsigned int srr = 15;
Expand Down

0 comments on commit d3184e6

Please sign in to comment.