Skip to content

Commit 4c48970

Browse files
MingcongBaiKexyBiscuit
authored andcommitted
AOSCOS: staging: sb105x: convert old ktermios to a const
Per commit a8c11c1 ("tty: Make ->set_termios() old ktermios const"), the "old ktermios" would get discarded and there is therefore no point to modify its value assignment. Convert all relevant functions prototypes to adapt to this change. Fixes: "AOSCOS: Revert "staging: sb105x: delete the driver"" Signed-off-by: Mingcong Bai <[email protected]> Signed-off-by: Kexy Biscuit <[email protected]>
1 parent 5e51d82 commit 4c48970

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

drivers/staging/sb105x/sb_pci_mp.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static void mp_tasklet_action(unsigned long data);
3333
static inline void mp_update_mctrl(struct sb_uart_port *port, unsigned int set, unsigned int clear);
3434
static int mp_startup(struct sb_uart_state *state, int init_hw);
3535
static void mp_shutdown(struct sb_uart_state *state);
36-
static void mp_change_speed(struct sb_uart_state *state, struct MP_TERMIOS *old_termios);
36+
static void mp_change_speed(struct sb_uart_state *state, const struct MP_TERMIOS *old_termios);
3737

3838
static inline int __mp_put_char(struct sb_uart_port *port, struct circ_buf *circ, unsigned char c);
3939
static int mp_put_char(struct tty_struct *tty, unsigned char ch);
@@ -57,7 +57,7 @@ static int mp_do_autoconfig(struct sb_uart_state *state);
5757
static int mp_wait_modem_status(struct sb_uart_state *state, unsigned long arg);
5858
static int mp_get_count(struct sb_uart_state *state, struct serial_icounter_struct *icnt);
5959
static int mp_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg);
60-
static void mp_set_termios(struct tty_struct *tty, struct MP_TERMIOS *old_termios);
60+
static void mp_set_termios(struct tty_struct *tty, const struct MP_TERMIOS *old_termios);
6161
static void mp_close(struct tty_struct *tty, struct file *filp);
6262
static void mp_wait_until_sent(struct tty_struct *tty, int timeout);
6363
static void mp_hangup(struct tty_struct *tty);
@@ -96,7 +96,7 @@ static void multi_break_ctl(struct sb_uart_port *port, int break_state);
9696
static int multi_startup(struct sb_uart_port *port);
9797
static void multi_shutdown(struct sb_uart_port *port);
9898
static unsigned int multi_get_divisor(struct sb_uart_port *port, unsigned int baud);
99-
static void multi_set_termios(struct sb_uart_port *port, struct MP_TERMIOS *termios, struct MP_TERMIOS *old);
99+
static void multi_set_termios(struct sb_uart_port *port, struct MP_TERMIOS *termios, const struct MP_TERMIOS *old);
100100
static void multi_pm(struct sb_uart_port *port, unsigned int state, unsigned int oldstate);
101101
static void multi_release_std_resource(struct mp_port *mtpt);
102102
static void multi_release_port(struct sb_uart_port *port);
@@ -586,7 +586,7 @@ static void mp_shutdown(struct sb_uart_state *state)
586586
}
587587
}
588588

589-
static void mp_change_speed(struct sb_uart_state *state, struct MP_TERMIOS *old_termios)
589+
static void mp_change_speed(struct sb_uart_state *state, const struct MP_TERMIOS *old_termios)
590590
{
591591
struct tty_struct *tty = state->info->tty;
592592
struct sb_uart_port *port = state->port;
@@ -1264,7 +1264,7 @@ static int mp_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg)
12641264
return ret;
12651265
}
12661266

1267-
static void mp_set_termios(struct tty_struct *tty, struct MP_TERMIOS *old_termios)
1267+
static void mp_set_termios(struct tty_struct *tty, const struct MP_TERMIOS *old_termios)
12681268
{
12691269
struct sb_uart_state *state = tty->driver_data;
12701270
unsigned long flags;
@@ -2510,7 +2510,7 @@ static unsigned int multi_get_divisor(struct sb_uart_port *port, unsigned int ba
25102510

25112511

25122512

2513-
static void multi_set_termios(struct sb_uart_port *port, struct MP_TERMIOS *termios, struct MP_TERMIOS *old)
2513+
static void multi_set_termios(struct sb_uart_port *port, struct MP_TERMIOS *termios, const struct MP_TERMIOS *old)
25142514
{
25152515
struct mp_port *mtpt = (struct mp_port *)port;
25162516
unsigned char cval, fcr = 0;

drivers/staging/sb105x/sb_ser_core.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ struct sb_uart_ops {
7777
int (*startup)(struct sb_uart_port *);
7878
void (*shutdown)(struct sb_uart_port *);
7979
void (*set_termios)(struct sb_uart_port *, struct MP_TERMIOS *new,
80-
struct MP_TERMIOS *old);
80+
const struct MP_TERMIOS *old);
8181
void (*pm)(struct sb_uart_port *, unsigned int state,
8282
unsigned int oldstate);
8383
int (*set_wake)(struct sb_uart_port *, unsigned int state);
@@ -241,7 +241,7 @@ static void sb_uart_update_timeout(struct sb_uart_port *port, unsigned int cflag
241241
port->timeout = (HZ * bits) / baud + HZ/50;
242242
}
243243
static unsigned int sb_uart_get_baud_rate(struct sb_uart_port *port, struct MP_TERMIOS *termios,
244-
struct MP_TERMIOS *old, unsigned int min,
244+
const struct MP_TERMIOS *old, unsigned int min,
245245
unsigned int max)
246246
{
247247
unsigned int try, baud, altbaud = 38400;

0 commit comments

Comments
 (0)