diff options
author | Paul Mackerras <paulus@samba.org> | 2006-05-05 01:45:48 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-05-05 01:45:48 -0400 |
commit | f18fc729cd2d67b76e24206ee3567c1f6983c358 (patch) | |
tree | 9dbf177222d94213d9dd82d67de6d905e1a2b278 /drivers/char | |
parent | 5a43ee65620d628ba04deecf241b63b2410b97f2 (diff) | |
parent | d98550e334715b2d9e45f8f0f4e1608720108640 (diff) |
Merge ../linux-2.6
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/genrtc.c | 8 | ||||
-rw-r--r-- | drivers/char/keyboard.c | 38 | ||||
-rw-r--r-- | drivers/char/mwave/mwavedd.c | 2 | ||||
-rw-r--r-- | drivers/char/tipar.c | 2 |
4 files changed, 34 insertions, 16 deletions
diff --git a/drivers/char/genrtc.c b/drivers/char/genrtc.c index d3a2bc36129b..588fca542a98 100644 --- a/drivers/char/genrtc.c +++ b/drivers/char/genrtc.c | |||
@@ -200,13 +200,13 @@ static ssize_t gen_rtc_read(struct file *file, char __user *buf, | |||
200 | /* first test allows optimizer to nuke this case for 32-bit machines */ | 200 | /* first test allows optimizer to nuke this case for 32-bit machines */ |
201 | if (sizeof (int) != sizeof (long) && count == sizeof (unsigned int)) { | 201 | if (sizeof (int) != sizeof (long) && count == sizeof (unsigned int)) { |
202 | unsigned int uidata = data; | 202 | unsigned int uidata = data; |
203 | retval = put_user(uidata, (unsigned long __user *)buf); | 203 | retval = put_user(uidata, (unsigned int __user *)buf) ?: |
204 | sizeof(unsigned int); | ||
204 | } | 205 | } |
205 | else { | 206 | else { |
206 | retval = put_user(data, (unsigned long __user *)buf); | 207 | retval = put_user(data, (unsigned long __user *)buf) ?: |
208 | sizeof(unsigned long); | ||
207 | } | 209 | } |
208 | if (!retval) | ||
209 | retval = sizeof(unsigned long); | ||
210 | out: | 210 | out: |
211 | current->state = TASK_RUNNING; | 211 | current->state = TASK_RUNNING; |
212 | remove_wait_queue(&gen_rtc_wait, &wait); | 212 | remove_wait_queue(&gen_rtc_wait, &wait); |
diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c index 935670a3cd98..5755b7e5f187 100644 --- a/drivers/char/keyboard.c +++ b/drivers/char/keyboard.c | |||
@@ -860,9 +860,32 @@ static void k_slock(struct vc_data *vc, unsigned char value, char up_flag, struc | |||
860 | } | 860 | } |
861 | 861 | ||
862 | /* by default, 300ms interval for combination release */ | 862 | /* by default, 300ms interval for combination release */ |
863 | static long brl_timeout = 300; | 863 | static unsigned brl_timeout = 300; |
864 | MODULE_PARM_DESC(brl_timeout, "Braille keys release delay in ms (0 for combination on first release, < 0 for dead characters)"); | 864 | MODULE_PARM_DESC(brl_timeout, "Braille keys release delay in ms (0 for commit on first key release)"); |
865 | module_param(brl_timeout, long, 0644); | 865 | module_param(brl_timeout, uint, 0644); |
866 | |||
867 | static unsigned brl_nbchords = 1; | ||
868 | MODULE_PARM_DESC(brl_nbchords, "Number of chords that produce a braille pattern (0 for dead chords)"); | ||
869 | module_param(brl_nbchords, uint, 0644); | ||
870 | |||
871 | static void k_brlcommit(struct vc_data *vc, unsigned int pattern, char up_flag, struct pt_regs *regs) | ||
872 | { | ||
873 | static unsigned long chords; | ||
874 | static unsigned committed; | ||
875 | |||
876 | if (!brl_nbchords) | ||
877 | k_deadunicode(vc, BRL_UC_ROW | pattern, up_flag, regs); | ||
878 | else { | ||
879 | committed |= pattern; | ||
880 | chords++; | ||
881 | if (chords == brl_nbchords) { | ||
882 | k_unicode(vc, BRL_UC_ROW | committed, up_flag, regs); | ||
883 | chords = 0; | ||
884 | committed = 0; | ||
885 | } | ||
886 | } | ||
887 | } | ||
888 | |||
866 | static void k_brl(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs) | 889 | static void k_brl(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs) |
867 | { | 890 | { |
868 | static unsigned pressed,committing; | 891 | static unsigned pressed,committing; |
@@ -882,11 +905,6 @@ static void k_brl(struct vc_data *vc, unsigned char value, char up_flag, struct | |||
882 | if (value > 8) | 905 | if (value > 8) |
883 | return; | 906 | return; |
884 | 907 | ||
885 | if (brl_timeout < 0) { | ||
886 | k_deadunicode(vc, BRL_UC_ROW | (1 << (value - 1)), up_flag, regs); | ||
887 | return; | ||
888 | } | ||
889 | |||
890 | if (up_flag) { | 908 | if (up_flag) { |
891 | if (brl_timeout) { | 909 | if (brl_timeout) { |
892 | if (!committing || | 910 | if (!committing || |
@@ -897,13 +915,13 @@ static void k_brl(struct vc_data *vc, unsigned char value, char up_flag, struct | |||
897 | pressed &= ~(1 << (value - 1)); | 915 | pressed &= ~(1 << (value - 1)); |
898 | if (!pressed) { | 916 | if (!pressed) { |
899 | if (committing) { | 917 | if (committing) { |
900 | k_unicode(vc, BRL_UC_ROW | committing, 0, regs); | 918 | k_brlcommit(vc, committing, 0, regs); |
901 | committing = 0; | 919 | committing = 0; |
902 | } | 920 | } |
903 | } | 921 | } |
904 | } else { | 922 | } else { |
905 | if (committing) { | 923 | if (committing) { |
906 | k_unicode(vc, BRL_UC_ROW | committing, 0, regs); | 924 | k_brlcommit(vc, committing, 0, regs); |
907 | committing = 0; | 925 | committing = 0; |
908 | } | 926 | } |
909 | pressed &= ~(1 << (value - 1)); | 927 | pressed &= ~(1 << (value - 1)); |
diff --git a/drivers/char/mwave/mwavedd.c b/drivers/char/mwave/mwavedd.c index 8666171e187b..d3ba2f860ef0 100644 --- a/drivers/char/mwave/mwavedd.c +++ b/drivers/char/mwave/mwavedd.c | |||
@@ -271,7 +271,7 @@ static int mwave_ioctl(struct inode *inode, struct file *file, | |||
271 | ipcnum, | 271 | ipcnum, |
272 | pDrvData->IPCs[ipcnum].usIntCount); | 272 | pDrvData->IPCs[ipcnum].usIntCount); |
273 | 273 | ||
274 | if (ipcnum > ARRAY_SIZE(pDrvData->IPCs)) { | 274 | if (ipcnum >= ARRAY_SIZE(pDrvData->IPCs)) { |
275 | PRINTK_ERROR(KERN_ERR_MWAVE | 275 | PRINTK_ERROR(KERN_ERR_MWAVE |
276 | "mwavedd::mwave_ioctl:" | 276 | "mwavedd::mwave_ioctl:" |
277 | " IOCTL_MW_REGISTER_IPC:" | 277 | " IOCTL_MW_REGISTER_IPC:" |
diff --git a/drivers/char/tipar.c b/drivers/char/tipar.c index eb2eb3e12d6a..079db5a935a1 100644 --- a/drivers/char/tipar.c +++ b/drivers/char/tipar.c | |||
@@ -515,7 +515,7 @@ tipar_init_module(void) | |||
515 | err = PTR_ERR(tipar_class); | 515 | err = PTR_ERR(tipar_class); |
516 | goto out_chrdev; | 516 | goto out_chrdev; |
517 | } | 517 | } |
518 | if (parport_register_driver(&tipar_driver) || tp_count == 0) { | 518 | if (parport_register_driver(&tipar_driver)) { |
519 | printk(KERN_ERR "tipar: unable to register with parport\n"); | 519 | printk(KERN_ERR "tipar: unable to register with parport\n"); |
520 | err = -EIO; | 520 | err = -EIO; |
521 | goto out_class; | 521 | goto out_class; |