aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorJames Morris <jmorris@macbook.(none)>2009-12-03 01:33:40 -0500
committerJames Morris <jmorris@macbook.(none)>2009-12-03 01:33:40 -0500
commitc84d6efd363a3948eb32ec40d46bab6338580454 (patch)
tree3ba7ac46e6626fe8ac843834588609eb6ccee5c6 /drivers/char
parent7539cf4b92be4aecc573ea962135f246a7a33401 (diff)
parent22763c5cf3690a681551162c15d34d935308c8d7 (diff)
Merge branch 'master' into next
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/Kconfig6
-rw-r--r--drivers/char/agp/intel-agp.c19
-rw-r--r--drivers/char/agp/parisc-agp.c2
-rw-r--r--drivers/char/apm-emulation.c2
-rw-r--r--drivers/char/applicom.c1
-rw-r--r--drivers/char/bfin-otp.c2
-rw-r--r--drivers/char/cyclades.c2
-rw-r--r--drivers/char/dtlk.c1
-rw-r--r--drivers/char/epca.c1
-rw-r--r--drivers/char/generic_serial.c1
-rw-r--r--drivers/char/genrtc.c1
-rw-r--r--drivers/char/hvc_xen.c25
-rw-r--r--drivers/char/hw_random/omap-rng.c4
-rw-r--r--drivers/char/hw_random/virtio-rng.c3
-rw-r--r--drivers/char/ipmi/ipmi_devintf.c1
-rw-r--r--drivers/char/ipmi/ipmi_msghandler.c1
-rw-r--r--drivers/char/istallion.c1
-rw-r--r--drivers/char/keyboard.c2
-rw-r--r--drivers/char/nozomi.c1
-rw-r--r--drivers/char/pty.c48
-rw-r--r--drivers/char/rio/riocmd.c1
-rw-r--r--drivers/char/rio/rioctrl.c1
-rw-r--r--drivers/char/rio/riotty.c1
-rw-r--r--drivers/char/rtc.c1
-rw-r--r--drivers/char/ser_a2232.c1
-rw-r--r--drivers/char/serial167.c7
-rw-r--r--drivers/char/sonypi.c1
-rw-r--r--drivers/char/stallion.c1
-rw-r--r--drivers/char/tlclk.c1
-rw-r--r--drivers/char/tty_buffer.c31
-rw-r--r--drivers/char/tty_ldisc.c7
-rw-r--r--drivers/char/tty_port.c10
-rw-r--r--drivers/char/virtio_console.c1
-rw-r--r--drivers/char/vt_ioctl.c14
-rw-r--r--drivers/char/xilinx_hwicap/xilinx_hwicap.c2
35 files changed, 126 insertions, 78 deletions
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index 08a6f50ae791..6aad99ec4e0f 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -323,7 +323,7 @@ config SPECIALIX
323 323
324config SX 324config SX
325 tristate "Specialix SX (and SI) card support" 325 tristate "Specialix SX (and SI) card support"
326 depends on SERIAL_NONSTANDARD && (PCI || EISA || ISA) 326 depends on SERIAL_NONSTANDARD && (PCI || EISA || ISA) && BROKEN
327 help 327 help
328 This is a driver for the SX and SI multiport serial cards. 328 This is a driver for the SX and SI multiport serial cards.
329 Please read the file <file:Documentation/serial/sx.txt> for details. 329 Please read the file <file:Documentation/serial/sx.txt> for details.
@@ -334,7 +334,7 @@ config SX
334 334
335config RIO 335config RIO
336 tristate "Specialix RIO system support" 336 tristate "Specialix RIO system support"
337 depends on SERIAL_NONSTANDARD 337 depends on SERIAL_NONSTANDARD && BROKEN
338 help 338 help
339 This is a driver for the Specialix RIO, a smart serial card which 339 This is a driver for the Specialix RIO, a smart serial card which
340 drives an outboard box that can support up to 128 ports. Product 340 drives an outboard box that can support up to 128 ports. Product
@@ -395,7 +395,7 @@ config NOZOMI
395 395
396config A2232 396config A2232
397 tristate "Commodore A2232 serial support (EXPERIMENTAL)" 397 tristate "Commodore A2232 serial support (EXPERIMENTAL)"
398 depends on EXPERIMENTAL && ZORRO && BROKEN_ON_SMP 398 depends on EXPERIMENTAL && ZORRO && BROKEN
399 ---help--- 399 ---help---
400 This option supports the 2232 7-port serial card shipped with the 400 This option supports the 2232 7-port serial card shipped with the
401 Amiga 2000 and other Zorro-bus machines, dating from 1989. At 401 Amiga 2000 and other Zorro-bus machines, dating from 1989. At
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c
index 4068467ce7b9..3cb56a049e24 100644
--- a/drivers/char/agp/intel-agp.c
+++ b/drivers/char/agp/intel-agp.c
@@ -62,6 +62,7 @@
62#define PCI_DEVICE_ID_INTEL_IGDNG_D_IG 0x0042 62#define PCI_DEVICE_ID_INTEL_IGDNG_D_IG 0x0042
63#define PCI_DEVICE_ID_INTEL_IGDNG_M_HB 0x0044 63#define PCI_DEVICE_ID_INTEL_IGDNG_M_HB 0x0044
64#define PCI_DEVICE_ID_INTEL_IGDNG_MA_HB 0x0062 64#define PCI_DEVICE_ID_INTEL_IGDNG_MA_HB 0x0062
65#define PCI_DEVICE_ID_INTEL_IGDNG_MC2_HB 0x006a
65#define PCI_DEVICE_ID_INTEL_IGDNG_M_IG 0x0046 66#define PCI_DEVICE_ID_INTEL_IGDNG_M_IG 0x0046
66 67
67/* cover 915 and 945 variants */ 68/* cover 915 and 945 variants */
@@ -96,7 +97,8 @@
96 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_B43_HB || \ 97 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_B43_HB || \
97 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IGDNG_D_HB || \ 98 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IGDNG_D_HB || \
98 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IGDNG_M_HB || \ 99 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IGDNG_M_HB || \
99 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IGDNG_MA_HB) 100 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IGDNG_MA_HB || \
101 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IGDNG_MC2_HB)
100 102
101extern int agp_memory_reserved; 103extern int agp_memory_reserved;
102 104
@@ -1161,12 +1163,6 @@ static int intel_i915_configure(void)
1161 1163
1162 intel_i9xx_setup_flush(); 1164 intel_i9xx_setup_flush();
1163 1165
1164#ifdef USE_PCI_DMA_API
1165 if (pci_set_dma_mask(intel_private.pcidev, DMA_BIT_MASK(36)))
1166 dev_err(&intel_private.pcidev->dev,
1167 "set gfx device dma mask 36bit failed!\n");
1168#endif
1169
1170 return 0; 1166 return 0;
1171} 1167}
1172 1168
@@ -1364,6 +1360,7 @@ static void intel_i965_get_gtt_range(int *gtt_offset, int *gtt_size)
1364 case PCI_DEVICE_ID_INTEL_IGDNG_D_HB: 1360 case PCI_DEVICE_ID_INTEL_IGDNG_D_HB:
1365 case PCI_DEVICE_ID_INTEL_IGDNG_M_HB: 1361 case PCI_DEVICE_ID_INTEL_IGDNG_M_HB:
1366 case PCI_DEVICE_ID_INTEL_IGDNG_MA_HB: 1362 case PCI_DEVICE_ID_INTEL_IGDNG_MA_HB:
1363 case PCI_DEVICE_ID_INTEL_IGDNG_MC2_HB:
1367 *gtt_offset = *gtt_size = MB(2); 1364 *gtt_offset = *gtt_size = MB(2);
1368 break; 1365 break;
1369 default: 1366 default:
@@ -2365,6 +2362,8 @@ static const struct intel_driver_description {
2365 "IGDNG/M", NULL, &intel_i965_driver }, 2362 "IGDNG/M", NULL, &intel_i965_driver },
2366 { PCI_DEVICE_ID_INTEL_IGDNG_MA_HB, PCI_DEVICE_ID_INTEL_IGDNG_M_IG, 0, 2363 { PCI_DEVICE_ID_INTEL_IGDNG_MA_HB, PCI_DEVICE_ID_INTEL_IGDNG_M_IG, 0,
2367 "IGDNG/MA", NULL, &intel_i965_driver }, 2364 "IGDNG/MA", NULL, &intel_i965_driver },
2365 { PCI_DEVICE_ID_INTEL_IGDNG_MC2_HB, PCI_DEVICE_ID_INTEL_IGDNG_M_IG, 0,
2366 "IGDNG/MC2", NULL, &intel_i965_driver },
2368 { 0, 0, 0, NULL, NULL, NULL } 2367 { 0, 0, 0, NULL, NULL, NULL }
2369}; 2368};
2370 2369
@@ -2456,6 +2455,11 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev,
2456 &bridge->mode); 2455 &bridge->mode);
2457 } 2456 }
2458 2457
2458 if (bridge->driver->mask_memory == intel_i965_mask_memory)
2459 if (pci_set_dma_mask(intel_private.pcidev, DMA_BIT_MASK(36)))
2460 dev_err(&intel_private.pcidev->dev,
2461 "set gfx device dma mask 36bit failed!\n");
2462
2459 pci_set_drvdata(pdev, bridge); 2463 pci_set_drvdata(pdev, bridge);
2460 return agp_add_bridge(bridge); 2464 return agp_add_bridge(bridge);
2461} 2465}
@@ -2561,6 +2565,7 @@ static struct pci_device_id agp_intel_pci_table[] = {
2561 ID(PCI_DEVICE_ID_INTEL_IGDNG_D_HB), 2565 ID(PCI_DEVICE_ID_INTEL_IGDNG_D_HB),
2562 ID(PCI_DEVICE_ID_INTEL_IGDNG_M_HB), 2566 ID(PCI_DEVICE_ID_INTEL_IGDNG_M_HB),
2563 ID(PCI_DEVICE_ID_INTEL_IGDNG_MA_HB), 2567 ID(PCI_DEVICE_ID_INTEL_IGDNG_MA_HB),
2568 ID(PCI_DEVICE_ID_INTEL_IGDNG_MC2_HB),
2564 { } 2569 { }
2565}; 2570};
2566 2571
diff --git a/drivers/char/agp/parisc-agp.c b/drivers/char/agp/parisc-agp.c
index 60ab75104da9..1c129211302d 100644
--- a/drivers/char/agp/parisc-agp.c
+++ b/drivers/char/agp/parisc-agp.c
@@ -217,7 +217,7 @@ static const struct agp_bridge_driver parisc_agp_driver = {
217 .configure = parisc_agp_configure, 217 .configure = parisc_agp_configure,
218 .fetch_size = parisc_agp_fetch_size, 218 .fetch_size = parisc_agp_fetch_size,
219 .tlb_flush = parisc_agp_tlbflush, 219 .tlb_flush = parisc_agp_tlbflush,
220 .mask_memory = parisc_agp_page_mask_memory, 220 .mask_memory = parisc_agp_mask_memory,
221 .masks = parisc_agp_masks, 221 .masks = parisc_agp_masks,
222 .agp_enable = parisc_agp_enable, 222 .agp_enable = parisc_agp_enable,
223 .cache_flush = global_cache_flush, 223 .cache_flush = global_cache_flush,
diff --git a/drivers/char/apm-emulation.c b/drivers/char/apm-emulation.c
index aaca40283be9..4f568cb9af3f 100644
--- a/drivers/char/apm-emulation.c
+++ b/drivers/char/apm-emulation.c
@@ -393,7 +393,7 @@ static int apm_open(struct inode * inode, struct file * filp)
393 return as ? 0 : -ENOMEM; 393 return as ? 0 : -ENOMEM;
394} 394}
395 395
396static struct file_operations apm_bios_fops = { 396static const struct file_operations apm_bios_fops = {
397 .owner = THIS_MODULE, 397 .owner = THIS_MODULE,
398 .read = apm_read, 398 .read = apm_read,
399 .poll = apm_poll, 399 .poll = apm_poll,
diff --git a/drivers/char/applicom.c b/drivers/char/applicom.c
index 73a0765344b6..fe2cb2f5db17 100644
--- a/drivers/char/applicom.c
+++ b/drivers/char/applicom.c
@@ -23,6 +23,7 @@
23#include <linux/kernel.h> 23#include <linux/kernel.h>
24#include <linux/module.h> 24#include <linux/module.h>
25#include <linux/interrupt.h> 25#include <linux/interrupt.h>
26#include <linux/sched.h>
26#include <linux/slab.h> 27#include <linux/slab.h>
27#include <linux/errno.h> 28#include <linux/errno.h>
28#include <linux/miscdevice.h> 29#include <linux/miscdevice.h>
diff --git a/drivers/char/bfin-otp.c b/drivers/char/bfin-otp.c
index e3dd24bff514..836d4f0a876f 100644
--- a/drivers/char/bfin-otp.c
+++ b/drivers/char/bfin-otp.c
@@ -217,7 +217,7 @@ static long bfin_otp_ioctl(struct file *filp, unsigned cmd, unsigned long arg)
217# define bfin_otp_ioctl NULL 217# define bfin_otp_ioctl NULL
218#endif 218#endif
219 219
220static struct file_operations bfin_otp_fops = { 220static const struct file_operations bfin_otp_fops = {
221 .owner = THIS_MODULE, 221 .owner = THIS_MODULE,
222 .unlocked_ioctl = bfin_otp_ioctl, 222 .unlocked_ioctl = bfin_otp_ioctl,
223 .read = bfin_otp_read, 223 .read = bfin_otp_read,
diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c
index df5038bbcbc2..4254457d3911 100644
--- a/drivers/char/cyclades.c
+++ b/drivers/char/cyclades.c
@@ -3354,7 +3354,7 @@ static int __init cy_detect_isa(void)
3354 continue; 3354 continue;
3355 } 3355 }
3356#ifdef MODULE 3356#ifdef MODULE
3357 if (isparam && irq[i]) 3357 if (isparam && i < NR_CARDS && irq[i])
3358 cy_isa_irq = irq[i]; 3358 cy_isa_irq = irq[i];
3359 else 3359 else
3360#endif 3360#endif
diff --git a/drivers/char/dtlk.c b/drivers/char/dtlk.c
index 52e06589821d..045c930e6320 100644
--- a/drivers/char/dtlk.c
+++ b/drivers/char/dtlk.c
@@ -56,6 +56,7 @@
56#include <linux/errno.h> /* for -EBUSY */ 56#include <linux/errno.h> /* for -EBUSY */
57#include <linux/ioport.h> /* for request_region */ 57#include <linux/ioport.h> /* for request_region */
58#include <linux/delay.h> /* for loops_per_jiffy */ 58#include <linux/delay.h> /* for loops_per_jiffy */
59#include <linux/sched.h>
59#include <linux/smp_lock.h> /* cycle_kernel_lock() */ 60#include <linux/smp_lock.h> /* cycle_kernel_lock() */
60#include <asm/io.h> /* for inb_p, outb_p, inb, outb, etc. */ 61#include <asm/io.h> /* for inb_p, outb_p, inb, outb, etc. */
61#include <asm/uaccess.h> /* for get_user, etc. */ 62#include <asm/uaccess.h> /* for get_user, etc. */
diff --git a/drivers/char/epca.c b/drivers/char/epca.c
index 9d589e3144de..dde5134713e2 100644
--- a/drivers/char/epca.c
+++ b/drivers/char/epca.c
@@ -30,6 +30,7 @@
30#include <linux/kernel.h> 30#include <linux/kernel.h>
31#include <linux/types.h> 31#include <linux/types.h>
32#include <linux/init.h> 32#include <linux/init.h>
33#include <linux/sched.h>
33#include <linux/serial.h> 34#include <linux/serial.h>
34#include <linux/delay.h> 35#include <linux/delay.h>
35#include <linux/ctype.h> 36#include <linux/ctype.h>
diff --git a/drivers/char/generic_serial.c b/drivers/char/generic_serial.c
index 9e4e569dc00d..d400cbd280f2 100644
--- a/drivers/char/generic_serial.c
+++ b/drivers/char/generic_serial.c
@@ -22,6 +22,7 @@
22#include <linux/module.h> 22#include <linux/module.h>
23#include <linux/kernel.h> 23#include <linux/kernel.h>
24#include <linux/tty.h> 24#include <linux/tty.h>
25#include <linux/sched.h>
25#include <linux/serial.h> 26#include <linux/serial.h>
26#include <linux/mm.h> 27#include <linux/mm.h>
27#include <linux/generic_serial.h> 28#include <linux/generic_serial.h>
diff --git a/drivers/char/genrtc.c b/drivers/char/genrtc.c
index aac0985a572b..31e7c91c2d9d 100644
--- a/drivers/char/genrtc.c
+++ b/drivers/char/genrtc.c
@@ -43,6 +43,7 @@
43#define RTC_VERSION "1.07" 43#define RTC_VERSION "1.07"
44 44
45#include <linux/module.h> 45#include <linux/module.h>
46#include <linux/sched.h>
46#include <linux/errno.h> 47#include <linux/errno.h>
47#include <linux/miscdevice.h> 48#include <linux/miscdevice.h>
48#include <linux/fcntl.h> 49#include <linux/fcntl.h>
diff --git a/drivers/char/hvc_xen.c b/drivers/char/hvc_xen.c
index eba999f8598d..a6ee32b599a8 100644
--- a/drivers/char/hvc_xen.c
+++ b/drivers/char/hvc_xen.c
@@ -55,7 +55,7 @@ static inline void notify_daemon(void)
55 notify_remote_via_evtchn(xen_start_info->console.domU.evtchn); 55 notify_remote_via_evtchn(xen_start_info->console.domU.evtchn);
56} 56}
57 57
58static int write_console(uint32_t vtermno, const char *data, int len) 58static int __write_console(const char *data, int len)
59{ 59{
60 struct xencons_interface *intf = xencons_interface(); 60 struct xencons_interface *intf = xencons_interface();
61 XENCONS_RING_IDX cons, prod; 61 XENCONS_RING_IDX cons, prod;
@@ -76,6 +76,29 @@ static int write_console(uint32_t vtermno, const char *data, int len)
76 return sent; 76 return sent;
77} 77}
78 78
79static int write_console(uint32_t vtermno, const char *data, int len)
80{
81 int ret = len;
82
83 /*
84 * Make sure the whole buffer is emitted, polling if
85 * necessary. We don't ever want to rely on the hvc daemon
86 * because the most interesting console output is when the
87 * kernel is crippled.
88 */
89 while (len) {
90 int sent = __write_console(data, len);
91
92 data += sent;
93 len -= sent;
94
95 if (unlikely(len))
96 HYPERVISOR_sched_op(SCHEDOP_yield, NULL);
97 }
98
99 return ret;
100}
101
79static int read_console(uint32_t vtermno, char *buf, int len) 102static int read_console(uint32_t vtermno, char *buf, int len)
80{ 103{
81 struct xencons_interface *intf = xencons_interface(); 104 struct xencons_interface *intf = xencons_interface();
diff --git a/drivers/char/hw_random/omap-rng.c b/drivers/char/hw_random/omap-rng.c
index 00dd3de1be51..06aad0831c73 100644
--- a/drivers/char/hw_random/omap-rng.c
+++ b/drivers/char/hw_random/omap-rng.c
@@ -116,7 +116,7 @@ static int __devinit omap_rng_probe(struct platform_device *pdev)
116 if (!res) 116 if (!res)
117 return -ENOENT; 117 return -ENOENT;
118 118
119 mem = request_mem_region(res->start, res->end - res->start + 1, 119 mem = request_mem_region(res->start, resource_size(res),
120 pdev->name); 120 pdev->name);
121 if (mem == NULL) { 121 if (mem == NULL) {
122 ret = -EBUSY; 122 ret = -EBUSY;
@@ -124,7 +124,7 @@ static int __devinit omap_rng_probe(struct platform_device *pdev)
124 } 124 }
125 125
126 dev_set_drvdata(&pdev->dev, mem); 126 dev_set_drvdata(&pdev->dev, mem);
127 rng_base = ioremap(res->start, res->end - res->start + 1); 127 rng_base = ioremap(res->start, resource_size(res));
128 if (!rng_base) { 128 if (!rng_base) {
129 ret = -ENOMEM; 129 ret = -ENOMEM;
130 goto err_ioremap; 130 goto err_ioremap;
diff --git a/drivers/char/hw_random/virtio-rng.c b/drivers/char/hw_random/virtio-rng.c
index 962968f05b94..915157fcff98 100644
--- a/drivers/char/hw_random/virtio-rng.c
+++ b/drivers/char/hw_random/virtio-rng.c
@@ -21,7 +21,6 @@
21#include <linux/scatterlist.h> 21#include <linux/scatterlist.h>
22#include <linux/spinlock.h> 22#include <linux/spinlock.h>
23#include <linux/virtio.h> 23#include <linux/virtio.h>
24#include <linux/virtio_ids.h>
25#include <linux/virtio_rng.h> 24#include <linux/virtio_rng.h>
26 25
27/* The host will fill any buffer we give it with sweet, sweet randomness. We 26/* The host will fill any buffer we give it with sweet, sweet randomness. We
@@ -117,7 +116,7 @@ static int virtrng_probe(struct virtio_device *vdev)
117 return 0; 116 return 0;
118} 117}
119 118
120static void virtrng_remove(struct virtio_device *vdev) 119static void __devexit virtrng_remove(struct virtio_device *vdev)
121{ 120{
122 vdev->config->reset(vdev); 121 vdev->config->reset(vdev);
123 hwrng_unregister(&virtio_hwrng); 122 hwrng_unregister(&virtio_hwrng);
diff --git a/drivers/char/ipmi/ipmi_devintf.c b/drivers/char/ipmi/ipmi_devintf.c
index 41fc11dc921c..65545de3dbf4 100644
--- a/drivers/char/ipmi/ipmi_devintf.c
+++ b/drivers/char/ipmi/ipmi_devintf.c
@@ -36,6 +36,7 @@
36#include <linux/errno.h> 36#include <linux/errno.h>
37#include <asm/system.h> 37#include <asm/system.h>
38#include <linux/poll.h> 38#include <linux/poll.h>
39#include <linux/sched.h>
39#include <linux/spinlock.h> 40#include <linux/spinlock.h>
40#include <linux/slab.h> 41#include <linux/slab.h>
41#include <linux/ipmi.h> 42#include <linux/ipmi.h>
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c
index 09050797c76a..ec5e3f8df648 100644
--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
@@ -35,6 +35,7 @@
35#include <linux/errno.h> 35#include <linux/errno.h>
36#include <asm/system.h> 36#include <asm/system.h>
37#include <linux/poll.h> 37#include <linux/poll.h>
38#include <linux/sched.h>
38#include <linux/spinlock.h> 39#include <linux/spinlock.h>
39#include <linux/mutex.h> 40#include <linux/mutex.h>
40#include <linux/slab.h> 41#include <linux/slab.h>
diff --git a/drivers/char/istallion.c b/drivers/char/istallion.c
index ab2f3349c5c4..402838f4083e 100644
--- a/drivers/char/istallion.c
+++ b/drivers/char/istallion.c
@@ -19,6 +19,7 @@
19/*****************************************************************************/ 19/*****************************************************************************/
20 20
21#include <linux/module.h> 21#include <linux/module.h>
22#include <linux/sched.h>
22#include <linux/slab.h> 23#include <linux/slab.h>
23#include <linux/smp_lock.h> 24#include <linux/smp_lock.h>
24#include <linux/interrupt.h> 25#include <linux/interrupt.h>
diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c
index 737be953cc58..950837cf9e9c 100644
--- a/drivers/char/keyboard.c
+++ b/drivers/char/keyboard.c
@@ -1249,7 +1249,7 @@ static void kbd_keycode(unsigned int keycode, int down, int hw_raw)
1249 1249
1250 if (keycode >= NR_KEYS) 1250 if (keycode >= NR_KEYS)
1251 if (keycode >= KEY_BRL_DOT1 && keycode <= KEY_BRL_DOT8) 1251 if (keycode >= KEY_BRL_DOT1 && keycode <= KEY_BRL_DOT8)
1252 keysym = K(KT_BRL, keycode - KEY_BRL_DOT1 + 1); 1252 keysym = U(K(KT_BRL, keycode - KEY_BRL_DOT1 + 1));
1253 else 1253 else
1254 return; 1254 return;
1255 else 1255 else
diff --git a/drivers/char/nozomi.c b/drivers/char/nozomi.c
index ec58d8c387ff..d3400b20444f 100644
--- a/drivers/char/nozomi.c
+++ b/drivers/char/nozomi.c
@@ -48,6 +48,7 @@
48#include <linux/tty.h> 48#include <linux/tty.h>
49#include <linux/tty_driver.h> 49#include <linux/tty_driver.h>
50#include <linux/tty_flip.h> 50#include <linux/tty_flip.h>
51#include <linux/sched.h>
51#include <linux/serial.h> 52#include <linux/serial.h>
52#include <linux/interrupt.h> 53#include <linux/interrupt.h>
53#include <linux/kmod.h> 54#include <linux/kmod.h>
diff --git a/drivers/char/pty.c b/drivers/char/pty.c
index 53761cefa915..62f282e67638 100644
--- a/drivers/char/pty.c
+++ b/drivers/char/pty.c
@@ -18,6 +18,7 @@
18#include <linux/tty.h> 18#include <linux/tty.h>
19#include <linux/tty_flip.h> 19#include <linux/tty_flip.h>
20#include <linux/fcntl.h> 20#include <linux/fcntl.h>
21#include <linux/sched.h>
21#include <linux/string.h> 22#include <linux/string.h>
22#include <linux/major.h> 23#include <linux/major.h>
23#include <linux/mm.h> 24#include <linux/mm.h>
@@ -261,6 +262,9 @@ done:
261 return 0; 262 return 0;
262} 263}
263 264
265/* Traditional BSD devices */
266#ifdef CONFIG_LEGACY_PTYS
267
264static int pty_install(struct tty_driver *driver, struct tty_struct *tty) 268static int pty_install(struct tty_driver *driver, struct tty_struct *tty)
265{ 269{
266 struct tty_struct *o_tty; 270 struct tty_struct *o_tty;
@@ -310,24 +314,6 @@ free_mem_out:
310 return -ENOMEM; 314 return -ENOMEM;
311} 315}
312 316
313
314static const struct tty_operations pty_ops = {
315 .install = pty_install,
316 .open = pty_open,
317 .close = pty_close,
318 .write = pty_write,
319 .write_room = pty_write_room,
320 .flush_buffer = pty_flush_buffer,
321 .chars_in_buffer = pty_chars_in_buffer,
322 .unthrottle = pty_unthrottle,
323 .set_termios = pty_set_termios,
324 .resize = pty_resize
325};
326
327/* Traditional BSD devices */
328#ifdef CONFIG_LEGACY_PTYS
329static struct tty_driver *pty_driver, *pty_slave_driver;
330
331static int pty_bsd_ioctl(struct tty_struct *tty, struct file *file, 317static int pty_bsd_ioctl(struct tty_struct *tty, struct file *file,
332 unsigned int cmd, unsigned long arg) 318 unsigned int cmd, unsigned long arg)
333{ 319{
@@ -341,7 +327,12 @@ static int pty_bsd_ioctl(struct tty_struct *tty, struct file *file,
341static int legacy_count = CONFIG_LEGACY_PTY_COUNT; 327static int legacy_count = CONFIG_LEGACY_PTY_COUNT;
342module_param(legacy_count, int, 0); 328module_param(legacy_count, int, 0);
343 329
344static const struct tty_operations pty_ops_bsd = { 330/*
331 * The master side of a pty can do TIOCSPTLCK and thus
332 * has pty_bsd_ioctl.
333 */
334static const struct tty_operations master_pty_ops_bsd = {
335 .install = pty_install,
345 .open = pty_open, 336 .open = pty_open,
346 .close = pty_close, 337 .close = pty_close,
347 .write = pty_write, 338 .write = pty_write,
@@ -354,8 +345,23 @@ static const struct tty_operations pty_ops_bsd = {
354 .resize = pty_resize 345 .resize = pty_resize
355}; 346};
356 347
348static const struct tty_operations slave_pty_ops_bsd = {
349 .install = pty_install,
350 .open = pty_open,
351 .close = pty_close,
352 .write = pty_write,
353 .write_room = pty_write_room,
354 .flush_buffer = pty_flush_buffer,
355 .chars_in_buffer = pty_chars_in_buffer,
356 .unthrottle = pty_unthrottle,
357 .set_termios = pty_set_termios,
358 .resize = pty_resize
359};
360
357static void __init legacy_pty_init(void) 361static void __init legacy_pty_init(void)
358{ 362{
363 struct tty_driver *pty_driver, *pty_slave_driver;
364
359 if (legacy_count <= 0) 365 if (legacy_count <= 0)
360 return; 366 return;
361 367
@@ -383,7 +389,7 @@ static void __init legacy_pty_init(void)
383 pty_driver->init_termios.c_ospeed = 38400; 389 pty_driver->init_termios.c_ospeed = 38400;
384 pty_driver->flags = TTY_DRIVER_RESET_TERMIOS | TTY_DRIVER_REAL_RAW; 390 pty_driver->flags = TTY_DRIVER_RESET_TERMIOS | TTY_DRIVER_REAL_RAW;
385 pty_driver->other = pty_slave_driver; 391 pty_driver->other = pty_slave_driver;
386 tty_set_operations(pty_driver, &pty_ops); 392 tty_set_operations(pty_driver, &master_pty_ops_bsd);
387 393
388 pty_slave_driver->owner = THIS_MODULE; 394 pty_slave_driver->owner = THIS_MODULE;
389 pty_slave_driver->driver_name = "pty_slave"; 395 pty_slave_driver->driver_name = "pty_slave";
@@ -399,7 +405,7 @@ static void __init legacy_pty_init(void)
399 pty_slave_driver->flags = TTY_DRIVER_RESET_TERMIOS | 405 pty_slave_driver->flags = TTY_DRIVER_RESET_TERMIOS |
400 TTY_DRIVER_REAL_RAW; 406 TTY_DRIVER_REAL_RAW;
401 pty_slave_driver->other = pty_driver; 407 pty_slave_driver->other = pty_driver;
402 tty_set_operations(pty_slave_driver, &pty_ops); 408 tty_set_operations(pty_slave_driver, &slave_pty_ops_bsd);
403 409
404 if (tty_register_driver(pty_driver)) 410 if (tty_register_driver(pty_driver))
405 panic("Couldn't register pty driver"); 411 panic("Couldn't register pty driver");
diff --git a/drivers/char/rio/riocmd.c b/drivers/char/rio/riocmd.c
index 01f2654d5a2e..f121357e5af0 100644
--- a/drivers/char/rio/riocmd.c
+++ b/drivers/char/rio/riocmd.c
@@ -32,6 +32,7 @@
32*/ 32*/
33 33
34#include <linux/module.h> 34#include <linux/module.h>
35#include <linux/sched.h>
35#include <linux/slab.h> 36#include <linux/slab.h>
36#include <linux/errno.h> 37#include <linux/errno.h>
37#include <linux/tty.h> 38#include <linux/tty.h>
diff --git a/drivers/char/rio/rioctrl.c b/drivers/char/rio/rioctrl.c
index 74339559f0b9..780506326a73 100644
--- a/drivers/char/rio/rioctrl.c
+++ b/drivers/char/rio/rioctrl.c
@@ -31,6 +31,7 @@
31*/ 31*/
32 32
33#include <linux/module.h> 33#include <linux/module.h>
34#include <linux/sched.h>
34#include <linux/slab.h> 35#include <linux/slab.h>
35#include <linux/errno.h> 36#include <linux/errno.h>
36#include <asm/io.h> 37#include <asm/io.h>
diff --git a/drivers/char/rio/riotty.c b/drivers/char/rio/riotty.c
index 2fb49e89b324..47fab7c33073 100644
--- a/drivers/char/rio/riotty.c
+++ b/drivers/char/rio/riotty.c
@@ -33,6 +33,7 @@
33#define __EXPLICIT_DEF_H__ 33#define __EXPLICIT_DEF_H__
34 34
35#include <linux/module.h> 35#include <linux/module.h>
36#include <linux/sched.h>
36#include <linux/slab.h> 37#include <linux/slab.h>
37#include <linux/errno.h> 38#include <linux/errno.h>
38#include <linux/tty.h> 39#include <linux/tty.h>
diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c
index e0d0f8b2696b..bc4ab3e54550 100644
--- a/drivers/char/rtc.c
+++ b/drivers/char/rtc.c
@@ -74,6 +74,7 @@
74#include <linux/proc_fs.h> 74#include <linux/proc_fs.h>
75#include <linux/seq_file.h> 75#include <linux/seq_file.h>
76#include <linux/spinlock.h> 76#include <linux/spinlock.h>
77#include <linux/sched.h>
77#include <linux/sysctl.h> 78#include <linux/sysctl.h>
78#include <linux/wait.h> 79#include <linux/wait.h>
79#include <linux/bcd.h> 80#include <linux/bcd.h>
diff --git a/drivers/char/ser_a2232.c b/drivers/char/ser_a2232.c
index 33a2b531802e..9610861d1f5f 100644
--- a/drivers/char/ser_a2232.c
+++ b/drivers/char/ser_a2232.c
@@ -89,6 +89,7 @@
89#include <linux/interrupt.h> 89#include <linux/interrupt.h>
90#include <linux/kernel.h> 90#include <linux/kernel.h>
91#include <linux/errno.h> 91#include <linux/errno.h>
92#include <linux/sched.h>
92#include <linux/tty.h> 93#include <linux/tty.h>
93 94
94#include <asm/setup.h> 95#include <asm/setup.h>
diff --git a/drivers/char/serial167.c b/drivers/char/serial167.c
index 5942a9d674c0..452370af95de 100644
--- a/drivers/char/serial167.c
+++ b/drivers/char/serial167.c
@@ -220,8 +220,7 @@ static inline int serial_paranoia_check(struct cyclades_port *info, char *name,
220 return 1; 220 return 1;
221 } 221 }
222 222
223 if ((long)info < (long)(&cy_port[0]) 223 if (info < &cy_port[0] || info >= &cy_port[NR_PORTS]) {
224 || (long)(&cy_port[NR_PORTS]) < (long)info) {
225 printk("Warning: cyclades_port out of range for (%s) in %s\n", 224 printk("Warning: cyclades_port out of range for (%s) in %s\n",
226 name, routine); 225 name, routine);
227 return 1; 226 return 1;
@@ -520,15 +519,13 @@ static irqreturn_t cd2401_tx_interrupt(int irq, void *dev_id)
520 panic("TxInt on debug port!!!"); 519 panic("TxInt on debug port!!!");
521 } 520 }
522#endif 521#endif
523
524 info = &cy_port[channel];
525
526 /* validate the port number (as configured and open) */ 522 /* validate the port number (as configured and open) */
527 if ((channel < 0) || (NR_PORTS <= channel)) { 523 if ((channel < 0) || (NR_PORTS <= channel)) {
528 base_addr[CyIER] &= ~(CyTxMpty | CyTxRdy); 524 base_addr[CyIER] &= ~(CyTxMpty | CyTxRdy);
529 base_addr[CyTEOIR] = CyNOTRANS; 525 base_addr[CyTEOIR] = CyNOTRANS;
530 return IRQ_HANDLED; 526 return IRQ_HANDLED;
531 } 527 }
528 info = &cy_port[channel];
532 info->last_active = jiffies; 529 info->last_active = jiffies;
533 if (info->tty == 0) { 530 if (info->tty == 0) {
534 base_addr[CyIER] &= ~(CyTxMpty | CyTxRdy); 531 base_addr[CyIER] &= ~(CyTxMpty | CyTxRdy);
diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c
index fd3dced97776..8c262aaf7c26 100644
--- a/drivers/char/sonypi.c
+++ b/drivers/char/sonypi.c
@@ -36,6 +36,7 @@
36 */ 36 */
37 37
38#include <linux/module.h> 38#include <linux/module.h>
39#include <linux/sched.h>
39#include <linux/input.h> 40#include <linux/input.h>
40#include <linux/pci.h> 41#include <linux/pci.h>
41#include <linux/init.h> 42#include <linux/init.h>
diff --git a/drivers/char/stallion.c b/drivers/char/stallion.c
index 53e504f41b20..db6dcfa35ba0 100644
--- a/drivers/char/stallion.c
+++ b/drivers/char/stallion.c
@@ -27,6 +27,7 @@
27/*****************************************************************************/ 27/*****************************************************************************/
28 28
29#include <linux/module.h> 29#include <linux/module.h>
30#include <linux/sched.h>
30#include <linux/slab.h> 31#include <linux/slab.h>
31#include <linux/interrupt.h> 32#include <linux/interrupt.h>
32#include <linux/tty.h> 33#include <linux/tty.h>
diff --git a/drivers/char/tlclk.c b/drivers/char/tlclk.c
index 8f2284be68e1..80ea6bcfffdc 100644
--- a/drivers/char/tlclk.c
+++ b/drivers/char/tlclk.c
@@ -32,6 +32,7 @@
32#include <linux/kernel.h> /* printk() */ 32#include <linux/kernel.h> /* printk() */
33#include <linux/fs.h> /* everything... */ 33#include <linux/fs.h> /* everything... */
34#include <linux/errno.h> /* error codes */ 34#include <linux/errno.h> /* error codes */
35#include <linux/sched.h>
35#include <linux/slab.h> 36#include <linux/slab.h>
36#include <linux/ioport.h> 37#include <linux/ioport.h>
37#include <linux/interrupt.h> 38#include <linux/interrupt.h>
diff --git a/drivers/char/tty_buffer.c b/drivers/char/tty_buffer.c
index 3108991c5c8b..66fa4e10d76b 100644
--- a/drivers/char/tty_buffer.c
+++ b/drivers/char/tty_buffer.c
@@ -402,28 +402,26 @@ static void flush_to_ldisc(struct work_struct *work)
402 container_of(work, struct tty_struct, buf.work.work); 402 container_of(work, struct tty_struct, buf.work.work);
403 unsigned long flags; 403 unsigned long flags;
404 struct tty_ldisc *disc; 404 struct tty_ldisc *disc;
405 struct tty_buffer *tbuf, *head;
406 char *char_buf;
407 unsigned char *flag_buf;
408 405
409 disc = tty_ldisc_ref(tty); 406 disc = tty_ldisc_ref(tty);
410 if (disc == NULL) /* !TTY_LDISC */ 407 if (disc == NULL) /* !TTY_LDISC */
411 return; 408 return;
412 409
413 spin_lock_irqsave(&tty->buf.lock, flags); 410 spin_lock_irqsave(&tty->buf.lock, flags);
414 /* So we know a flush is running */ 411
415 set_bit(TTY_FLUSHING, &tty->flags); 412 if (!test_and_set_bit(TTY_FLUSHING, &tty->flags)) {
416 head = tty->buf.head; 413 struct tty_buffer *head;
417 if (head != NULL) { 414 while ((head = tty->buf.head) != NULL) {
418 tty->buf.head = NULL; 415 int count;
419 for (;;) { 416 char *char_buf;
420 int count = head->commit - head->read; 417 unsigned char *flag_buf;
418
419 count = head->commit - head->read;
421 if (!count) { 420 if (!count) {
422 if (head->next == NULL) 421 if (head->next == NULL)
423 break; 422 break;
424 tbuf = head; 423 tty->buf.head = head->next;
425 head = head->next; 424 tty_buffer_free(tty, head);
426 tty_buffer_free(tty, tbuf);
427 continue; 425 continue;
428 } 426 }
429 /* Ldisc or user is trying to flush the buffers 427 /* Ldisc or user is trying to flush the buffers
@@ -445,9 +443,9 @@ static void flush_to_ldisc(struct work_struct *work)
445 flag_buf, count); 443 flag_buf, count);
446 spin_lock_irqsave(&tty->buf.lock, flags); 444 spin_lock_irqsave(&tty->buf.lock, flags);
447 } 445 }
448 /* Restore the queue head */ 446 clear_bit(TTY_FLUSHING, &tty->flags);
449 tty->buf.head = head;
450 } 447 }
448
451 /* We may have a deferred request to flush the input buffer, 449 /* We may have a deferred request to flush the input buffer,
452 if so pull the chain under the lock and empty the queue */ 450 if so pull the chain under the lock and empty the queue */
453 if (test_bit(TTY_FLUSHPENDING, &tty->flags)) { 451 if (test_bit(TTY_FLUSHPENDING, &tty->flags)) {
@@ -455,7 +453,6 @@ static void flush_to_ldisc(struct work_struct *work)
455 clear_bit(TTY_FLUSHPENDING, &tty->flags); 453 clear_bit(TTY_FLUSHPENDING, &tty->flags);
456 wake_up(&tty->read_wait); 454 wake_up(&tty->read_wait);
457 } 455 }
458 clear_bit(TTY_FLUSHING, &tty->flags);
459 spin_unlock_irqrestore(&tty->buf.lock, flags); 456 spin_unlock_irqrestore(&tty->buf.lock, flags);
460 457
461 tty_ldisc_deref(disc); 458 tty_ldisc_deref(disc);
@@ -471,7 +468,7 @@ static void flush_to_ldisc(struct work_struct *work)
471 */ 468 */
472void tty_flush_to_ldisc(struct tty_struct *tty) 469void tty_flush_to_ldisc(struct tty_struct *tty)
473{ 470{
474 flush_to_ldisc(&tty->buf.work.work); 471 flush_delayed_work(&tty->buf.work);
475} 472}
476 473
477/** 474/**
diff --git a/drivers/char/tty_ldisc.c b/drivers/char/tty_ldisc.c
index aafdbaebc16a..feb55075819b 100644
--- a/drivers/char/tty_ldisc.c
+++ b/drivers/char/tty_ldisc.c
@@ -518,7 +518,7 @@ static void tty_ldisc_restore(struct tty_struct *tty, struct tty_ldisc *old)
518static int tty_ldisc_halt(struct tty_struct *tty) 518static int tty_ldisc_halt(struct tty_struct *tty)
519{ 519{
520 clear_bit(TTY_LDISC, &tty->flags); 520 clear_bit(TTY_LDISC, &tty->flags);
521 return cancel_delayed_work(&tty->buf.work); 521 return cancel_delayed_work_sync(&tty->buf.work);
522} 522}
523 523
524/** 524/**
@@ -756,12 +756,9 @@ void tty_ldisc_hangup(struct tty_struct *tty)
756 * N_TTY. 756 * N_TTY.
757 */ 757 */
758 if (tty->driver->flags & TTY_DRIVER_RESET_TERMIOS) { 758 if (tty->driver->flags & TTY_DRIVER_RESET_TERMIOS) {
759 /* Make sure the old ldisc is quiescent */
760 tty_ldisc_halt(tty);
761 flush_scheduled_work();
762
763 /* Avoid racing set_ldisc or tty_ldisc_release */ 759 /* Avoid racing set_ldisc or tty_ldisc_release */
764 mutex_lock(&tty->ldisc_mutex); 760 mutex_lock(&tty->ldisc_mutex);
761 tty_ldisc_halt(tty);
765 if (tty->ldisc) { /* Not yet closed */ 762 if (tty->ldisc) { /* Not yet closed */
766 /* Switch back to N_TTY */ 763 /* Switch back to N_TTY */
767 tty_ldisc_reinit(tty); 764 tty_ldisc_reinit(tty);
diff --git a/drivers/char/tty_port.c b/drivers/char/tty_port.c
index a4bbb28f10be..c63f3d33914a 100644
--- a/drivers/char/tty_port.c
+++ b/drivers/char/tty_port.c
@@ -219,8 +219,14 @@ int tty_port_block_til_ready(struct tty_port *port,
219 219
220 /* if non-blocking mode is set we can pass directly to open unless 220 /* if non-blocking mode is set we can pass directly to open unless
221 the port has just hung up or is in another error state */ 221 the port has just hung up or is in another error state */
222 if ((filp->f_flags & O_NONBLOCK) || 222 if (tty->flags & (1 << TTY_IO_ERROR)) {
223 (tty->flags & (1 << TTY_IO_ERROR))) { 223 port->flags |= ASYNC_NORMAL_ACTIVE;
224 return 0;
225 }
226 if (filp->f_flags & O_NONBLOCK) {
227 /* Indicate we are open */
228 if (tty->termios->c_cflag & CBAUD)
229 tty_port_raise_dtr_rts(port);
224 port->flags |= ASYNC_NORMAL_ACTIVE; 230 port->flags |= ASYNC_NORMAL_ACTIVE;
225 return 0; 231 return 0;
226 } 232 }
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
index 0d328b59568d..a035ae39a359 100644
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
@@ -31,7 +31,6 @@
31#include <linux/err.h> 31#include <linux/err.h>
32#include <linux/init.h> 32#include <linux/init.h>
33#include <linux/virtio.h> 33#include <linux/virtio.h>
34#include <linux/virtio_ids.h>
35#include <linux/virtio_console.h> 34#include <linux/virtio_console.h>
36#include "hvc_console.h" 35#include "hvc_console.h"
37 36
diff --git a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c
index 29c651ab0d78..6aa10284104a 100644
--- a/drivers/char/vt_ioctl.c
+++ b/drivers/char/vt_ioctl.c
@@ -103,8 +103,8 @@ void vt_event_post(unsigned int event, unsigned int old, unsigned int new)
103 ve->event.event = event; 103 ve->event.event = event;
104 /* kernel view is consoles 0..n-1, user space view is 104 /* kernel view is consoles 0..n-1, user space view is
105 console 1..n with 0 meaning current, so we must bias */ 105 console 1..n with 0 meaning current, so we must bias */
106 ve->event.old = old + 1; 106 ve->event.oldev = old + 1;
107 ve->event.new = new + 1; 107 ve->event.newev = new + 1;
108 wake = 1; 108 wake = 1;
109 ve->done = 1; 109 ve->done = 1;
110 } 110 }
@@ -186,7 +186,7 @@ int vt_waitactive(int n)
186 vt_event_wait(&vw); 186 vt_event_wait(&vw);
187 if (vw.done == 0) 187 if (vw.done == 0)
188 return -EINTR; 188 return -EINTR;
189 } while (vw.event.new != n); 189 } while (vw.event.newev != n);
190 return 0; 190 return 0;
191} 191}
192 192
@@ -981,8 +981,10 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
981 goto eperm; 981 goto eperm;
982 982
983 if (copy_from_user(&vsa, (struct vt_setactivate __user *)arg, 983 if (copy_from_user(&vsa, (struct vt_setactivate __user *)arg,
984 sizeof(struct vt_setactivate))) 984 sizeof(struct vt_setactivate))) {
985 return -EFAULT; 985 ret = -EFAULT;
986 goto out;
987 }
986 if (vsa.console == 0 || vsa.console > MAX_NR_CONSOLES) 988 if (vsa.console == 0 || vsa.console > MAX_NR_CONSOLES)
987 ret = -ENXIO; 989 ret = -ENXIO;
988 else { 990 else {
@@ -1530,7 +1532,7 @@ long vt_compat_ioctl(struct tty_struct *tty, struct file * file,
1530 1532
1531 case PIO_UNIMAP: 1533 case PIO_UNIMAP:
1532 case GIO_UNIMAP: 1534 case GIO_UNIMAP:
1533 ret = do_unimap_ioctl(cmd, up, perm, vc); 1535 ret = compat_unimap_ioctl(cmd, up, perm, vc);
1534 break; 1536 break;
1535 1537
1536 /* 1538 /*
diff --git a/drivers/char/xilinx_hwicap/xilinx_hwicap.c b/drivers/char/xilinx_hwicap/xilinx_hwicap.c
index f40ab699860f..4846d50199f3 100644
--- a/drivers/char/xilinx_hwicap/xilinx_hwicap.c
+++ b/drivers/char/xilinx_hwicap/xilinx_hwicap.c
@@ -559,7 +559,7 @@ static int hwicap_release(struct inode *inode, struct file *file)
559 return status; 559 return status;
560} 560}
561 561
562static struct file_operations hwicap_fops = { 562static const struct file_operations hwicap_fops = {
563 .owner = THIS_MODULE, 563 .owner = THIS_MODULE,
564 .write = hwicap_write, 564 .write = hwicap_write,
565 .read = hwicap_read, 565 .read = hwicap_read,