@@ -136,14 +136,14 @@ struct s3c24xx_uart_port {
136
136
unsigned int tx_mode ;
137
137
unsigned int rx_mode ;
138
138
139
- struct s3c24xx_uart_info * info ;
139
+ const struct s3c24xx_uart_info * info ;
140
140
struct clk * clk ;
141
141
struct clk * baudclk ;
142
142
struct uart_port port ;
143
- struct s3c24xx_serial_drv_data * drv_data ;
143
+ const struct s3c24xx_serial_drv_data * drv_data ;
144
144
145
145
/* reference to platform data */
146
- struct s3c2410_uartcfg * cfg ;
146
+ const struct s3c2410_uartcfg * cfg ;
147
147
148
148
struct s3c24xx_uart_dma * dma ;
149
149
@@ -221,7 +221,7 @@ 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 (struct uart_port * port )
224
+ static inline struct s3c24xx_uart_port * to_ourport (const struct uart_port * port )
225
225
{
226
226
return container_of (port , struct s3c24xx_uart_port , port );
227
227
}
@@ -573,13 +573,13 @@ static void s3c24xx_serial_stop_rx(struct uart_port *port)
573
573
}
574
574
}
575
575
576
- static inline struct s3c24xx_uart_info
576
+ static inline const struct s3c24xx_uart_info
577
577
* s3c24xx_port_to_info (struct uart_port * port )
578
578
{
579
579
return to_ourport (port )-> info ;
580
580
}
581
581
582
- static inline struct s3c2410_uartcfg
582
+ static inline const struct s3c2410_uartcfg
583
583
* s3c24xx_port_to_cfg (struct uart_port * port )
584
584
{
585
585
struct s3c24xx_uart_port * ourport ;
@@ -594,7 +594,7 @@ static inline struct s3c2410_uartcfg
594
594
static int s3c24xx_serial_rx_fifocnt (struct s3c24xx_uart_port * ourport ,
595
595
unsigned long ufstat )
596
596
{
597
- struct s3c24xx_uart_info * info = ourport -> info ;
597
+ const struct s3c24xx_uart_info * info = ourport -> info ;
598
598
599
599
if (ufstat & info -> rx_fifofull )
600
600
return ourport -> port .fifosize ;
@@ -983,7 +983,7 @@ static irqreturn_t apple_serial_handle_irq(int irq, void *id)
983
983
984
984
static unsigned int s3c24xx_serial_tx_empty (struct uart_port * port )
985
985
{
986
- struct s3c24xx_uart_info * info = s3c24xx_port_to_info (port );
986
+ const struct s3c24xx_uart_info * info = s3c24xx_port_to_info (port );
987
987
unsigned long ufstat = rd_regl (port , S3C2410_UFSTAT );
988
988
unsigned long ufcon = rd_regl (port , S3C2410_UFCON );
989
989
@@ -1402,7 +1402,7 @@ static void s3c24xx_serial_pm(struct uart_port *port, unsigned int level,
1402
1402
1403
1403
static inline int s3c24xx_serial_getsource (struct uart_port * port )
1404
1404
{
1405
- struct s3c24xx_uart_info * info = s3c24xx_port_to_info (port );
1405
+ const struct s3c24xx_uart_info * info = s3c24xx_port_to_info (port );
1406
1406
unsigned int ucon ;
1407
1407
1408
1408
if (info -> num_clks == 1 )
@@ -1416,7 +1416,7 @@ static inline int s3c24xx_serial_getsource(struct uart_port *port)
1416
1416
static void s3c24xx_serial_setsource (struct uart_port * port ,
1417
1417
unsigned int clk_sel )
1418
1418
{
1419
- struct s3c24xx_uart_info * info = s3c24xx_port_to_info (port );
1419
+ const struct s3c24xx_uart_info * info = s3c24xx_port_to_info (port );
1420
1420
unsigned int ucon ;
1421
1421
1422
1422
if (info -> num_clks == 1 )
@@ -1435,7 +1435,7 @@ static unsigned int s3c24xx_serial_getclk(struct s3c24xx_uart_port *ourport,
1435
1435
unsigned int req_baud , struct clk * * best_clk ,
1436
1436
unsigned int * clk_num )
1437
1437
{
1438
- struct s3c24xx_uart_info * info = ourport -> info ;
1438
+ const struct s3c24xx_uart_info * info = ourport -> info ;
1439
1439
struct clk * clk ;
1440
1440
unsigned long rate ;
1441
1441
unsigned int cnt , baud , quot , best_quot = 0 ;
@@ -1519,7 +1519,7 @@ static void s3c24xx_serial_set_termios(struct uart_port *port,
1519
1519
struct ktermios * termios ,
1520
1520
struct ktermios * old )
1521
1521
{
1522
- struct s3c2410_uartcfg * cfg = s3c24xx_port_to_cfg (port );
1522
+ const struct s3c2410_uartcfg * cfg = s3c24xx_port_to_cfg (port );
1523
1523
struct s3c24xx_uart_port * ourport = to_ourport (port );
1524
1524
struct clk * clk = ERR_PTR (- EINVAL );
1525
1525
unsigned long flags ;
@@ -1688,7 +1688,7 @@ static const char *s3c24xx_serial_type(struct uart_port *port)
1688
1688
1689
1689
static void s3c24xx_serial_config_port (struct uart_port * port , int flags )
1690
1690
{
1691
- struct s3c24xx_uart_info * info = s3c24xx_port_to_info (port );
1691
+ const struct s3c24xx_uart_info * info = s3c24xx_port_to_info (port );
1692
1692
1693
1693
if (flags & UART_CONFIG_TYPE )
1694
1694
port -> type = info -> port_type ;
@@ -1700,7 +1700,7 @@ static void s3c24xx_serial_config_port(struct uart_port *port, int flags)
1700
1700
static int
1701
1701
s3c24xx_serial_verify_port (struct uart_port * port , struct serial_struct * ser )
1702
1702
{
1703
- struct s3c24xx_uart_info * info = s3c24xx_port_to_info (port );
1703
+ const struct s3c24xx_uart_info * info = s3c24xx_port_to_info (port );
1704
1704
1705
1705
if (ser -> type != PORT_UNKNOWN && ser -> type != info -> port_type )
1706
1706
return - EINVAL ;
@@ -1870,9 +1870,9 @@ s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS] = {
1870
1870
*/
1871
1871
1872
1872
static void s3c24xx_serial_resetport (struct uart_port * port ,
1873
- struct s3c2410_uartcfg * cfg )
1873
+ const struct s3c2410_uartcfg * cfg )
1874
1874
{
1875
- struct s3c24xx_uart_info * info = s3c24xx_port_to_info (port );
1875
+ const struct s3c24xx_uart_info * info = s3c24xx_port_to_info (port );
1876
1876
unsigned long ucon = rd_regl (port , S3C2410_UCON );
1877
1877
1878
1878
ucon &= (info -> clksel_mask | info -> ucon_mask );
@@ -1976,7 +1976,7 @@ s3c24xx_serial_cpufreq_deregister(struct s3c24xx_uart_port *port)
1976
1976
static int s3c24xx_serial_enable_baudclk (struct s3c24xx_uart_port * ourport )
1977
1977
{
1978
1978
struct device * dev = ourport -> port .dev ;
1979
- struct s3c24xx_uart_info * info = ourport -> info ;
1979
+ const struct s3c24xx_uart_info * info = ourport -> info ;
1980
1980
char clk_name [MAX_CLK_NAME_LENGTH ];
1981
1981
unsigned int clk_sel ;
1982
1982
struct clk * clk ;
@@ -2018,7 +2018,7 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport,
2018
2018
struct platform_device * platdev )
2019
2019
{
2020
2020
struct uart_port * port = & ourport -> port ;
2021
- struct s3c2410_uartcfg * cfg = ourport -> cfg ;
2021
+ const struct s3c2410_uartcfg * cfg = ourport -> cfg ;
2022
2022
struct resource * res ;
2023
2023
int ret ;
2024
2024
@@ -2153,7 +2153,7 @@ static const struct of_device_id s3c24xx_uart_dt_match[];
2153
2153
2154
2154
static int probe_index ;
2155
2155
2156
- static inline struct s3c24xx_serial_drv_data *
2156
+ static inline const struct s3c24xx_serial_drv_data *
2157
2157
s3c24xx_get_driver_data (struct platform_device * pdev )
2158
2158
{
2159
2159
#ifdef CONFIG_OF
@@ -2416,7 +2416,7 @@ static struct uart_port *cons_uart;
2416
2416
static int
2417
2417
s3c24xx_serial_console_txrdy (struct uart_port * port , unsigned int ufcon )
2418
2418
{
2419
- struct s3c24xx_uart_info * info = s3c24xx_port_to_info (port );
2419
+ const struct s3c24xx_uart_info * info = s3c24xx_port_to_info (port );
2420
2420
unsigned long ufstat , utrstat ;
2421
2421
2422
2422
if (ufcon & S3C2410_UFCON_FIFOMODE ) {
@@ -2612,7 +2612,7 @@ static struct console s3c24xx_serial_console = {
2612
2612
#endif /* CONFIG_SERIAL_SAMSUNG_CONSOLE */
2613
2613
2614
2614
#ifdef CONFIG_CPU_S3C2410
2615
- static struct s3c24xx_serial_drv_data s3c2410_serial_drv_data = {
2615
+ static const struct s3c24xx_serial_drv_data s3c2410_serial_drv_data = {
2616
2616
.info = {
2617
2617
.name = "Samsung S3C2410 UART" ,
2618
2618
.type = TYPE_S3C24XX ,
@@ -2640,7 +2640,7 @@ static struct s3c24xx_serial_drv_data s3c2410_serial_drv_data = {
2640
2640
#endif
2641
2641
2642
2642
#ifdef CONFIG_CPU_S3C2412
2643
- static struct s3c24xx_serial_drv_data s3c2412_serial_drv_data = {
2643
+ static const struct s3c24xx_serial_drv_data s3c2412_serial_drv_data = {
2644
2644
.info = {
2645
2645
.name = "Samsung S3C2412 UART" ,
2646
2646
.type = TYPE_S3C24XX ,
@@ -2670,7 +2670,7 @@ static struct s3c24xx_serial_drv_data s3c2412_serial_drv_data = {
2670
2670
2671
2671
#if defined(CONFIG_CPU_S3C2440 ) || defined(CONFIG_CPU_S3C2416 ) || \
2672
2672
defined(CONFIG_CPU_S3C2443 ) || defined(CONFIG_CPU_S3C2442 )
2673
- static struct s3c24xx_serial_drv_data s3c2440_serial_drv_data = {
2673
+ static const struct s3c24xx_serial_drv_data s3c2440_serial_drv_data = {
2674
2674
.info = {
2675
2675
.name = "Samsung S3C2440 UART" ,
2676
2676
.type = TYPE_S3C24XX ,
@@ -2700,7 +2700,7 @@ static struct s3c24xx_serial_drv_data s3c2440_serial_drv_data = {
2700
2700
#endif
2701
2701
2702
2702
#if defined(CONFIG_CPU_S3C6400 ) || defined(CONFIG_CPU_S3C6410 )
2703
- static struct s3c24xx_serial_drv_data s3c6400_serial_drv_data = {
2703
+ static const struct s3c24xx_serial_drv_data s3c6400_serial_drv_data = {
2704
2704
.info = {
2705
2705
.name = "Samsung S3C6400 UART" ,
2706
2706
.type = TYPE_S3C6400 ,
@@ -2729,7 +2729,7 @@ static struct s3c24xx_serial_drv_data s3c6400_serial_drv_data = {
2729
2729
#endif
2730
2730
2731
2731
#ifdef CONFIG_CPU_S5PV210
2732
- static struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = {
2732
+ static const struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = {
2733
2733
.info = {
2734
2734
.name = "Samsung S5PV210 UART" ,
2735
2735
.type = TYPE_S3C6400 ,
@@ -2781,17 +2781,17 @@ static struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = {
2781
2781
.has_fracval = 1, \
2782
2782
} \
2783
2783
2784
- static struct s3c24xx_serial_drv_data exynos4210_serial_drv_data = {
2784
+ static const struct s3c24xx_serial_drv_data exynos4210_serial_drv_data = {
2785
2785
EXYNOS_COMMON_SERIAL_DRV_DATA (),
2786
2786
.fifosize = { 256 , 64 , 16 , 16 },
2787
2787
};
2788
2788
2789
- static struct s3c24xx_serial_drv_data exynos5433_serial_drv_data = {
2789
+ static const struct s3c24xx_serial_drv_data exynos5433_serial_drv_data = {
2790
2790
EXYNOS_COMMON_SERIAL_DRV_DATA (),
2791
2791
.fifosize = { 64 , 256 , 16 , 256 },
2792
2792
};
2793
2793
2794
- static struct s3c24xx_serial_drv_data exynos850_serial_drv_data = {
2794
+ static const struct s3c24xx_serial_drv_data exynos850_serial_drv_data = {
2795
2795
EXYNOS_COMMON_SERIAL_DRV_DATA (),
2796
2796
.fifosize = { 256 , 64 , 64 , 64 },
2797
2797
};
@@ -2807,7 +2807,7 @@ static struct s3c24xx_serial_drv_data exynos850_serial_drv_data = {
2807
2807
#endif
2808
2808
2809
2809
#ifdef CONFIG_ARCH_APPLE
2810
- static struct s3c24xx_serial_drv_data s5l_serial_drv_data = {
2810
+ static const struct s3c24xx_serial_drv_data s5l_serial_drv_data = {
2811
2811
.info = {
2812
2812
.name = "Apple S5L UART" ,
2813
2813
.type = TYPE_APPLE_S5L ,
0 commit comments