aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/Kconfig4
-rw-r--r--drivers/char/drm/drmP.h1
-rw-r--r--drivers/char/generic_serial.c1
-rw-r--r--drivers/char/hw_random/core.c14
-rw-r--r--drivers/char/keyboard.c3
-rw-r--r--drivers/char/misc.c13
-rw-r--r--drivers/char/rio/rioboot.c1
-rw-r--r--drivers/char/rio/riocmd.c1
-rw-r--r--drivers/char/rio/rioctrl.c1
-rw-r--r--drivers/char/rio/rioinit.c1
-rw-r--r--drivers/char/rio/riointr.c1
-rw-r--r--drivers/char/rio/rioparam.c1
-rw-r--r--drivers/char/rio/rioroute.c1
-rw-r--r--drivers/char/rio/riotable.c1
-rw-r--r--drivers/char/rio/riotty.c1
-rw-r--r--drivers/char/snsc.h2
-rw-r--r--drivers/char/tty_io.c47
17 files changed, 65 insertions, 29 deletions
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index 47c6be84fc84..a87b89db08e9 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -706,7 +706,7 @@ config NVRAM
706 706
707config RTC 707config RTC
708 tristate "Enhanced Real Time Clock Support" 708 tristate "Enhanced Real Time Clock Support"
709 depends on !PPC && !PARISC && !IA64 && !M68K && !SPARC && !FRV && !ARM && !SUPERH && !S390 709 depends on !PPC && !PARISC && !IA64 && !M68K && !SPARC && !FRV && !ARM && !SUPERH && !S390 && !AVR32
710 ---help--- 710 ---help---
711 If you say Y here and create a character special file /dev/rtc with 711 If you say Y here and create a character special file /dev/rtc with
712 major number 10 and minor number 135 using mknod ("man mknod"), you 712 major number 10 and minor number 135 using mknod ("man mknod"), you
@@ -776,7 +776,7 @@ config SGI_IP27_RTC
776 776
777config GEN_RTC 777config GEN_RTC
778 tristate "Generic /dev/rtc emulation" 778 tristate "Generic /dev/rtc emulation"
779 depends on RTC!=y && !IA64 && !ARM && !M32R && !MIPS && !SPARC && !FRV && !S390 && !SUPERH 779 depends on RTC!=y && !IA64 && !ARM && !M32R && !MIPS && !SPARC && !FRV && !S390 && !SUPERH && !AVR32
780 ---help--- 780 ---help---
781 If you say Y here and create a character special file /dev/rtc with 781 If you say Y here and create a character special file /dev/rtc with
782 major number 10 and minor number 135 using mknod ("man mknod"), you 782 major number 10 and minor number 135 using mknod ("man mknod"), you
diff --git a/drivers/char/drm/drmP.h b/drivers/char/drm/drmP.h
index 8ea9dd1717a9..6540948d5176 100644
--- a/drivers/char/drm/drmP.h
+++ b/drivers/char/drm/drmP.h
@@ -640,7 +640,6 @@ struct drm_head {
640 struct drm_device *dev; 640 struct drm_device *dev;
641 struct proc_dir_entry *dev_root; /**< proc directory entry */ 641 struct proc_dir_entry *dev_root; /**< proc directory entry */
642 dev_t device; /**< Device number for mknod */ 642 dev_t device; /**< Device number for mknod */
643 struct class_device *dev_class;
644}; 643};
645 644
646/** 645/**
diff --git a/drivers/char/generic_serial.c b/drivers/char/generic_serial.c
index 8facf3e25c49..7ed7da1d99cf 100644
--- a/drivers/char/generic_serial.c
+++ b/drivers/char/generic_serial.c
@@ -28,7 +28,6 @@
28#include <linux/interrupt.h> 28#include <linux/interrupt.h>
29#include <linux/tty_flip.h> 29#include <linux/tty_flip.h>
30#include <linux/delay.h> 30#include <linux/delay.h>
31#include <asm/semaphore.h>
32#include <asm/uaccess.h> 31#include <asm/uaccess.h>
33 32
34#define DEBUG 33#define DEBUG
diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c
index 84cdf9025737..662d60e44e9a 100644
--- a/drivers/char/hw_random/core.c
+++ b/drivers/char/hw_random/core.c
@@ -116,6 +116,10 @@ static ssize_t rng_dev_read(struct file *filp, char __user *buf,
116 err = -EAGAIN; 116 err = -EAGAIN;
117 if (!bytes_read && (filp->f_flags & O_NONBLOCK)) 117 if (!bytes_read && (filp->f_flags & O_NONBLOCK))
118 goto out; 118 goto out;
119 if (bytes_read < 0) {
120 err = bytes_read;
121 goto out;
122 }
119 123
120 err = -EFAULT; 124 err = -EFAULT;
121 while (bytes_read && size) { 125 while (bytes_read && size) {
@@ -234,11 +238,11 @@ static DEVICE_ATTR(rng_available, S_IRUGO,
234 NULL); 238 NULL);
235 239
236 240
237static void unregister_miscdev(bool suspended) 241static void unregister_miscdev(void)
238{ 242{
239 device_remove_file(rng_miscdev.this_device, &dev_attr_rng_available); 243 device_remove_file(rng_miscdev.this_device, &dev_attr_rng_available);
240 device_remove_file(rng_miscdev.this_device, &dev_attr_rng_current); 244 device_remove_file(rng_miscdev.this_device, &dev_attr_rng_current);
241 __misc_deregister(&rng_miscdev, suspended); 245 misc_deregister(&rng_miscdev);
242} 246}
243 247
244static int register_miscdev(void) 248static int register_miscdev(void)
@@ -313,7 +317,7 @@ out:
313} 317}
314EXPORT_SYMBOL_GPL(hwrng_register); 318EXPORT_SYMBOL_GPL(hwrng_register);
315 319
316void __hwrng_unregister(struct hwrng *rng, bool suspended) 320void hwrng_unregister(struct hwrng *rng)
317{ 321{
318 int err; 322 int err;
319 323
@@ -332,11 +336,11 @@ void __hwrng_unregister(struct hwrng *rng, bool suspended)
332 } 336 }
333 } 337 }
334 if (list_empty(&rng_list)) 338 if (list_empty(&rng_list))
335 unregister_miscdev(suspended); 339 unregister_miscdev();
336 340
337 mutex_unlock(&rng_mutex); 341 mutex_unlock(&rng_mutex);
338} 342}
339EXPORT_SYMBOL_GPL(__hwrng_unregister); 343EXPORT_SYMBOL_GPL(hwrng_unregister);
340 344
341 345
342MODULE_DESCRIPTION("H/W Random Number Generator (RNG) driver"); 346MODULE_DESCRIPTION("H/W Random Number Generator (RNG) driver");
diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c
index 4dbd3425e928..9769bf8279a6 100644
--- a/drivers/char/keyboard.c
+++ b/drivers/char/keyboard.c
@@ -1033,7 +1033,8 @@ DECLARE_TASKLET_DISABLED(keyboard_tasklet, kbd_bh, 0);
1033#if defined(CONFIG_X86) || defined(CONFIG_IA64) || defined(CONFIG_ALPHA) ||\ 1033#if defined(CONFIG_X86) || defined(CONFIG_IA64) || defined(CONFIG_ALPHA) ||\
1034 defined(CONFIG_MIPS) || defined(CONFIG_PPC) || defined(CONFIG_SPARC) ||\ 1034 defined(CONFIG_MIPS) || defined(CONFIG_PPC) || defined(CONFIG_SPARC) ||\
1035 defined(CONFIG_PARISC) || defined(CONFIG_SUPERH) ||\ 1035 defined(CONFIG_PARISC) || defined(CONFIG_SUPERH) ||\
1036 (defined(CONFIG_ARM) && defined(CONFIG_KEYBOARD_ATKBD) && !defined(CONFIG_ARCH_RPC)) 1036 (defined(CONFIG_ARM) && defined(CONFIG_KEYBOARD_ATKBD) && !defined(CONFIG_ARCH_RPC)) ||\
1037 defined(CONFIG_AVR32)
1037 1038
1038#define HW_RAW(dev) (test_bit(EV_MSC, dev->evbit) && test_bit(MSC_RAW, dev->mscbit) &&\ 1039#define HW_RAW(dev) (test_bit(EV_MSC, dev->evbit) && test_bit(MSC_RAW, dev->mscbit) &&\
1039 ((dev)->id.bustype == BUS_I8042) && ((dev)->id.vendor == 0x0001) && ((dev)->id.product == 0x0001)) 1040 ((dev)->id.bustype == BUS_I8042) && ((dev)->id.vendor == 0x0001) && ((dev)->id.product == 0x0001))
diff --git a/drivers/char/misc.c b/drivers/char/misc.c
index a39101feb2ed..4d058dadbfcc 100644
--- a/drivers/char/misc.c
+++ b/drivers/char/misc.c
@@ -232,9 +232,8 @@ int misc_register(struct miscdevice * misc)
232} 232}
233 233
234/** 234/**
235 * __misc_deregister - unregister a miscellaneous device 235 * misc_deregister - unregister a miscellaneous device
236 * @misc: device to unregister 236 * @misc: device to unregister
237 * @suspended: to be set if the function is used during suspend/resume
238 * 237 *
239 * Unregister a miscellaneous device that was previously 238 * Unregister a miscellaneous device that was previously
240 * successfully registered with misc_register(). Success 239 * successfully registered with misc_register(). Success
@@ -242,7 +241,7 @@ int misc_register(struct miscdevice * misc)
242 * indicates an error. 241 * indicates an error.
243 */ 242 */
244 243
245int __misc_deregister(struct miscdevice *misc, bool suspended) 244int misc_deregister(struct miscdevice *misc)
246{ 245{
247 int i = misc->minor; 246 int i = misc->minor;
248 247
@@ -251,11 +250,7 @@ int __misc_deregister(struct miscdevice *misc, bool suspended)
251 250
252 mutex_lock(&misc_mtx); 251 mutex_lock(&misc_mtx);
253 list_del(&misc->list); 252 list_del(&misc->list);
254 if (suspended) 253 device_destroy(misc_class, MKDEV(MISC_MAJOR, misc->minor));
255 destroy_suspended_device(misc_class,
256 MKDEV(MISC_MAJOR, misc->minor));
257 else
258 device_destroy(misc_class, MKDEV(MISC_MAJOR, misc->minor));
259 if (i < DYNAMIC_MINORS && i>0) { 254 if (i < DYNAMIC_MINORS && i>0) {
260 misc_minors[i>>3] &= ~(1 << (misc->minor & 7)); 255 misc_minors[i>>3] &= ~(1 << (misc->minor & 7));
261 } 256 }
@@ -264,7 +259,7 @@ int __misc_deregister(struct miscdevice *misc, bool suspended)
264} 259}
265 260
266EXPORT_SYMBOL(misc_register); 261EXPORT_SYMBOL(misc_register);
267EXPORT_SYMBOL(__misc_deregister); 262EXPORT_SYMBOL(misc_deregister);
268 263
269static int __init misc_init(void) 264static int __init misc_init(void)
270{ 265{
diff --git a/drivers/char/rio/rioboot.c b/drivers/char/rio/rioboot.c
index eca2b95343e2..d956dd316005 100644
--- a/drivers/char/rio/rioboot.c
+++ b/drivers/char/rio/rioboot.c
@@ -35,7 +35,6 @@
35#include <linux/termios.h> 35#include <linux/termios.h>
36#include <linux/serial.h> 36#include <linux/serial.h>
37#include <linux/vmalloc.h> 37#include <linux/vmalloc.h>
38#include <asm/semaphore.h>
39#include <linux/generic_serial.h> 38#include <linux/generic_serial.h>
40#include <linux/errno.h> 39#include <linux/errno.h>
41#include <linux/interrupt.h> 40#include <linux/interrupt.h>
diff --git a/drivers/char/rio/riocmd.c b/drivers/char/rio/riocmd.c
index 7321d002c34f..bf36959fc121 100644
--- a/drivers/char/rio/riocmd.c
+++ b/drivers/char/rio/riocmd.c
@@ -41,7 +41,6 @@ static char *_riocmd_c_sccs_ = "@(#)riocmd.c 1.2";
41#include <asm/io.h> 41#include <asm/io.h>
42#include <asm/system.h> 42#include <asm/system.h>
43#include <asm/string.h> 43#include <asm/string.h>
44#include <asm/semaphore.h>
45#include <asm/uaccess.h> 44#include <asm/uaccess.h>
46 45
47#include <linux/termios.h> 46#include <linux/termios.h>
diff --git a/drivers/char/rio/rioctrl.c b/drivers/char/rio/rioctrl.c
index 7ce77619707c..d8eb2bcbe015 100644
--- a/drivers/char/rio/rioctrl.c
+++ b/drivers/char/rio/rioctrl.c
@@ -40,7 +40,6 @@ static char *_rioctrl_c_sccs_ = "@(#)rioctrl.c 1.3";
40#include <asm/io.h> 40#include <asm/io.h>
41#include <asm/system.h> 41#include <asm/system.h>
42#include <asm/string.h> 42#include <asm/string.h>
43#include <asm/semaphore.h>
44#include <asm/uaccess.h> 43#include <asm/uaccess.h>
45 44
46#include <linux/termios.h> 45#include <linux/termios.h>
diff --git a/drivers/char/rio/rioinit.c b/drivers/char/rio/rioinit.c
index 0794844369d6..add1718295ef 100644
--- a/drivers/char/rio/rioinit.c
+++ b/drivers/char/rio/rioinit.c
@@ -40,7 +40,6 @@ static char *_rioinit_c_sccs_ = "@(#)rioinit.c 1.3";
40#include <asm/io.h> 40#include <asm/io.h>
41#include <asm/system.h> 41#include <asm/system.h>
42#include <asm/string.h> 42#include <asm/string.h>
43#include <asm/semaphore.h>
44#include <asm/uaccess.h> 43#include <asm/uaccess.h>
45 44
46#include <linux/termios.h> 45#include <linux/termios.h>
diff --git a/drivers/char/rio/riointr.c b/drivers/char/rio/riointr.c
index ebc76342712c..4734e26e1ccd 100644
--- a/drivers/char/rio/riointr.c
+++ b/drivers/char/rio/riointr.c
@@ -42,7 +42,6 @@ static char *_riointr_c_sccs_ = "@(#)riointr.c 1.2";
42#include <asm/io.h> 42#include <asm/io.h>
43#include <asm/system.h> 43#include <asm/system.h>
44#include <asm/string.h> 44#include <asm/string.h>
45#include <asm/semaphore.h>
46#include <asm/uaccess.h> 45#include <asm/uaccess.h>
47 46
48#include <linux/termios.h> 47#include <linux/termios.h>
diff --git a/drivers/char/rio/rioparam.c b/drivers/char/rio/rioparam.c
index bb498d24adcc..da276ed57b3f 100644
--- a/drivers/char/rio/rioparam.c
+++ b/drivers/char/rio/rioparam.c
@@ -41,7 +41,6 @@ static char *_rioparam_c_sccs_ = "@(#)rioparam.c 1.3";
41#include <asm/io.h> 41#include <asm/io.h>
42#include <asm/system.h> 42#include <asm/system.h>
43#include <asm/string.h> 43#include <asm/string.h>
44#include <asm/semaphore.h>
45#include <asm/uaccess.h> 44#include <asm/uaccess.h>
46 45
47#include <linux/termios.h> 46#include <linux/termios.h>
diff --git a/drivers/char/rio/rioroute.c b/drivers/char/rio/rioroute.c
index a99f3d9d7d65..85091ff74d96 100644
--- a/drivers/char/rio/rioroute.c
+++ b/drivers/char/rio/rioroute.c
@@ -39,7 +39,6 @@ static char *_rioroute_c_sccs_ = "@(#)rioroute.c 1.3";
39#include <asm/io.h> 39#include <asm/io.h>
40#include <asm/system.h> 40#include <asm/system.h>
41#include <asm/string.h> 41#include <asm/string.h>
42#include <asm/semaphore.h>
43#include <asm/uaccess.h> 42#include <asm/uaccess.h>
44 43
45#include <linux/termios.h> 44#include <linux/termios.h>
diff --git a/drivers/char/rio/riotable.c b/drivers/char/rio/riotable.c
index 9b52892a501f..2b24488e95f2 100644
--- a/drivers/char/rio/riotable.c
+++ b/drivers/char/rio/riotable.c
@@ -42,7 +42,6 @@ static char *_riotable_c_sccs_ = "@(#)riotable.c 1.2";
42#include <asm/io.h> 42#include <asm/io.h>
43#include <asm/system.h> 43#include <asm/system.h>
44#include <asm/string.h> 44#include <asm/string.h>
45#include <asm/semaphore.h>
46#include <asm/uaccess.h> 45#include <asm/uaccess.h>
47 46
48#include <linux/termios.h> 47#include <linux/termios.h>
diff --git a/drivers/char/rio/riotty.c b/drivers/char/rio/riotty.c
index cfa54361473f..1cb8580a161d 100644
--- a/drivers/char/rio/riotty.c
+++ b/drivers/char/rio/riotty.c
@@ -44,7 +44,6 @@ static char *_riotty_c_sccs_ = "@(#)riotty.c 1.3";
44#include <asm/io.h> 44#include <asm/io.h>
45#include <asm/system.h> 45#include <asm/system.h>
46#include <asm/string.h> 46#include <asm/string.h>
47#include <asm/semaphore.h>
48#include <asm/uaccess.h> 47#include <asm/uaccess.h>
49 48
50#include <linux/termios.h> 49#include <linux/termios.h>
diff --git a/drivers/char/snsc.h b/drivers/char/snsc.h
index 8a98169b60c1..4be62eda9fbc 100644
--- a/drivers/char/snsc.h
+++ b/drivers/char/snsc.h
@@ -22,8 +22,8 @@
22#include <linux/kobject.h> 22#include <linux/kobject.h>
23#include <linux/fs.h> 23#include <linux/fs.h>
24#include <linux/cdev.h> 24#include <linux/cdev.h>
25#include <linux/semaphore.h>
25#include <asm/sn/types.h> 26#include <asm/sn/types.h>
26#include <asm/semaphore.h>
27 27
28#define CHUNKSIZE 127 28#define CHUNKSIZE 127
29 29
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index 613ec816ce60..4d3c7018f0c3 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -1155,6 +1155,48 @@ static struct tty_driver *get_tty_driver(dev_t device, int *index)
1155 return NULL; 1155 return NULL;
1156} 1156}
1157 1157
1158#ifdef CONFIG_CONSOLE_POLL
1159
1160/**
1161 * tty_find_polling_driver - find device of a polled tty
1162 * @name: name string to match
1163 * @line: pointer to resulting tty line nr
1164 *
1165 * This routine returns a tty driver structure, given a name
1166 * and the condition that the tty driver is capable of polled
1167 * operation.
1168 */
1169struct tty_driver *tty_find_polling_driver(char *name, int *line)
1170{
1171 struct tty_driver *p, *res = NULL;
1172 int tty_line = 0;
1173 char *str;
1174
1175 mutex_lock(&tty_mutex);
1176 /* Search through the tty devices to look for a match */
1177 list_for_each_entry(p, &tty_drivers, tty_drivers) {
1178 str = name + strlen(p->name);
1179 tty_line = simple_strtoul(str, &str, 10);
1180 if (*str == ',')
1181 str++;
1182 if (*str == '\0')
1183 str = 0;
1184
1185 if (tty_line >= 0 && tty_line <= p->num && p->poll_init &&
1186 !p->poll_init(p, tty_line, str)) {
1187
1188 res = p;
1189 *line = tty_line;
1190 break;
1191 }
1192 }
1193 mutex_unlock(&tty_mutex);
1194
1195 return res;
1196}
1197EXPORT_SYMBOL_GPL(tty_find_polling_driver);
1198#endif
1199
1158/** 1200/**
1159 * tty_check_change - check for POSIX terminal changes 1201 * tty_check_change - check for POSIX terminal changes
1160 * @tty: tty to check 1202 * @tty: tty to check
@@ -3850,6 +3892,11 @@ void tty_set_operations(struct tty_driver *driver,
3850 driver->write_proc = op->write_proc; 3892 driver->write_proc = op->write_proc;
3851 driver->tiocmget = op->tiocmget; 3893 driver->tiocmget = op->tiocmget;
3852 driver->tiocmset = op->tiocmset; 3894 driver->tiocmset = op->tiocmset;
3895#ifdef CONFIG_CONSOLE_POLL
3896 driver->poll_init = op->poll_init;
3897 driver->poll_get_char = op->poll_get_char;
3898 driver->poll_put_char = op->poll_put_char;
3899#endif
3853} 3900}
3854 3901
3855 3902