diff options
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/drm/drm_dma.c | 2 | ||||
-rw-r--r-- | drivers/char/drm/drm_vm.c | 2 | ||||
-rw-r--r-- | drivers/char/drm/r300_reg.h | 2 | ||||
-rw-r--r-- | drivers/char/genrtc.c | 4 | ||||
-rw-r--r-- | drivers/char/hw_random/Kconfig | 14 | ||||
-rw-r--r-- | drivers/char/hw_random/Makefile | 1 | ||||
-rw-r--r-- | drivers/char/hw_random/pasemi-rng.c | 156 | ||||
-rw-r--r-- | drivers/char/mmtimer.c | 4 | ||||
-rw-r--r-- | drivers/char/pcmcia/Kconfig | 1 | ||||
-rw-r--r-- | drivers/char/pcmcia/cm4000_cs.c | 46 | ||||
-rw-r--r-- | drivers/char/pcmcia/cm4040_cs.c | 7 | ||||
-rw-r--r-- | drivers/char/tpm/Kconfig | 2 | ||||
-rw-r--r-- | drivers/char/tty_io.c | 22 |
13 files changed, 210 insertions, 53 deletions
diff --git a/drivers/char/drm/drm_dma.c b/drivers/char/drm/drm_dma.c index 892db7096986..32ed19c9ec1c 100644 --- a/drivers/char/drm/drm_dma.c +++ b/drivers/char/drm/drm_dma.c | |||
@@ -65,7 +65,7 @@ int drm_dma_setup(drm_device_t * dev) | |||
65 | * \param dev DRM device. | 65 | * \param dev DRM device. |
66 | * | 66 | * |
67 | * Free all pages associated with DMA buffers, the buffers and pages lists, and | 67 | * Free all pages associated with DMA buffers, the buffers and pages lists, and |
68 | * finally the the drm_device::dma structure itself. | 68 | * finally the drm_device::dma structure itself. |
69 | */ | 69 | */ |
70 | void drm_dma_takedown(drm_device_t * dev) | 70 | void drm_dma_takedown(drm_device_t * dev) |
71 | { | 71 | { |
diff --git a/drivers/char/drm/drm_vm.c b/drivers/char/drm/drm_vm.c index 35540cfb43dd..b5c5b9fa84c3 100644 --- a/drivers/char/drm/drm_vm.c +++ b/drivers/char/drm/drm_vm.c | |||
@@ -157,7 +157,7 @@ static __inline__ struct page *drm_do_vm_nopage(struct vm_area_struct *vma, | |||
157 | * \param address access address. | 157 | * \param address access address. |
158 | * \return pointer to the page structure. | 158 | * \return pointer to the page structure. |
159 | * | 159 | * |
160 | * Get the the mapping, find the real physical page to map, get the page, and | 160 | * Get the mapping, find the real physical page to map, get the page, and |
161 | * return it. | 161 | * return it. |
162 | */ | 162 | */ |
163 | static __inline__ struct page *drm_do_vm_shm_nopage(struct vm_area_struct *vma, | 163 | static __inline__ struct page *drm_do_vm_shm_nopage(struct vm_area_struct *vma, |
diff --git a/drivers/char/drm/r300_reg.h b/drivers/char/drm/r300_reg.h index a881f96c983e..ecda760ae8c0 100644 --- a/drivers/char/drm/r300_reg.h +++ b/drivers/char/drm/r300_reg.h | |||
@@ -293,7 +293,7 @@ I am fairly certain that they are correct unless stated otherwise in comments. | |||
293 | # define R300_PVS_CNTL_1_PROGRAM_START_SHIFT 0 | 293 | # define R300_PVS_CNTL_1_PROGRAM_START_SHIFT 0 |
294 | # define R300_PVS_CNTL_1_POS_END_SHIFT 10 | 294 | # define R300_PVS_CNTL_1_POS_END_SHIFT 10 |
295 | # define R300_PVS_CNTL_1_PROGRAM_END_SHIFT 20 | 295 | # define R300_PVS_CNTL_1_PROGRAM_END_SHIFT 20 |
296 | /* Addresses are relative the the vertex program parameters area. */ | 296 | /* Addresses are relative to the vertex program parameters area. */ |
297 | #define R300_VAP_PVS_CNTL_2 0x22D4 | 297 | #define R300_VAP_PVS_CNTL_2 0x22D4 |
298 | # define R300_PVS_CNTL_2_PARAM_OFFSET_SHIFT 0 | 298 | # define R300_PVS_CNTL_2_PARAM_OFFSET_SHIFT 0 |
299 | # define R300_PVS_CNTL_2_PARAM_COUNT_SHIFT 16 | 299 | # define R300_PVS_CNTL_2_PARAM_COUNT_SHIFT 16 |
diff --git a/drivers/char/genrtc.c b/drivers/char/genrtc.c index 49f914e79216..9e1fc02967ff 100644 --- a/drivers/char/genrtc.c +++ b/drivers/char/genrtc.c | |||
@@ -12,7 +12,7 @@ | |||
12 | * | 12 | * |
13 | * This driver allows use of the real time clock (built into | 13 | * This driver allows use of the real time clock (built into |
14 | * nearly all computers) from user space. It exports the /dev/rtc | 14 | * nearly all computers) from user space. It exports the /dev/rtc |
15 | * interface supporting various ioctl() and also the /proc/dev/rtc | 15 | * interface supporting various ioctl() and also the /proc/driver/rtc |
16 | * pseudo-file for status information. | 16 | * pseudo-file for status information. |
17 | * | 17 | * |
18 | * The ioctls can be used to set the interrupt behaviour where | 18 | * The ioctls can be used to set the interrupt behaviour where |
@@ -377,7 +377,7 @@ static int gen_rtc_release(struct inode *inode, struct file *file) | |||
377 | #ifdef CONFIG_PROC_FS | 377 | #ifdef CONFIG_PROC_FS |
378 | 378 | ||
379 | /* | 379 | /* |
380 | * Info exported via "/proc/rtc". | 380 | * Info exported via "/proc/driver/rtc". |
381 | */ | 381 | */ |
382 | 382 | ||
383 | static int gen_rtc_proc_output(char *buf) | 383 | static int gen_rtc_proc_output(char *buf) |
diff --git a/drivers/char/hw_random/Kconfig b/drivers/char/hw_random/Kconfig index 5f3acd8e64b8..7cda04b33534 100644 --- a/drivers/char/hw_random/Kconfig +++ b/drivers/char/hw_random/Kconfig | |||
@@ -91,3 +91,17 @@ config HW_RANDOM_OMAP | |||
91 | module will be called omap-rng. | 91 | module will be called omap-rng. |
92 | 92 | ||
93 | If unsure, say Y. | 93 | If unsure, say Y. |
94 | |||
95 | config HW_RANDOM_PASEMI | ||
96 | tristate "PA Semi HW Random Number Generator support" | ||
97 | depends on HW_RANDOM && PPC_PASEMI | ||
98 | default HW_RANDOM | ||
99 | ---help--- | ||
100 | This driver provides kernel-side support for the Random Number | ||
101 | Generator hardware found on PA6T-1682M processor. | ||
102 | |||
103 | To compile this driver as a module, choose M here: the | ||
104 | module will be called pasemi-rng. | ||
105 | |||
106 | If unsure, say Y. | ||
107 | |||
diff --git a/drivers/char/hw_random/Makefile b/drivers/char/hw_random/Makefile index c41fa19454e3..c8b7300e2fb1 100644 --- a/drivers/char/hw_random/Makefile +++ b/drivers/char/hw_random/Makefile | |||
@@ -10,3 +10,4 @@ obj-$(CONFIG_HW_RANDOM_GEODE) += geode-rng.o | |||
10 | obj-$(CONFIG_HW_RANDOM_VIA) += via-rng.o | 10 | obj-$(CONFIG_HW_RANDOM_VIA) += via-rng.o |
11 | obj-$(CONFIG_HW_RANDOM_IXP4XX) += ixp4xx-rng.o | 11 | obj-$(CONFIG_HW_RANDOM_IXP4XX) += ixp4xx-rng.o |
12 | obj-$(CONFIG_HW_RANDOM_OMAP) += omap-rng.o | 12 | obj-$(CONFIG_HW_RANDOM_OMAP) += omap-rng.o |
13 | obj-$(CONFIG_HW_RANDOM_PASEMI) += pasemi-rng.o | ||
diff --git a/drivers/char/hw_random/pasemi-rng.c b/drivers/char/hw_random/pasemi-rng.c new file mode 100644 index 000000000000..fa6040b6c8f2 --- /dev/null +++ b/drivers/char/hw_random/pasemi-rng.c | |||
@@ -0,0 +1,156 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2006-2007 PA Semi, Inc | ||
3 | * | ||
4 | * Maintained by: Olof Johansson <olof@lixom.net> | ||
5 | * | ||
6 | * Driver for the PWRficient onchip rng | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
20 | */ | ||
21 | |||
22 | #include <linux/module.h> | ||
23 | #include <linux/kernel.h> | ||
24 | #include <linux/platform_device.h> | ||
25 | #include <linux/hw_random.h> | ||
26 | #include <asm/of_platform.h> | ||
27 | #include <asm/io.h> | ||
28 | |||
29 | #define SDCRNG_CTL_REG 0x00 | ||
30 | #define SDCRNG_CTL_FVLD_M 0x0000f000 | ||
31 | #define SDCRNG_CTL_FVLD_S 12 | ||
32 | #define SDCRNG_CTL_KSZ 0x00000800 | ||
33 | #define SDCRNG_CTL_RSRC_CRG 0x00000010 | ||
34 | #define SDCRNG_CTL_RSRC_RRG 0x00000000 | ||
35 | #define SDCRNG_CTL_CE 0x00000004 | ||
36 | #define SDCRNG_CTL_RE 0x00000002 | ||
37 | #define SDCRNG_CTL_DR 0x00000001 | ||
38 | #define SDCRNG_CTL_SELECT_RRG_RNG (SDCRNG_CTL_RE | SDCRNG_CTL_RSRC_RRG) | ||
39 | #define SDCRNG_CTL_SELECT_CRG_RNG (SDCRNG_CTL_CE | SDCRNG_CTL_RSRC_CRG) | ||
40 | #define SDCRNG_VAL_REG 0x20 | ||
41 | |||
42 | #define MODULE_NAME "pasemi_rng" | ||
43 | |||
44 | static int pasemi_rng_data_present(struct hwrng *rng) | ||
45 | { | ||
46 | void __iomem *rng_regs = (void __iomem *)rng->priv; | ||
47 | |||
48 | return (in_le32(rng_regs + SDCRNG_CTL_REG) | ||
49 | & SDCRNG_CTL_FVLD_M) ? 1 : 0; | ||
50 | } | ||
51 | |||
52 | static int pasemi_rng_data_read(struct hwrng *rng, u32 *data) | ||
53 | { | ||
54 | void __iomem *rng_regs = (void __iomem *)rng->priv; | ||
55 | *data = in_le32(rng_regs + SDCRNG_VAL_REG); | ||
56 | return 4; | ||
57 | } | ||
58 | |||
59 | static int pasemi_rng_init(struct hwrng *rng) | ||
60 | { | ||
61 | void __iomem *rng_regs = (void __iomem *)rng->priv; | ||
62 | u32 ctl; | ||
63 | |||
64 | ctl = SDCRNG_CTL_DR | SDCRNG_CTL_SELECT_RRG_RNG | SDCRNG_CTL_KSZ; | ||
65 | out_le32(rng_regs + SDCRNG_CTL_REG, ctl); | ||
66 | out_le32(rng_regs + SDCRNG_CTL_REG, ctl & ~SDCRNG_CTL_DR); | ||
67 | |||
68 | return 0; | ||
69 | } | ||
70 | |||
71 | static void pasemi_rng_cleanup(struct hwrng *rng) | ||
72 | { | ||
73 | void __iomem *rng_regs = (void __iomem *)rng->priv; | ||
74 | u32 ctl; | ||
75 | |||
76 | ctl = SDCRNG_CTL_RE | SDCRNG_CTL_CE; | ||
77 | out_le32(rng_regs + SDCRNG_CTL_REG, | ||
78 | in_le32(rng_regs + SDCRNG_CTL_REG) & ~ctl); | ||
79 | } | ||
80 | |||
81 | static struct hwrng pasemi_rng = { | ||
82 | .name = MODULE_NAME, | ||
83 | .init = pasemi_rng_init, | ||
84 | .cleanup = pasemi_rng_cleanup, | ||
85 | .data_present = pasemi_rng_data_present, | ||
86 | .data_read = pasemi_rng_data_read, | ||
87 | }; | ||
88 | |||
89 | static int __devinit rng_probe(struct of_device *ofdev, | ||
90 | const struct of_device_id *match) | ||
91 | { | ||
92 | void __iomem *rng_regs; | ||
93 | struct device_node *rng_np = ofdev->node; | ||
94 | struct resource res; | ||
95 | int err = 0; | ||
96 | |||
97 | err = of_address_to_resource(rng_np, 0, &res); | ||
98 | if (err) | ||
99 | return -ENODEV; | ||
100 | |||
101 | rng_regs = ioremap(res.start, 0x100); | ||
102 | |||
103 | if (!rng_regs) | ||
104 | return -ENOMEM; | ||
105 | |||
106 | pasemi_rng.priv = (unsigned long)rng_regs; | ||
107 | |||
108 | printk(KERN_INFO "Registering PA Semi RNG\n"); | ||
109 | |||
110 | err = hwrng_register(&pasemi_rng); | ||
111 | |||
112 | if (err) | ||
113 | iounmap(rng_regs); | ||
114 | |||
115 | return err; | ||
116 | } | ||
117 | |||
118 | static int __devexit rng_remove(struct of_device *dev) | ||
119 | { | ||
120 | void __iomem *rng_regs = (void __iomem *)pasemi_rng.priv; | ||
121 | |||
122 | hwrng_unregister(&pasemi_rng); | ||
123 | iounmap(rng_regs); | ||
124 | |||
125 | return 0; | ||
126 | } | ||
127 | |||
128 | static struct of_device_id rng_match[] = { | ||
129 | { | ||
130 | .compatible = "1682m-rng", | ||
131 | }, | ||
132 | {}, | ||
133 | }; | ||
134 | |||
135 | static struct of_platform_driver rng_driver = { | ||
136 | .name = "pasemi-rng", | ||
137 | .match_table = rng_match, | ||
138 | .probe = rng_probe, | ||
139 | .remove = rng_remove, | ||
140 | }; | ||
141 | |||
142 | static int __init rng_init(void) | ||
143 | { | ||
144 | return of_register_platform_driver(&rng_driver); | ||
145 | } | ||
146 | module_init(rng_init); | ||
147 | |||
148 | static void __exit rng_exit(void) | ||
149 | { | ||
150 | of_unregister_platform_driver(&rng_driver); | ||
151 | } | ||
152 | module_exit(rng_exit); | ||
153 | |||
154 | MODULE_LICENSE("GPL"); | ||
155 | MODULE_AUTHOR("Egor Martovetsky <egor@pasemi.com>"); | ||
156 | MODULE_DESCRIPTION("H/W RNG driver for PA Semi processor"); | ||
diff --git a/drivers/char/mmtimer.c b/drivers/char/mmtimer.c index c09160383a53..6e55cfb9c65a 100644 --- a/drivers/char/mmtimer.c +++ b/drivers/char/mmtimer.c | |||
@@ -705,15 +705,13 @@ static int __init mmtimer_init(void) | |||
705 | maxn++; | 705 | maxn++; |
706 | 706 | ||
707 | /* Allocate list of node ptrs to mmtimer_t's */ | 707 | /* Allocate list of node ptrs to mmtimer_t's */ |
708 | timers = kmalloc(sizeof(mmtimer_t *)*maxn, GFP_KERNEL); | 708 | timers = kzalloc(sizeof(mmtimer_t *)*maxn, GFP_KERNEL); |
709 | if (timers == NULL) { | 709 | if (timers == NULL) { |
710 | printk(KERN_ERR "%s: failed to allocate memory for device\n", | 710 | printk(KERN_ERR "%s: failed to allocate memory for device\n", |
711 | MMTIMER_NAME); | 711 | MMTIMER_NAME); |
712 | goto out3; | 712 | goto out3; |
713 | } | 713 | } |
714 | 714 | ||
715 | memset(timers,0,(sizeof(mmtimer_t *)*maxn)); | ||
716 | |||
717 | /* Allocate mmtimer_t's for each online node */ | 715 | /* Allocate mmtimer_t's for each online node */ |
718 | for_each_online_node(node) { | 716 | for_each_online_node(node) { |
719 | timers[node] = kmalloc_node(sizeof(mmtimer_t)*NUM_COMPARATORS, GFP_KERNEL, node); | 717 | timers[node] = kmalloc_node(sizeof(mmtimer_t)*NUM_COMPARATORS, GFP_KERNEL, node); |
diff --git a/drivers/char/pcmcia/Kconfig b/drivers/char/pcmcia/Kconfig index 27c1179ee527..f25facd97bb4 100644 --- a/drivers/char/pcmcia/Kconfig +++ b/drivers/char/pcmcia/Kconfig | |||
@@ -21,6 +21,7 @@ config SYNCLINK_CS | |||
21 | config CARDMAN_4000 | 21 | config CARDMAN_4000 |
22 | tristate "Omnikey Cardman 4000 support" | 22 | tristate "Omnikey Cardman 4000 support" |
23 | depends on PCMCIA | 23 | depends on PCMCIA |
24 | select BITREVERSE | ||
24 | help | 25 | help |
25 | Enable support for the Omnikey Cardman 4000 PCMCIA Smartcard | 26 | Enable support for the Omnikey Cardman 4000 PCMCIA Smartcard |
26 | reader. | 27 | reader. |
diff --git a/drivers/char/pcmcia/cm4000_cs.c b/drivers/char/pcmcia/cm4000_cs.c index e91b43a014b0..fee58e03dbe2 100644 --- a/drivers/char/pcmcia/cm4000_cs.c +++ b/drivers/char/pcmcia/cm4000_cs.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <linux/init.h> | 31 | #include <linux/init.h> |
32 | #include <linux/fs.h> | 32 | #include <linux/fs.h> |
33 | #include <linux/delay.h> | 33 | #include <linux/delay.h> |
34 | #include <linux/bitrev.h> | ||
34 | #include <asm/uaccess.h> | 35 | #include <asm/uaccess.h> |
35 | #include <asm/io.h> | 36 | #include <asm/io.h> |
36 | 37 | ||
@@ -194,41 +195,17 @@ static inline unsigned char xinb(unsigned short port) | |||
194 | } | 195 | } |
195 | #endif | 196 | #endif |
196 | 197 | ||
197 | #define b_0000 15 | 198 | static inline unsigned char invert_revert(unsigned char ch) |
198 | #define b_0001 14 | 199 | { |
199 | #define b_0010 13 | 200 | return bitrev8(~ch); |
200 | #define b_0011 12 | 201 | } |
201 | #define b_0100 11 | ||
202 | #define b_0101 10 | ||
203 | #define b_0110 9 | ||
204 | #define b_0111 8 | ||
205 | #define b_1000 7 | ||
206 | #define b_1001 6 | ||
207 | #define b_1010 5 | ||
208 | #define b_1011 4 | ||
209 | #define b_1100 3 | ||
210 | #define b_1101 2 | ||
211 | #define b_1110 1 | ||
212 | #define b_1111 0 | ||
213 | |||
214 | static unsigned char irtab[16] = { | ||
215 | b_0000, b_1000, b_0100, b_1100, | ||
216 | b_0010, b_1010, b_0110, b_1110, | ||
217 | b_0001, b_1001, b_0101, b_1101, | ||
218 | b_0011, b_1011, b_0111, b_1111 | ||
219 | }; | ||
220 | 202 | ||
221 | static void str_invert_revert(unsigned char *b, int len) | 203 | static void str_invert_revert(unsigned char *b, int len) |
222 | { | 204 | { |
223 | int i; | 205 | int i; |
224 | 206 | ||
225 | for (i = 0; i < len; i++) | 207 | for (i = 0; i < len; i++) |
226 | b[i] = (irtab[b[i] & 0x0f] << 4) | irtab[b[i] >> 4]; | 208 | b[i] = invert_revert(b[i]); |
227 | } | ||
228 | |||
229 | static unsigned char invert_revert(unsigned char ch) | ||
230 | { | ||
231 | return (irtab[ch & 0x0f] << 4) | irtab[ch >> 4]; | ||
232 | } | 209 | } |
233 | 210 | ||
234 | #define ATRLENCK(dev,pos) \ | 211 | #define ATRLENCK(dev,pos) \ |
@@ -1114,7 +1091,7 @@ static ssize_t cmm_write(struct file *filp, const char __user *buf, | |||
1114 | /* | 1091 | /* |
1115 | * wait for atr to become valid. | 1092 | * wait for atr to become valid. |
1116 | * note: it is important to lock this code. if we dont, the monitor | 1093 | * note: it is important to lock this code. if we dont, the monitor |
1117 | * could be run between test_bit and the the call the sleep on the | 1094 | * could be run between test_bit and the call to sleep on the |
1118 | * atr-queue. if *then* the monitor detects atr valid, it will wake up | 1095 | * atr-queue. if *then* the monitor detects atr valid, it will wake up |
1119 | * any process on the atr-queue, *but* since we have been interrupted, | 1096 | * any process on the atr-queue, *but* since we have been interrupted, |
1120 | * we do not yet sleep on this queue. this would result in a missed | 1097 | * we do not yet sleep on this queue. this would result in a missed |
@@ -1881,8 +1858,11 @@ static int cm4000_probe(struct pcmcia_device *link) | |||
1881 | init_waitqueue_head(&dev->readq); | 1858 | init_waitqueue_head(&dev->readq); |
1882 | 1859 | ||
1883 | ret = cm4000_config(link, i); | 1860 | ret = cm4000_config(link, i); |
1884 | if (ret) | 1861 | if (ret) { |
1862 | dev_table[i] = NULL; | ||
1863 | kfree(dev); | ||
1885 | return ret; | 1864 | return ret; |
1865 | } | ||
1886 | 1866 | ||
1887 | class_device_create(cmm_class, NULL, MKDEV(major, i), NULL, | 1867 | class_device_create(cmm_class, NULL, MKDEV(major, i), NULL, |
1888 | "cmm%d", i); | 1868 | "cmm%d", i); |
@@ -1907,7 +1887,7 @@ static void cm4000_detach(struct pcmcia_device *link) | |||
1907 | cm4000_release(link); | 1887 | cm4000_release(link); |
1908 | 1888 | ||
1909 | dev_table[devno] = NULL; | 1889 | dev_table[devno] = NULL; |
1910 | kfree(dev); | 1890 | kfree(dev); |
1911 | 1891 | ||
1912 | class_device_destroy(cmm_class, MKDEV(major, devno)); | 1892 | class_device_destroy(cmm_class, MKDEV(major, devno)); |
1913 | 1893 | ||
@@ -1956,12 +1936,14 @@ static int __init cmm_init(void) | |||
1956 | if (major < 0) { | 1936 | if (major < 0) { |
1957 | printk(KERN_WARNING MODULE_NAME | 1937 | printk(KERN_WARNING MODULE_NAME |
1958 | ": could not get major number\n"); | 1938 | ": could not get major number\n"); |
1939 | class_destroy(cmm_class); | ||
1959 | return major; | 1940 | return major; |
1960 | } | 1941 | } |
1961 | 1942 | ||
1962 | rc = pcmcia_register_driver(&cm4000_driver); | 1943 | rc = pcmcia_register_driver(&cm4000_driver); |
1963 | if (rc < 0) { | 1944 | if (rc < 0) { |
1964 | unregister_chrdev(major, DEVICE_NAME); | 1945 | unregister_chrdev(major, DEVICE_NAME); |
1946 | class_destroy(cmm_class); | ||
1965 | return rc; | 1947 | return rc; |
1966 | } | 1948 | } |
1967 | 1949 | ||
diff --git a/drivers/char/pcmcia/cm4040_cs.c b/drivers/char/pcmcia/cm4040_cs.c index f2e4ec4fd407..af88181a17f4 100644 --- a/drivers/char/pcmcia/cm4040_cs.c +++ b/drivers/char/pcmcia/cm4040_cs.c | |||
@@ -636,8 +636,11 @@ static int reader_probe(struct pcmcia_device *link) | |||
636 | setup_timer(&dev->poll_timer, cm4040_do_poll, 0); | 636 | setup_timer(&dev->poll_timer, cm4040_do_poll, 0); |
637 | 637 | ||
638 | ret = reader_config(link, i); | 638 | ret = reader_config(link, i); |
639 | if (ret) | 639 | if (ret) { |
640 | dev_table[i] = NULL; | ||
641 | kfree(dev); | ||
640 | return ret; | 642 | return ret; |
643 | } | ||
641 | 644 | ||
642 | class_device_create(cmx_class, NULL, MKDEV(major, i), NULL, | 645 | class_device_create(cmx_class, NULL, MKDEV(major, i), NULL, |
643 | "cmx%d", i); | 646 | "cmx%d", i); |
@@ -708,12 +711,14 @@ static int __init cm4040_init(void) | |||
708 | if (major < 0) { | 711 | if (major < 0) { |
709 | printk(KERN_WARNING MODULE_NAME | 712 | printk(KERN_WARNING MODULE_NAME |
710 | ": could not get major number\n"); | 713 | ": could not get major number\n"); |
714 | class_destroy(cmx_class); | ||
711 | return major; | 715 | return major; |
712 | } | 716 | } |
713 | 717 | ||
714 | rc = pcmcia_register_driver(&reader_driver); | 718 | rc = pcmcia_register_driver(&reader_driver); |
715 | if (rc < 0) { | 719 | if (rc < 0) { |
716 | unregister_chrdev(major, DEVICE_NAME); | 720 | unregister_chrdev(major, DEVICE_NAME); |
721 | class_destroy(cmx_class); | ||
717 | return rc; | 722 | return rc; |
718 | } | 723 | } |
719 | 724 | ||
diff --git a/drivers/char/tpm/Kconfig b/drivers/char/tpm/Kconfig index fe00c7dfb649..11089be0691b 100644 --- a/drivers/char/tpm/Kconfig +++ b/drivers/char/tpm/Kconfig | |||
@@ -33,7 +33,7 @@ config TCG_NSC | |||
33 | tristate "National Semiconductor TPM Interface" | 33 | tristate "National Semiconductor TPM Interface" |
34 | depends on TCG_TPM && PNPACPI | 34 | depends on TCG_TPM && PNPACPI |
35 | ---help--- | 35 | ---help--- |
36 | If you have a TPM security chip from National Semicondutor | 36 | If you have a TPM security chip from National Semiconductor |
37 | say Yes and it will be accessible from within Linux. To | 37 | say Yes and it will be accessible from within Linux. To |
38 | compile this driver as a module, choose M here; the module | 38 | compile this driver as a module, choose M here; the module |
39 | will be called tpm_nsc. | 39 | will be called tpm_nsc. |
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index 7710a6a77d97..fc662e4ce58a 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c | |||
@@ -934,13 +934,6 @@ restart: | |||
934 | return -EINVAL; | 934 | return -EINVAL; |
935 | 935 | ||
936 | /* | 936 | /* |
937 | * No more input please, we are switching. The new ldisc | ||
938 | * will update this value in the ldisc open function | ||
939 | */ | ||
940 | |||
941 | tty->receive_room = 0; | ||
942 | |||
943 | /* | ||
944 | * Problem: What do we do if this blocks ? | 937 | * Problem: What do we do if this blocks ? |
945 | */ | 938 | */ |
946 | 939 | ||
@@ -951,6 +944,13 @@ restart: | |||
951 | return 0; | 944 | return 0; |
952 | } | 945 | } |
953 | 946 | ||
947 | /* | ||
948 | * No more input please, we are switching. The new ldisc | ||
949 | * will update this value in the ldisc open function | ||
950 | */ | ||
951 | |||
952 | tty->receive_room = 0; | ||
953 | |||
954 | o_ldisc = tty->ldisc; | 954 | o_ldisc = tty->ldisc; |
955 | o_tty = tty->link; | 955 | o_tty = tty->link; |
956 | 956 | ||
@@ -1573,11 +1573,11 @@ void no_tty(void) | |||
1573 | 1573 | ||
1574 | 1574 | ||
1575 | /** | 1575 | /** |
1576 | * stop_tty - propogate flow control | 1576 | * stop_tty - propagate flow control |
1577 | * @tty: tty to stop | 1577 | * @tty: tty to stop |
1578 | * | 1578 | * |
1579 | * Perform flow control to the driver. For PTY/TTY pairs we | 1579 | * Perform flow control to the driver. For PTY/TTY pairs we |
1580 | * must also propogate the TIOCKPKT status. May be called | 1580 | * must also propagate the TIOCKPKT status. May be called |
1581 | * on an already stopped device and will not re-call the driver | 1581 | * on an already stopped device and will not re-call the driver |
1582 | * method. | 1582 | * method. |
1583 | * | 1583 | * |
@@ -1607,11 +1607,11 @@ void stop_tty(struct tty_struct *tty) | |||
1607 | EXPORT_SYMBOL(stop_tty); | 1607 | EXPORT_SYMBOL(stop_tty); |
1608 | 1608 | ||
1609 | /** | 1609 | /** |
1610 | * start_tty - propogate flow control | 1610 | * start_tty - propagate flow control |
1611 | * @tty: tty to start | 1611 | * @tty: tty to start |
1612 | * | 1612 | * |
1613 | * Start a tty that has been stopped if at all possible. Perform | 1613 | * Start a tty that has been stopped if at all possible. Perform |
1614 | * any neccessary wakeups and propogate the TIOCPKT status. If this | 1614 | * any neccessary wakeups and propagate the TIOCPKT status. If this |
1615 | * is the tty was previous stopped and is being started then the | 1615 | * is the tty was previous stopped and is being started then the |
1616 | * driver start method is invoked and the line discipline woken. | 1616 | * driver start method is invoked and the line discipline woken. |
1617 | * | 1617 | * |