@@ -164,7 +164,7 @@ static void s3c24xx_serial_tx_chars(struct s3c24xx_uart_port *ourport);
164
164
#define portaddrl (port , reg ) \
165
165
((unsigned long *)(unsigned long)((port)->membase + (reg)))
166
166
167
- static u32 rd_reg (struct uart_port * port , u32 reg )
167
+ static u32 rd_reg (const struct uart_port * port , u32 reg )
168
168
{
169
169
switch (port -> iotype ) {
170
170
case UPIO_MEM :
@@ -179,7 +179,7 @@ static u32 rd_reg(struct uart_port *port, u32 reg)
179
179
180
180
#define rd_regl (port , reg ) (readl_relaxed(portaddr(port, reg)))
181
181
182
- static void wr_reg (struct uart_port * port , u32 reg , u32 val )
182
+ static void wr_reg (const struct uart_port * port , u32 reg , u32 val )
183
183
{
184
184
switch (port -> iotype ) {
185
185
case UPIO_MEM :
@@ -195,7 +195,7 @@ static void wr_reg(struct uart_port *port, u32 reg, u32 val)
195
195
196
196
/* Byte-order aware bit setting/clearing functions. */
197
197
198
- static inline void s3c24xx_set_bit (struct uart_port * port , int idx ,
198
+ static inline void s3c24xx_set_bit (const struct uart_port * port , int idx ,
199
199
unsigned int reg )
200
200
{
201
201
unsigned long flags ;
@@ -208,7 +208,7 @@ static inline void s3c24xx_set_bit(struct uart_port *port, int idx,
208
208
local_irq_restore (flags );
209
209
}
210
210
211
- static inline void s3c24xx_clear_bit (struct uart_port * port , int idx ,
211
+ static inline void s3c24xx_clear_bit (const struct uart_port * port , int idx ,
212
212
unsigned int reg )
213
213
{
214
214
unsigned long flags ;
@@ -221,19 +221,19 @@ static inline void s3c24xx_clear_bit(struct uart_port *port, int idx,
221
221
local_irq_restore (flags );
222
222
}
223
223
224
- static inline struct s3c24xx_uart_port * to_ourport (const struct uart_port * port )
224
+ static inline struct s3c24xx_uart_port * to_ourport (struct uart_port * port )
225
225
{
226
226
return container_of (port , struct s3c24xx_uart_port , port );
227
227
}
228
228
229
229
/* translate a port to the device name */
230
230
231
- static inline const char * s3c24xx_serial_portname (struct uart_port * port )
231
+ static inline const char * s3c24xx_serial_portname (const struct uart_port * port )
232
232
{
233
233
return to_platform_device (port -> dev )-> name ;
234
234
}
235
235
236
- static int s3c24xx_serial_txempty_nofifo (struct uart_port * port )
236
+ static int s3c24xx_serial_txempty_nofifo (const struct uart_port * port )
237
237
{
238
238
return rd_regl (port , S3C2410_UTRSTAT ) & S3C2410_UTRSTAT_TXE ;
239
239
}
@@ -358,7 +358,7 @@ static void s3c24xx_serial_tx_dma_complete(void *args)
358
358
359
359
static void enable_tx_dma (struct s3c24xx_uart_port * ourport )
360
360
{
361
- struct uart_port * port = & ourport -> port ;
361
+ const struct uart_port * port = & ourport -> port ;
362
362
u32 ucon ;
363
363
364
364
/* Mask Tx interrupt */
@@ -387,7 +387,7 @@ static void enable_tx_dma(struct s3c24xx_uart_port *ourport)
387
387
388
388
static void enable_tx_pio (struct s3c24xx_uart_port * ourport )
389
389
{
390
- struct uart_port * port = & ourport -> port ;
390
+ const struct uart_port * port = & ourport -> port ;
391
391
u32 ucon , ufcon ;
392
392
393
393
/* Set ufcon txtrig */
@@ -580,9 +580,9 @@ static inline const struct s3c24xx_uart_info
580
580
}
581
581
582
582
static inline const struct s3c2410_uartcfg
583
- * s3c24xx_port_to_cfg (struct uart_port * port )
583
+ * s3c24xx_port_to_cfg (const struct uart_port * port )
584
584
{
585
- struct s3c24xx_uart_port * ourport ;
585
+ const struct s3c24xx_uart_port * ourport ;
586
586
587
587
if (port -> dev == NULL )
588
588
return NULL ;
@@ -591,7 +591,7 @@ static inline const struct s3c2410_uartcfg
591
591
return ourport -> cfg ;
592
592
}
593
593
594
- static int s3c24xx_serial_rx_fifocnt (struct s3c24xx_uart_port * ourport ,
594
+ static int s3c24xx_serial_rx_fifocnt (const struct s3c24xx_uart_port * ourport ,
595
595
unsigned long ufstat )
596
596
{
597
597
const struct s3c24xx_uart_info * info = ourport -> info ;
@@ -944,8 +944,8 @@ static irqreturn_t s3c24xx_serial_tx_irq(int irq, void *id)
944
944
/* interrupt handler for s3c64xx and later SoC's.*/
945
945
static irqreturn_t s3c64xx_serial_handle_irq (int irq , void * id )
946
946
{
947
- struct s3c24xx_uart_port * ourport = id ;
948
- struct uart_port * port = & ourport -> port ;
947
+ const struct s3c24xx_uart_port * ourport = id ;
948
+ const struct uart_port * port = & ourport -> port ;
949
949
unsigned int pend = rd_regl (port , S3C64XX_UINTP );
950
950
irqreturn_t ret = IRQ_HANDLED ;
951
951
@@ -963,8 +963,8 @@ static irqreturn_t s3c64xx_serial_handle_irq(int irq, void *id)
963
963
/* interrupt handler for Apple SoC's.*/
964
964
static irqreturn_t apple_serial_handle_irq (int irq , void * id )
965
965
{
966
- struct s3c24xx_uart_port * ourport = id ;
967
- struct uart_port * port = & ourport -> port ;
966
+ const struct s3c24xx_uart_port * ourport = id ;
967
+ const struct uart_port * port = & ourport -> port ;
968
968
unsigned int pend = rd_regl (port , S3C2410_UTRSTAT );
969
969
irqreturn_t ret = IRQ_NONE ;
970
970
@@ -1496,7 +1496,7 @@ static unsigned int s3c24xx_serial_getclk(struct s3c24xx_uart_port *ourport,
1496
1496
* This table takes the fractional value of the baud divisor and gives
1497
1497
* the recommended setting for the UDIVSLOT register.
1498
1498
*/
1499
- static u16 udivslot_table [16 ] = {
1499
+ static const u16 udivslot_table [16 ] = {
1500
1500
[0 ] = 0x0000 ,
1501
1501
[1 ] = 0x0080 ,
1502
1502
[2 ] = 0x0808 ,
@@ -1672,7 +1672,7 @@ static void s3c24xx_serial_set_termios(struct uart_port *port,
1672
1672
1673
1673
static const char * s3c24xx_serial_type (struct uart_port * port )
1674
1674
{
1675
- struct s3c24xx_uart_port * ourport = to_ourport (port );
1675
+ const struct s3c24xx_uart_port * ourport = to_ourport (port );
1676
1676
1677
1677
switch (ourport -> info -> type ) {
1678
1678
case TYPE_S3C24XX :
@@ -2447,7 +2447,7 @@ s3c24xx_port_configured(unsigned int ucon)
2447
2447
2448
2448
static int s3c24xx_serial_get_poll_char (struct uart_port * port )
2449
2449
{
2450
- struct s3c24xx_uart_port * ourport = to_ourport (port );
2450
+ const struct s3c24xx_uart_port * ourport = to_ourport (port );
2451
2451
unsigned int ufstat ;
2452
2452
2453
2453
ufstat = rd_regl (port , S3C2410_UFSTAT );
@@ -2932,7 +2932,7 @@ module_exit(samsung_serial_exit);
2932
2932
* Early console.
2933
2933
*/
2934
2934
2935
- static void wr_reg_barrier (struct uart_port * port , u32 reg , u32 val )
2935
+ static void wr_reg_barrier (const struct uart_port * port , u32 reg , u32 val )
2936
2936
{
2937
2937
switch (port -> iotype ) {
2938
2938
case UPIO_MEM :
@@ -2949,15 +2949,15 @@ struct samsung_early_console_data {
2949
2949
u32 rxfifo_mask ;
2950
2950
};
2951
2951
2952
- static void samsung_early_busyuart (struct uart_port * port )
2952
+ static void samsung_early_busyuart (const struct uart_port * port )
2953
2953
{
2954
2954
while (!(readl (port -> membase + S3C2410_UTRSTAT ) & S3C2410_UTRSTAT_TXFE ))
2955
2955
;
2956
2956
}
2957
2957
2958
- static void samsung_early_busyuart_fifo (struct uart_port * port )
2958
+ static void samsung_early_busyuart_fifo (const struct uart_port * port )
2959
2959
{
2960
- struct samsung_early_console_data * data = port -> private_data ;
2960
+ const struct samsung_early_console_data * data = port -> private_data ;
2961
2961
2962
2962
while (readl (port -> membase + S3C2410_UFSTAT ) & data -> txfull_mask )
2963
2963
;
0 commit comments