[PATCH] const struct tty_operations
authorJeff Dike <jdike@addtoit.com>
Mon, 2 Oct 2006 09:17:18 +0000 (02:17 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 2 Oct 2006 14:57:14 +0000 (07:57 -0700)
As part of an SMP cleanliness pass over UML, I consted a bunch of
structures in order to not have to document their locking.  One of these
structures was a struct tty_operations.  In order to const it in UML
without introducing compiler complaints, the declaration of
tty_set_operations needs to be changed, and then all of its callers need to
be fixed.

This patch declares all struct tty_operations in the tree as const.  In all
cases, they are static and used only as input to tty_set_operations.  As an
extra check, I ran an i386 allyesconfig build which produced no extra
warnings.

53 drivers are affected.  I checked the history of a bunch of them, and in
most cases, there have been only a handful of maintenance changes in the
last six months.  serial_core.c was the busiest one that I looked at.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Acked-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
57 files changed:
arch/alpha/kernel/srmcons.c
arch/ia64/hp/sim/simserial.c
arch/ppc/4xx_io/serial_sicc.c
arch/um/drivers/line.c
arch/um/include/line.h
arch/v850/kernel/memcons.c
arch/v850/kernel/simcons.c
arch/xtensa/platform-iss/console.c
drivers/char/amiserial.c
drivers/char/cyclades.c
drivers/char/epca.c
drivers/char/esp.c
drivers/char/hvc_console.c
drivers/char/hvcs.c
drivers/char/hvsi.c
drivers/char/ip2/ip2main.c
drivers/char/isicom.c
drivers/char/istallion.c
drivers/char/moxa.c
drivers/char/mxser.c
drivers/char/pcmcia/synclink_cs.c
drivers/char/pty.c
drivers/char/rio/rio_linux.c
drivers/char/riscom8.c
drivers/char/rocket.c
drivers/char/ser_a2232.c
drivers/char/serial167.c
drivers/char/specialix.c
drivers/char/stallion.c
drivers/char/sx.c
drivers/char/synclink.c
drivers/char/synclink_gt.c
drivers/char/synclinkmp.c
drivers/char/tty_io.c
drivers/char/viocons.c
drivers/char/vme_scc.c
drivers/char/vt.c
drivers/isdn/capi/capi.c
drivers/isdn/gigaset/interface.c
drivers/isdn/i4l/isdn_tty.c
drivers/s390/char/con3215.c
drivers/s390/char/sclp_tty.c
drivers/s390/char/sclp_vt220.c
drivers/s390/char/tty3270.c
drivers/sbus/char/aurora.c
drivers/serial/68328serial.c
drivers/serial/68360serial.c
drivers/serial/crisv10.c
drivers/serial/mcfserial.c
drivers/serial/serial_core.c
drivers/tc/zs.c
drivers/usb/class/cdc-acm.c
drivers/usb/gadget/serial.c
drivers/usb/serial/usb-serial.c
include/linux/tty_driver.h
net/bluetooth/rfcomm/tty.c
net/irda/ircomm/ircomm_tty.c

index 9d7dff27f81562e986064ff55d68d045cd8ca5fb..75692320386080c25a730f1e78779b1851f75926 100644 (file)
@@ -229,7 +229,7 @@ srmcons_close(struct tty_struct *tty, struct file *filp)
 
 static struct tty_driver *srmcons_driver;
 
-static struct tty_operations srmcons_ops = {
+static const struct tty_operations srmcons_ops = {
        .open           = srmcons_open,
        .close          = srmcons_close,
        .write          = srmcons_write,
index 0daacc20ed36e26c8600176b5332a5ce4a65b10f..246eb3d3757adc85db23f8892ed49beb5c0d5a11 100644 (file)
@@ -940,7 +940,7 @@ static inline void show_serial_version(void)
        printk(KERN_INFO " no serial options enabled\n");
 }
 
-static struct tty_operations hp_ops = {
+static const struct tty_operations hp_ops = {
        .open = rs_open,
        .close = rs_close,
        .write = rs_write,
index b81a367dc2780bb15e49545e1d8ac92fe73a4d24..87fe9a89dba710f1afd9d5c9f5b5ecb1a5a173f3 100644 (file)
@@ -1720,7 +1720,7 @@ static int siccuart_open(struct tty_struct *tty, struct file *filp)
     return 0;
 }
 
-static struct tty_operations sicc_ops = {
+static const struct tty_operations sicc_ops = {
        .open = siccuart_open,
        .close = siccuart_close,
        .write = siccuart_write,
index 563ce7690a1eb66ccf38376da5c68c591666a7ea..24747a413785abc575dfd16cb74f60f159ce2339 100644 (file)
@@ -642,9 +642,9 @@ int line_remove(struct line *lines, unsigned int num, int n)
 }
 
 struct tty_driver *line_register_devfs(struct lines *set,
-                        struct line_driver *line_driver,
-                        struct tty_operations *ops, struct line *lines,
-                        int nlines)
+                                      struct line_driver *line_driver,
+                                      const struct tty_operations *ops,
+                                      struct line *lines, int nlines)
 {
        int i;
        struct tty_driver *driver = alloc_tty_driver(nlines);
index 642c9a0320f9a111af988a8dead98a08ef107efb..7be24811bb3094b127667941f06c7297c085f2e9 100644 (file)
@@ -91,10 +91,9 @@ extern int line_setup_irq(int fd, int input, int output, struct line *line,
                          void *data);
 extern void line_close_chan(struct line *line);
 extern struct tty_driver * line_register_devfs(struct lines *set,
-                               struct line_driver *line_driver,
-                               struct tty_operations *driver,
-                               struct line *lines,
-                               int nlines);
+                                              struct line_driver *line_driver,
+                                              const struct tty_operations *driver,
+                                              struct line *lines, int nlines);
 extern void lines_init(struct line *lines, int nlines, struct chan_opts *opts);
 extern void close_lines(struct line *lines, int nlines);
 
index 815f8a43926fab1f51c5bde3f7ecef16cd53d700..92f514fdcc79fa608e98093e1d003d506ef0eaf1 100644 (file)
@@ -104,7 +104,7 @@ int memcons_tty_chars_in_buffer (struct tty_struct *tty)
        return 0;
 }
 
-static struct tty_operations ops = {
+static const struct tty_operations ops = {
        .open = memcons_tty_open,
        .write = memcons_tty_write,
        .write_room = memcons_tty_write_room,
index 3975aa02cef83df866a58085bb384715c87a3423..9973596ae3044e7dffc937bf8fc074f06ae451c5 100644 (file)
@@ -77,7 +77,7 @@ int simcons_tty_chars_in_buffer (struct tty_struct *tty)
        return 0;
 }
 
-static struct tty_operations ops = {
+static const struct tty_operations ops = {
        .open = simcons_tty_open,
        .write = simcons_tty_write,
        .write_room = simcons_tty_write_room,
index 22d3c571a7bc70c8927b19cd17ec19990185a3e3..5c947cae75207d91825ead1b34cf59fdc516bcf7 100644 (file)
@@ -191,7 +191,7 @@ static int rs_read_proc(char *page, char **start, off_t off, int count,
 }
 
 
-static struct tty_operations serial_ops = {
+static const struct tty_operations serial_ops = {
        .open = rs_open,
        .close = rs_close,
        .write = rs_write,
index 9d6713a93ed74ddb74adaf18aa85fd22e0ee6508..d0e92ed0a367292d271d625b1b80069fed195fd6 100644 (file)
@@ -1958,7 +1958,7 @@ static void show_serial_version(void)
 }
 
 
-static struct tty_operations serial_ops = {
+static const struct tty_operations serial_ops = {
        .open = rs_open,
        .close = rs_close,
        .write = rs_write,
index c1c67281750da61ef1750706bb8351e780cb3e43..f85b4eb166181ba5d1777af825454601abd301aa 100644 (file)
@@ -5205,7 +5205,7 @@ done:
     extra ports are ignored.
  */
 
-static struct tty_operations cy_ops = {
+static const struct tty_operations cy_ops = {
     .open = cy_open,
     .close = cy_close,
     .write = cy_write,
index 86d290e9f307044041fed353cf6bca3ed0cc44cc..3baa2ab8cbd49421818ed995bf38a4935af1da34 100644 (file)
@@ -1125,7 +1125,7 @@ static void __exit epca_module_exit(void)
 
 module_exit(epca_module_exit);
 
-static struct tty_operations pc_ops = {
+static const struct tty_operations pc_ops = {
        .open = pc_open,
        .close = pc_close,
        .write = pc_write,
index afcd83d9984be5b00937c7959d3bc7476ec2041c..05788c75d7fc83dffc807c5e654cae160a469959 100644 (file)
@@ -2376,7 +2376,7 @@ static inline int autoconfig(struct esp_struct * info)
        return (port_detected);
 }
 
-static struct tty_operations esp_ops = {
+static const struct tty_operations esp_ops = {
        .open = esp_open,
        .close = rs_close,
        .write = rs_write,
index a76d2c40dd5e7e5e375a9a39054333c3752fdafa..4053d1cd393f520101857047d52fc63b70efe7d7 100644 (file)
@@ -696,7 +696,7 @@ int khvcd(void *unused)
        return 0;
 }
 
-static struct tty_operations hvc_ops = {
+static const struct tty_operations hvc_ops = {
        .open = hvc_open,
        .close = hvc_close,
        .write = hvc_write,
index 4589ff302b076a123396bd5d218aa6007a08d294..0b89bcde8c52e80c6550e96d42ed9503c91f1a99 100644 (file)
@@ -1306,7 +1306,7 @@ static int hvcs_chars_in_buffer(struct tty_struct *tty)
        return hvcsd->chars_in_buffer;
 }
 
-static struct tty_operations hvcs_ops = {
+static const struct tty_operations hvcs_ops = {
        .open = hvcs_open,
        .close = hvcs_close,
        .hangup = hvcs_hangup,
index a89a95fb5e40fb76b766c8b50483bd435ac2bd5e..c07dc58d5c1d7261eb6a4b75f9f935d3bf61ce72 100644 (file)
@@ -1130,7 +1130,7 @@ static int hvsi_tiocmset(struct tty_struct *tty, struct file *file,
 }
 
 
-static struct tty_operations hvsi_ops = {
+static const struct tty_operations hvsi_ops = {
        .open = hvsi_open,
        .close = hvsi_close,
        .write = hvsi_write,
index 331f447e62283291b3d799a04557ecb018a0d197..4828bc914ce3a336f8db14f2fcae918ca8f749b9 100644 (file)
@@ -458,7 +458,7 @@ cleanup_module(void)
 }
 #endif /* MODULE */
 
-static struct tty_operations ip2_ops = {
+static const struct tty_operations ip2_ops = {
        .open            = ip2_open,
        .close           = ip2_close,
        .write           = ip2_write,
index 2e1da632aee18ef3c8d7ea22cc70ea06010169b5..ea2bbf80ad33839b381bb526ab957dd540e55b8a 100644 (file)
@@ -1550,7 +1550,7 @@ static void isicom_unregister_ioregion(struct pci_dev *pdev)
        board->base = 0;
 }
 
-static struct tty_operations isicom_ops = {
+static const struct tty_operations isicom_ops = {
        .open                   = isicom_open,
        .close                  = isicom_close,
        .write                  = isicom_write,
index 6b4d82a4565fbf9ec533891f8043b6aa3d5ca707..d6e031542c6bdbd68932b3a46c7fa3ccaf1d2925 100644 (file)
@@ -4636,7 +4636,7 @@ static int stli_memioctl(struct inode *ip, struct file *fp, unsigned int cmd, un
        return rc;
 }
 
-static struct tty_operations stli_ops = {
+static const struct tty_operations stli_ops = {
        .open = stli_open,
        .close = stli_close,
        .write = stli_write,
index c1a6d3c48da155da8c9e974090ad6e4efe3a4b8c..b401383808c26ac4c16ce38f15fc129b4dafd56a 100644 (file)
@@ -281,7 +281,7 @@ static int moxa_get_serial_info(struct moxa_str *, struct serial_struct __user *
 static int moxa_set_serial_info(struct moxa_str *, struct serial_struct __user *);
 static void MoxaSetFifo(int port, int enable);
 
-static struct tty_operations moxa_ops = {
+static const struct tty_operations moxa_ops = {
        .open = moxa_open,
        .close = moxa_close,
        .write = moxa_write,
index 27a653772049ff6b78050c8f2ff86f2e327b7967..8253fca8efd527c3a1d763a2805bffc4c20cb77a 100644 (file)
@@ -453,7 +453,7 @@ static int CheckIsMoxaMust(int io)
 
 /* above is modified by Victor Yu. 08-15-2002 */
 
-static struct tty_operations mxser_ops = {
+static const struct tty_operations mxser_ops = {
        .open = mxser_open,
        .close = mxser_close,
        .write = mxser_write,
index 00f574cbb0d47ca0c69d8b4b0c2ed77be9e24282..dd845cbefe94c271147d47031eb6e1767ce86d10 100644 (file)
@@ -3010,7 +3010,7 @@ static struct pcmcia_driver mgslpc_driver = {
        .resume         = mgslpc_resume,
 };
 
-static struct tty_operations mgslpc_ops = {
+static const struct tty_operations mgslpc_ops = {
        .open = mgslpc_open,
        .close = mgslpc_close,
        .write = mgslpc_write,
index 34dd4c38110e060f6bdfd866d0aa2bdb41994d08..80d3eedd7f96f32997a69fa24f2134b38c8d1f1f 100644 (file)
@@ -224,7 +224,7 @@ static void pty_set_termios(struct tty_struct *tty, struct termios *old_termios)
         tty->termios->c_cflag |= (CS8 | CREAD);
 }
 
-static struct tty_operations pty_ops = {
+static const struct tty_operations pty_ops = {
        .open = pty_open,
        .close = pty_close,
        .write = pty_write,
index 3fa80aaf452751b24397192406ee944f7f3e04bc..202a3b0945b78749dbf0c4cc97356e217753f07b 100644 (file)
@@ -727,7 +727,7 @@ static struct vpd_prom *get_VPD_PROM(struct Host *hp)
        return &vpdp;
 }
 
-static struct tty_operations rio_ops = {
+static const struct tty_operations rio_ops = {
        .open = riotopen,
        .close = gs_close,
        .write = gs_write,
index 06b9f78a95d98224d91e0d70a34c6544bcb4a465..214d850112fde66bcbff652fc2561926fcd16923 100644 (file)
@@ -1583,7 +1583,7 @@ static void do_softint(void *private_)
        }
 }
 
-static struct tty_operations riscom_ops = {
+static const struct tty_operations riscom_ops = {
        .open  = rc_open,
        .close = rc_close,
        .write = rc_write,
index 0ac131881322c96920b049c45e8aa64d5fbdb635..bac80056f7e0c7e45893c7f7a46f9b2c196222af 100644 (file)
@@ -2334,7 +2334,7 @@ static int __init init_ISA(int i)
        return (1);
 }
 
-static struct tty_operations rocket_ops = {
+static const struct tty_operations rocket_ops = {
        .open = rp_open,
        .close = rp_close,
        .write = rp_write,
index 510bd3e0e88b432744ab8064bcaa9edaea95287d..65c751d0d64350b2b6c25df7d777504da53c6c21 100644 (file)
@@ -661,7 +661,7 @@ static void a2232_init_portstructs(void)
        }
 }
 
-static struct tty_operations a2232_ops = {
+static const struct tty_operations a2232_ops = {
        .open = a2232_open,
        .close = gs_close,
        .write = gs_write,
index 21a710cb4bbaed1df2ebfc6a6044bcf5abeb67c4..b4ea1266b66300980288141975bc0392345955ee 100644 (file)
@@ -2158,7 +2158,7 @@ mvme167_serial_console_setup(int cflag)
                                        rcor >> 5, rbpr);
 } /* serial_console_init */
 
-static struct tty_operations cy_ops = {
+static const struct tty_operations cy_ops = {
        .open = cy_open,
        .close = cy_close,
        .write = cy_write,
index f52c7c31badf0544bd7024aa12d8feaffeeb4699..902c48dca3bc98e86938fb23a0affbd052d921ea 100644 (file)
@@ -2363,7 +2363,7 @@ static void do_softint(void *private_)
        func_exit();
 }
 
-static struct tty_operations sx_ops = {
+static const struct tty_operations sx_ops = {
        .open  = sx_open,
        .close = sx_close,
        .write = sx_write,
index 3beb2203d24be21375175daf23021bbdd8e6daae..bd711537ec4e851791699c377e2540218aaa7ff6 100644 (file)
@@ -2993,7 +2993,7 @@ static int stl_memioctl(struct inode *ip, struct file *fp, unsigned int cmd, uns
        return(rc);
 }
 
-static struct tty_operations stl_ops = {
+static const struct tty_operations stl_ops = {
        .open = stl_open,
        .close = stl_close,
        .write = stl_write,
index e1cd2bc4b1e4222e5806dab4389169ffa774900b..57e31e5eaedb7aa998dff3373fc96f180cb45e79 100644 (file)
@@ -2226,7 +2226,7 @@ static int probe_si (struct sx_board *board)
        return 1;
 }
 
-static struct tty_operations sx_ops = {
+static const struct tty_operations sx_ops = {
        .break_ctl = sx_break,
        .open   = sx_open,
        .close = gs_close,
index 78b1b1a2732b3e9216556c3caa2b77354a0457d6..244dc308c7709cc18bfc5e608d63178fe6dc8cdb 100644 (file)
@@ -4360,7 +4360,7 @@ static struct mgsl_struct* mgsl_allocate_device(void)
 
 }      /* end of mgsl_allocate_device()*/
 
-static struct tty_operations mgsl_ops = {
+static const struct tty_operations mgsl_ops = {
        .open = mgsl_open,
        .close = mgsl_close,
        .write = mgsl_write,
index 78bc85180c82d692c4201cf6a692f735fe8ad561..bdc7cb248b8f1818db19b0bbb09ae46904f8cd06 100644 (file)
@@ -3441,7 +3441,7 @@ static void __devexit remove_one(struct pci_dev *dev)
 {
 }
 
-static struct tty_operations ops = {
+static const struct tty_operations ops = {
        .open = open,
        .close = close,
        .write = write,
index 66f3754fbbdf443e891b21cdfcf88c799144e6b9..6eb75dcd79613b2f8c454be4331f496004156000 100644 (file)
@@ -3929,7 +3929,7 @@ void device_init(int adapter_num, struct pci_dev *pdev)
        }
 }
 
-static struct tty_operations ops = {
+static const struct tty_operations ops = {
        .open = open,
        .close = close,
        .write = write,
index 333741770f1e079f2fbe0df98b69699a4194f924..e90ea39c7c4b1112fd7d7db878b96d8531a0f162 100644 (file)
@@ -3680,7 +3680,8 @@ void put_tty_driver(struct tty_driver *driver)
        kfree(driver);
 }
 
-void tty_set_operations(struct tty_driver *driver, struct tty_operations *op)
+void tty_set_operations(struct tty_driver *driver,
+                       const struct tty_operations *op)
 {
        driver->open = op->open;
        driver->close = op->close;
index f3efeaf2826e901a65fced866aa86b0c9b21bead..a362ee9c92ddb68305cf0d2b6ba2ef2c89932301 100644 (file)
@@ -1047,7 +1047,7 @@ static int send_open(HvLpIndex remoteLp, void *sem)
                        0, 0, 0, 0);
 }
 
-static struct tty_operations serial_ops = {
+static const struct tty_operations serial_ops = {
        .open = viotty_open,
        .close = viotty_close,
        .write = viotty_write,
index bfe5ea948f6a51a4acb6687efe4f45ab05d441ff..c2ca31eb850ba034b9c7e9f27f06c9e15086d422 100644 (file)
@@ -113,7 +113,7 @@ static struct real_driver scc_real_driver = {
 };
 
 
-static struct tty_operations scc_ops = {
+static const struct tty_operations scc_ops = {
        .open   = scc_open,
        .close = gs_close,
        .write = gs_write,
index 303956d34569ba85b84f7082878ed484b060d977..ec0c070bf15f809217d16a436df7f1010d6223a2 100644 (file)
@@ -2675,7 +2675,7 @@ static int __init con_init(void)
 }
 console_initcall(con_init);
 
-static struct tty_operations con_ops = {
+static const struct tty_operations con_ops = {
        .open = con_open,
        .close = con_close,
        .write = con_write,
index 669f76393b5a5128de344b0cc7b7b1cda40179e2..11844bbfe9339d3db64fc401347149edae459a69 100644 (file)
@@ -1298,7 +1298,7 @@ static int capinc_tty_read_proc(char *page, char **start, off_t off,
 
 static struct tty_driver *capinc_tty_driver;
 
-static struct tty_operations capinc_ops = {
+static const struct tty_operations capinc_ops = {
        .open = capinc_tty_open,
        .close = capinc_tty_close,
        .write = capinc_tty_write,
index bd2e4267528e58aadbcb4f770f75b4cccbc72ba0..596f3aebe2f7748c553aa50c860866aa8e37b205 100644 (file)
@@ -134,7 +134,7 @@ static int  if_tiocmset(struct tty_struct *tty, struct file *file,
 static int  if_write(struct tty_struct *tty,
                     const unsigned char *buf, int count);
 
-static struct tty_operations if_ops = {
+static const struct tty_operations if_ops = {
        .open =                 if_open,
        .close =                if_close,
        .ioctl =                if_ioctl,
index 9ab66e8960d5ddc1082f5d23c5c86642c8c528c5..2b91bb07fc7f2ab087b80d501f772deca3f426ca 100644 (file)
@@ -1860,7 +1860,7 @@ modem_write_profile(atemu * m)
                send_sig(SIGIO, dev->profd, 1);
 }
 
-static struct tty_operations modem_ops = {
+static const struct tty_operations modem_ops = {
         .open = isdn_tty_open,
        .close = isdn_tty_close,
        .write = isdn_tty_write,
index 2fa566fa6da4e287488fda979f2d3b72fe552f38..d7de175d53f08b0794170e08170edf5d2ea406d5 100644 (file)
@@ -1103,7 +1103,7 @@ tty3215_start(struct tty_struct *tty)
        }
 }
 
-static struct tty_operations tty3215_ops = {
+static const struct tty_operations tty3215_ops = {
        .open = tty3215_open,
        .close = tty3215_close,
        .write = tty3215_write,
index f6cf9023039e352bed29b71ca0da273ecd8b6d24..6f43e04dbefdce1e57eee86bfd94960a7488d89d 100644 (file)
@@ -711,7 +711,7 @@ static struct sclp_register sclp_input_event =
        .receiver_fn = sclp_tty_receiver
 };
 
-static struct tty_operations sclp_ops = {
+static const struct tty_operations sclp_ops = {
        .open = sclp_tty_open,
        .close = sclp_tty_close,
        .write = sclp_tty_write,
index 54fba6f171883fda8384ab794adb77f761759991..723bf4191bfe2adb009c55d59797dfd98891f882 100644 (file)
@@ -655,7 +655,7 @@ __sclp_vt220_init(int early)
        return 0;
 }
 
-static struct tty_operations sclp_vt220_ops = {
+static const struct tty_operations sclp_vt220_ops = {
        .open = sclp_vt220_open,
        .close = sclp_vt220_close,
        .write = sclp_vt220_write,
index 06e2eeec8473dca2e3ff3c79ae5fab78014eac0c..4717c3611601f308094f588238a5b6c8c039cbd9 100644 (file)
@@ -1737,7 +1737,7 @@ tty3270_ioctl(struct tty_struct *tty, struct file *file,
        return kbd_ioctl(tp->kbd, file, cmd, arg);
 }
 
-static struct tty_operations tty3270_ops = {
+static const struct tty_operations tty3270_ops = {
        .open = tty3270_open,
        .close = tty3270_close,
        .write = tty3270_write,
index 4fdb2c932210a80772d74c69636061734af334cf..a305d4091547f9180a367a26bc67d410d1e926cc 100644 (file)
@@ -2187,7 +2187,7 @@ static void do_softint(void *private_)
 #endif
 }
 
-static struct tty_operations aurora_ops = {
+static const struct tty_operations aurora_ops = {
        .open  = aurora_open,
        .close = aurora_close,
        .write = aurora_write,
index 993a702422ec6e2e22175ea67e6c9bacb55ab093..bac853c5abb565dfeb11cc32ed910191f956a9c9 100644 (file)
@@ -1378,7 +1378,7 @@ void startup_console(void)
 #endif /* CONFIG_PM_LEGACY */
 
 
-static struct tty_operations rs_ops = {
+static const struct tty_operations rs_ops = {
        .open = rs_open,
        .close = rs_close,
        .write = rs_write,
index e80e70e9b12620487236f4ec56b3cb416104fc53..1b299e8c57cdf7071b5d155aa556d4ef05d51b29 100644 (file)
@@ -2424,7 +2424,7 @@ long console_360_init(long kmem_start, long kmem_end)
 */
 static int     baud_idx;
 
-static struct tty_operations rs_360_ops = {
+static const struct tty_operations rs_360_ops = {
        .owner = THIS_MODULE,
        .open = rs_360_open,
        .close = rs_360_close,
index cabd048c8636060138b497b294bd9b4f6e9e1382..9851d9eff022a6e655db1011fa1f93cbd8cd03b4 100644 (file)
@@ -4825,7 +4825,7 @@ show_serial_version(void)
 
 /* rs_init inits the driver at boot (using the module_init chain) */
 
-static struct tty_operations rs_ops = {
+static const struct tty_operations rs_ops = {
        .open = rs_open,
        .close = rs_close,
        .write = rs_write,
index 832abd3c4706ddabe8a3a6c07d9caf0e2b8e139f..00d7859c167ec7c246c885cc918e2932cd1df69e 100644 (file)
@@ -1666,7 +1666,7 @@ static void show_serial_version(void)
        printk(mcfrs_drivername);
 }
 
-static struct tty_operations mcfrs_ops = {
+static const struct tty_operations mcfrs_ops = {
        .open = mcfrs_open,
        .close = mcfrs_close,
        .write = mcfrs_write,
index 5f7ba1adb309c20d6d2abe9a4847f77473e4519d..de5e8930a6fd49d64e332919f4d358ef0c3549d4 100644 (file)
@@ -2111,7 +2111,7 @@ uart_configure_port(struct uart_driver *drv, struct uart_state *state,
        }
 }
 
-static struct tty_operations uart_ops = {
+static const struct tty_operations uart_ops = {
        .open           = uart_open,
        .close          = uart_close,
        .write          = uart_write,
index 5e8a27620f6f339045981b5994b4138c69be073a..622881f26761263dafef90ed1dec8c611950a696 100644 (file)
@@ -1701,7 +1701,7 @@ static void __init probe_sccs(void)
        spin_unlock_irqrestore(&zs_lock, flags);
 }
 
-static struct tty_operations serial_ops = {
+static const struct tty_operations serial_ops = {
        .open = rs_open,
        .close = rs_close,
        .write = rs_write,
index ca90326f2f5c6983ad6a6cd44f6980251ea11ca9..71288295df2f7f5113c30a25fc1d054c019319aa 100644 (file)
@@ -1120,7 +1120,7 @@ static struct usb_driver acm_driver = {
  * TTY driver structures.
  */
 
-static struct tty_operations acm_ops = {
+static const struct tty_operations acm_ops = {
        .open =                 acm_tty_open,
        .close =                acm_tty_close,
        .write =                acm_tty_write,
index b893e3118e1be480e9b4d8bbd739152efd718141..489a85e58bcaecdd500fed37af01810e3f7503c0 100644 (file)
@@ -271,7 +271,7 @@ static unsigned int use_acm = GS_DEFAULT_USE_ACM;
 
 
 /* tty driver struct */
-static struct tty_operations gs_tty_ops = {
+static const struct tty_operations gs_tty_ops = {
        .open =                 gs_open,
        .close =                gs_close,
        .write =                gs_write,
index 0222d92842b8ba79e89404d58ebcd06c729e8a2a..8006e51c34bb108e28d40b5956f8d29f47a146ef 100644 (file)
@@ -1015,7 +1015,7 @@ void usb_serial_disconnect(struct usb_interface *interface)
        dev_info(dev, "device disconnected\n");
 }
 
-static struct tty_operations serial_ops = {
+static const struct tty_operations serial_ops = {
        .open =                 serial_open,
        .close =                serial_close,
        .write =                serial_write,
index 58c961c9e1707027fe8989bfa821c78121fdb183..5c8473bb6882e7cc4f7dfe03a33072e94f6bceb2 100644 (file)
@@ -219,7 +219,8 @@ extern struct list_head tty_drivers;
 
 struct tty_driver *alloc_tty_driver(int lines);
 void put_tty_driver(struct tty_driver *driver);
-void tty_set_operations(struct tty_driver *driver, struct tty_operations *op);
+void tty_set_operations(struct tty_driver *driver,
+                       const struct tty_operations *op);
 
 /* tty driver magic number */
 #define TTY_DRIVER_MAGIC               0x5402
index 26f322737db0c83702267b25190dca8fa925c324..1958ad1b8541e57be7f32bb70b2b19a242884dce 100644 (file)
@@ -1011,7 +1011,7 @@ static int rfcomm_tty_tiocmset(struct tty_struct *tty, struct file *filp, unsign
 
 /* ---- TTY structure ---- */
 
-static struct tty_operations rfcomm_ops = {
+static const struct tty_operations rfcomm_ops = {
        .open                   = rfcomm_tty_open,
        .close                  = rfcomm_tty_close,
        .write                  = rfcomm_tty_write,
index 3bcdb467efc5658dd525d924acfd3faffd2adccb..d50a02030ad72dbf1598a87d24812203241a36a4 100644 (file)
@@ -79,7 +79,7 @@ static struct tty_driver *driver;
 
 hashbin_t *ircomm_tty = NULL;
 
-static struct tty_operations ops = {
+static const struct tty_operations ops = {
        .open            = ircomm_tty_open,
        .close           = ircomm_tty_close,
        .write           = ircomm_tty_write,