diff options
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/Kconfig | 15 | ||||
-rw-r--r-- | drivers/char/Makefile | 1 | ||||
-rw-r--r-- | drivers/char/briq_panel.c | 266 | ||||
-rw-r--r-- | drivers/char/hw_random/tx4939-rng.c | 5 | ||||
-rw-r--r-- | drivers/char/nvram.c | 2 | ||||
-rw-r--r-- | drivers/char/pcmcia/synclink_cs.c | 3 | ||||
-rw-r--r-- | drivers/char/ramoops.c | 1 | ||||
-rw-r--r-- | drivers/char/rtc.c | 4 | ||||
-rw-r--r-- | drivers/char/tlclk.c | 2 | ||||
-rw-r--r-- | drivers/char/tpm/Kconfig | 1 | ||||
-rw-r--r-- | drivers/char/tpm/tpm.c | 3 | ||||
-rw-r--r-- | drivers/char/tpm/tpm.h | 2 | ||||
-rw-r--r-- | drivers/char/tpm/tpm_tis.c | 27 | ||||
-rw-r--r-- | drivers/char/ttyprintk.c | 2 |
14 files changed, 25 insertions, 309 deletions
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig index 43643033a3a..ee946865d6c 100644 --- a/drivers/char/Kconfig +++ b/drivers/char/Kconfig | |||
@@ -66,21 +66,6 @@ config TTY_PRINTK | |||
66 | 66 | ||
67 | If unsure, say N. | 67 | If unsure, say N. |
68 | 68 | ||
69 | config BRIQ_PANEL | ||
70 | tristate 'Total Impact briQ front panel driver' | ||
71 | depends on PPC_CHRP | ||
72 | ---help--- | ||
73 | The briQ is a small footprint CHRP computer with a frontpanel VFD, a | ||
74 | tristate led and two switches. It is the size of a CDROM drive. | ||
75 | |||
76 | If you have such one and want anything showing on the VFD then you | ||
77 | must answer Y here. | ||
78 | |||
79 | To compile this driver as a module, choose M here: the | ||
80 | module will be called briq_panel. | ||
81 | |||
82 | It's safe to say N here. | ||
83 | |||
84 | config BFIN_OTP | 69 | config BFIN_OTP |
85 | tristate "Blackfin On-Chip OTP Memory Support" | 70 | tristate "Blackfin On-Chip OTP Memory Support" |
86 | depends on BLACKFIN && (BF51x || BF52x || BF54x) | 71 | depends on BLACKFIN && (BF51x || BF52x || BF54x) |
diff --git a/drivers/char/Makefile b/drivers/char/Makefile index 32762ba769c..0dc5d7ce486 100644 --- a/drivers/char/Makefile +++ b/drivers/char/Makefile | |||
@@ -16,7 +16,6 @@ obj-$(CONFIG_UV_MMTIMER) += uv_mmtimer.o | |||
16 | obj-$(CONFIG_VIOTAPE) += viotape.o | 16 | obj-$(CONFIG_VIOTAPE) += viotape.o |
17 | obj-$(CONFIG_IBM_BSR) += bsr.o | 17 | obj-$(CONFIG_IBM_BSR) += bsr.o |
18 | obj-$(CONFIG_SGI_MBCS) += mbcs.o | 18 | obj-$(CONFIG_SGI_MBCS) += mbcs.o |
19 | obj-$(CONFIG_BRIQ_PANEL) += briq_panel.o | ||
20 | obj-$(CONFIG_BFIN_OTP) += bfin-otp.o | 19 | obj-$(CONFIG_BFIN_OTP) += bfin-otp.o |
21 | 20 | ||
22 | obj-$(CONFIG_PRINTER) += lp.o | 21 | obj-$(CONFIG_PRINTER) += lp.o |
diff --git a/drivers/char/briq_panel.c b/drivers/char/briq_panel.c deleted file mode 100644 index 095ab90535c..00000000000 --- a/drivers/char/briq_panel.c +++ /dev/null | |||
@@ -1,266 +0,0 @@ | |||
1 | /* | ||
2 | * Drivers for the Total Impact PPC based computer "BRIQ" | ||
3 | * by Dr. Karsten Jeppesen | ||
4 | * | ||
5 | */ | ||
6 | |||
7 | #include <linux/module.h> | ||
8 | |||
9 | #include <linux/types.h> | ||
10 | #include <linux/errno.h> | ||
11 | #include <linux/tty.h> | ||
12 | #include <linux/timer.h> | ||
13 | #include <linux/kernel.h> | ||
14 | #include <linux/wait.h> | ||
15 | #include <linux/string.h> | ||
16 | #include <linux/ioport.h> | ||
17 | #include <linux/delay.h> | ||
18 | #include <linux/miscdevice.h> | ||
19 | #include <linux/fs.h> | ||
20 | #include <linux/mm.h> | ||
21 | #include <linux/init.h> | ||
22 | |||
23 | #include <asm/uaccess.h> | ||
24 | #include <asm/io.h> | ||
25 | #include <asm/prom.h> | ||
26 | |||
27 | #define BRIQ_PANEL_MINOR 156 | ||
28 | #define BRIQ_PANEL_VFD_IOPORT 0x0390 | ||
29 | #define BRIQ_PANEL_LED_IOPORT 0x0398 | ||
30 | #define BRIQ_PANEL_VER "1.1 (04/20/2002)" | ||
31 | #define BRIQ_PANEL_MSG0 "Loading Linux" | ||
32 | |||
33 | static int vfd_is_open; | ||
34 | static unsigned char vfd[40]; | ||
35 | static int vfd_cursor; | ||
36 | static unsigned char ledpb, led; | ||
37 | |||
38 | static void update_vfd(void) | ||
39 | { | ||
40 | int i; | ||
41 | |||
42 | /* cursor home */ | ||
43 | outb(0x02, BRIQ_PANEL_VFD_IOPORT); | ||
44 | for (i=0; i<20; i++) | ||
45 | outb(vfd[i], BRIQ_PANEL_VFD_IOPORT + 1); | ||
46 | |||
47 | /* cursor to next line */ | ||
48 | outb(0xc0, BRIQ_PANEL_VFD_IOPORT); | ||
49 | for (i=20; i<40; i++) | ||
50 | outb(vfd[i], BRIQ_PANEL_VFD_IOPORT + 1); | ||
51 | |||
52 | } | ||
53 | |||
54 | static void set_led(char state) | ||
55 | { | ||
56 | if (state == 'R') | ||
57 | led = 0x01; | ||
58 | else if (state == 'G') | ||
59 | led = 0x02; | ||
60 | else if (state == 'Y') | ||
61 | led = 0x03; | ||
62 | else if (state == 'X') | ||
63 | led = 0x00; | ||
64 | outb(led, BRIQ_PANEL_LED_IOPORT); | ||
65 | } | ||
66 | |||
67 | static int briq_panel_open(struct inode *ino, struct file *filep) | ||
68 | { | ||
69 | tty_lock(); | ||
70 | /* enforce single access, vfd_is_open is protected by BKL */ | ||
71 | if (vfd_is_open) { | ||
72 | tty_unlock(); | ||
73 | return -EBUSY; | ||
74 | } | ||
75 | vfd_is_open = 1; | ||
76 | |||
77 | tty_unlock(); | ||
78 | return 0; | ||
79 | } | ||
80 | |||
81 | static int briq_panel_release(struct inode *ino, struct file *filep) | ||
82 | { | ||
83 | if (!vfd_is_open) | ||
84 | return -ENODEV; | ||
85 | |||
86 | vfd_is_open = 0; | ||
87 | |||
88 | return 0; | ||
89 | } | ||
90 | |||
91 | static ssize_t briq_panel_read(struct file *file, char __user *buf, size_t count, | ||
92 | loff_t *ppos) | ||
93 | { | ||
94 | unsigned short c; | ||
95 | unsigned char cp; | ||
96 | |||
97 | if (!vfd_is_open) | ||
98 | return -ENODEV; | ||
99 | |||
100 | c = (inb(BRIQ_PANEL_LED_IOPORT) & 0x000c) | (ledpb & 0x0003); | ||
101 | set_led(' '); | ||
102 | /* upper button released */ | ||
103 | if ((!(ledpb & 0x0004)) && (c & 0x0004)) { | ||
104 | cp = ' '; | ||
105 | ledpb = c; | ||
106 | if (copy_to_user(buf, &cp, 1)) | ||
107 | return -EFAULT; | ||
108 | return 1; | ||
109 | } | ||
110 | /* lower button released */ | ||
111 | else if ((!(ledpb & 0x0008)) && (c & 0x0008)) { | ||
112 | cp = '\r'; | ||
113 | ledpb = c; | ||
114 | if (copy_to_user(buf, &cp, 1)) | ||
115 | return -EFAULT; | ||
116 | return 1; | ||
117 | } else { | ||
118 | ledpb = c; | ||
119 | return 0; | ||
120 | } | ||
121 | } | ||
122 | |||
123 | static void scroll_vfd( void ) | ||
124 | { | ||
125 | int i; | ||
126 | |||
127 | for (i=0; i<20; i++) { | ||
128 | vfd[i] = vfd[i+20]; | ||
129 | vfd[i+20] = ' '; | ||
130 | } | ||
131 | vfd_cursor = 20; | ||
132 | } | ||
133 | |||
134 | static ssize_t briq_panel_write(struct file *file, const char __user *buf, size_t len, | ||
135 | loff_t *ppos) | ||
136 | { | ||
137 | size_t indx = len; | ||
138 | int i, esc = 0; | ||
139 | |||
140 | if (!vfd_is_open) | ||
141 | return -EBUSY; | ||
142 | |||
143 | for (;;) { | ||
144 | char c; | ||
145 | if (!indx) | ||
146 | break; | ||
147 | if (get_user(c, buf)) | ||
148 | return -EFAULT; | ||
149 | if (esc) { | ||
150 | set_led(c); | ||
151 | esc = 0; | ||
152 | } else if (c == 27) { | ||
153 | esc = 1; | ||
154 | } else if (c == 12) { | ||
155 | /* do a form feed */ | ||
156 | for (i=0; i<40; i++) | ||
157 | vfd[i] = ' '; | ||
158 | vfd_cursor = 0; | ||
159 | } else if (c == 10) { | ||
160 | if (vfd_cursor < 20) | ||
161 | vfd_cursor = 20; | ||
162 | else if (vfd_cursor < 40) | ||
163 | vfd_cursor = 40; | ||
164 | else if (vfd_cursor < 60) | ||
165 | vfd_cursor = 60; | ||
166 | if (vfd_cursor > 59) | ||
167 | scroll_vfd(); | ||
168 | } else { | ||
169 | /* just a character */ | ||
170 | if (vfd_cursor > 39) | ||
171 | scroll_vfd(); | ||
172 | vfd[vfd_cursor++] = c; | ||
173 | } | ||
174 | indx--; | ||
175 | buf++; | ||
176 | } | ||
177 | update_vfd(); | ||
178 | |||
179 | return len; | ||
180 | } | ||
181 | |||
182 | static const struct file_operations briq_panel_fops = { | ||
183 | .owner = THIS_MODULE, | ||
184 | .read = briq_panel_read, | ||
185 | .write = briq_panel_write, | ||
186 | .open = briq_panel_open, | ||
187 | .release = briq_panel_release, | ||
188 | .llseek = noop_llseek, | ||
189 | }; | ||
190 | |||
191 | static struct miscdevice briq_panel_miscdev = { | ||
192 | BRIQ_PANEL_MINOR, | ||
193 | "briq_panel", | ||
194 | &briq_panel_fops | ||
195 | }; | ||
196 | |||
197 | static int __init briq_panel_init(void) | ||
198 | { | ||
199 | struct device_node *root = of_find_node_by_path("/"); | ||
200 | const char *machine; | ||
201 | int i; | ||
202 | |||
203 | machine = of_get_property(root, "model", NULL); | ||
204 | if (!machine || strncmp(machine, "TotalImpact,BRIQ-1", 18) != 0) { | ||
205 | of_node_put(root); | ||
206 | return -ENODEV; | ||
207 | } | ||
208 | of_node_put(root); | ||
209 | |||
210 | printk(KERN_INFO | ||
211 | "briq_panel: v%s Dr. Karsten Jeppesen (kj@totalimpact.com)\n", | ||
212 | BRIQ_PANEL_VER); | ||
213 | |||
214 | if (!request_region(BRIQ_PANEL_VFD_IOPORT, 4, "BRIQ Front Panel")) | ||
215 | return -EBUSY; | ||
216 | |||
217 | if (!request_region(BRIQ_PANEL_LED_IOPORT, 2, "BRIQ Front Panel")) { | ||
218 | release_region(BRIQ_PANEL_VFD_IOPORT, 4); | ||
219 | return -EBUSY; | ||
220 | } | ||
221 | ledpb = inb(BRIQ_PANEL_LED_IOPORT) & 0x000c; | ||
222 | |||
223 | if (misc_register(&briq_panel_miscdev) < 0) { | ||
224 | release_region(BRIQ_PANEL_VFD_IOPORT, 4); | ||
225 | release_region(BRIQ_PANEL_LED_IOPORT, 2); | ||
226 | return -EBUSY; | ||
227 | } | ||
228 | |||
229 | outb(0x38, BRIQ_PANEL_VFD_IOPORT); /* Function set */ | ||
230 | outb(0x01, BRIQ_PANEL_VFD_IOPORT); /* Clear display */ | ||
231 | outb(0x0c, BRIQ_PANEL_VFD_IOPORT); /* Display on */ | ||
232 | outb(0x06, BRIQ_PANEL_VFD_IOPORT); /* Entry normal */ | ||
233 | for (i=0; i<40; i++) | ||
234 | vfd[i]=' '; | ||
235 | #ifndef MODULE | ||
236 | vfd[0] = 'L'; | ||
237 | vfd[1] = 'o'; | ||
238 | vfd[2] = 'a'; | ||
239 | vfd[3] = 'd'; | ||
240 | vfd[4] = 'i'; | ||
241 | vfd[5] = 'n'; | ||
242 | vfd[6] = 'g'; | ||
243 | vfd[7] = ' '; | ||
244 | vfd[8] = '.'; | ||
245 | vfd[9] = '.'; | ||
246 | vfd[10] = '.'; | ||
247 | #endif /* !MODULE */ | ||
248 | |||
249 | update_vfd(); | ||
250 | |||
251 | return 0; | ||
252 | } | ||
253 | |||
254 | static void __exit briq_panel_exit(void) | ||
255 | { | ||
256 | misc_deregister(&briq_panel_miscdev); | ||
257 | release_region(BRIQ_PANEL_VFD_IOPORT, 4); | ||
258 | release_region(BRIQ_PANEL_LED_IOPORT, 2); | ||
259 | } | ||
260 | |||
261 | module_init(briq_panel_init); | ||
262 | module_exit(briq_panel_exit); | ||
263 | |||
264 | MODULE_LICENSE("GPL"); | ||
265 | MODULE_AUTHOR("Karsten Jeppesen <karsten@jeppesens.com>"); | ||
266 | MODULE_DESCRIPTION("Driver for the Total Impact briQ front panel"); | ||
diff --git a/drivers/char/hw_random/tx4939-rng.c b/drivers/char/hw_random/tx4939-rng.c index 0bc0cb70210..de473ef3882 100644 --- a/drivers/char/hw_random/tx4939-rng.c +++ b/drivers/char/hw_random/tx4939-rng.c | |||
@@ -115,10 +115,7 @@ static int __init tx4939_rng_probe(struct platform_device *dev) | |||
115 | rngdev = devm_kzalloc(&dev->dev, sizeof(*rngdev), GFP_KERNEL); | 115 | rngdev = devm_kzalloc(&dev->dev, sizeof(*rngdev), GFP_KERNEL); |
116 | if (!rngdev) | 116 | if (!rngdev) |
117 | return -ENOMEM; | 117 | return -ENOMEM; |
118 | if (!devm_request_mem_region(&dev->dev, r->start, resource_size(r), | 118 | rngdev->base = devm_request_and_ioremap(&dev->dev, r); |
119 | dev_name(&dev->dev))) | ||
120 | return -EBUSY; | ||
121 | rngdev->base = devm_ioremap(&dev->dev, r->start, resource_size(r)); | ||
122 | if (!rngdev->base) | 119 | if (!rngdev->base) |
123 | return -EBUSY; | 120 | return -EBUSY; |
124 | 121 | ||
diff --git a/drivers/char/nvram.c b/drivers/char/nvram.c index da3cfee782d..eaade8a1ecd 100644 --- a/drivers/char/nvram.c +++ b/drivers/char/nvram.c | |||
@@ -94,7 +94,7 @@ | |||
94 | /* Note that *all* calls to CMOS_READ and CMOS_WRITE must be done with | 94 | /* Note that *all* calls to CMOS_READ and CMOS_WRITE must be done with |
95 | * rtc_lock held. Due to the index-port/data-port design of the RTC, we | 95 | * rtc_lock held. Due to the index-port/data-port design of the RTC, we |
96 | * don't want two different things trying to get to it at once. (e.g. the | 96 | * don't want two different things trying to get to it at once. (e.g. the |
97 | * periodic 11 min sync from time.c vs. this driver.) | 97 | * periodic 11 min sync from kernel/time/ntp.c vs. this driver.) |
98 | */ | 98 | */ |
99 | 99 | ||
100 | #include <linux/types.h> | 100 | #include <linux/types.h> |
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c index 07f6a5abe37..f6453df4921 100644 --- a/drivers/char/pcmcia/synclink_cs.c +++ b/drivers/char/pcmcia/synclink_cs.c | |||
@@ -2484,7 +2484,7 @@ static int mgslpc_open(struct tty_struct *tty, struct file * filp) | |||
2484 | 2484 | ||
2485 | /* verify range of specified line number */ | 2485 | /* verify range of specified line number */ |
2486 | line = tty->index; | 2486 | line = tty->index; |
2487 | if ((line < 0) || (line >= mgslpc_device_count)) { | 2487 | if (line >= mgslpc_device_count) { |
2488 | printk("%s(%d):mgslpc_open with invalid line #%d.\n", | 2488 | printk("%s(%d):mgslpc_open with invalid line #%d.\n", |
2489 | __FILE__,__LINE__,line); | 2489 | __FILE__,__LINE__,line); |
2490 | return -ENODEV; | 2490 | return -ENODEV; |
@@ -2836,7 +2836,6 @@ static int __init synclink_cs_init(void) | |||
2836 | 2836 | ||
2837 | /* Initialize the tty_driver structure */ | 2837 | /* Initialize the tty_driver structure */ |
2838 | 2838 | ||
2839 | serial_driver->owner = THIS_MODULE; | ||
2840 | serial_driver->driver_name = "synclink_cs"; | 2839 | serial_driver->driver_name = "synclink_cs"; |
2841 | serial_driver->name = "ttySLP"; | 2840 | serial_driver->name = "ttySLP"; |
2842 | serial_driver->major = ttymajor; | 2841 | serial_driver->major = ttymajor; |
diff --git a/drivers/char/ramoops.c b/drivers/char/ramoops.c index 9fec3232b73..2a5e45d2a9f 100644 --- a/drivers/char/ramoops.c +++ b/drivers/char/ramoops.c | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <linux/module.h> | 26 | #include <linux/module.h> |
27 | #include <linux/kmsg_dump.h> | 27 | #include <linux/kmsg_dump.h> |
28 | #include <linux/time.h> | 28 | #include <linux/time.h> |
29 | #include <linux/err.h> | ||
30 | #include <linux/io.h> | 29 | #include <linux/io.h> |
31 | #include <linux/ioport.h> | 30 | #include <linux/ioport.h> |
32 | #include <linux/platform_device.h> | 31 | #include <linux/platform_device.h> |
diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c index ccd124ab7ca..872e09a02d2 100644 --- a/drivers/char/rtc.c +++ b/drivers/char/rtc.c | |||
@@ -57,8 +57,8 @@ | |||
57 | * Note that *all* calls to CMOS_READ and CMOS_WRITE are done with | 57 | * Note that *all* calls to CMOS_READ and CMOS_WRITE are done with |
58 | * interrupts disabled. Due to the index-port/data-port (0x70/0x71) | 58 | * interrupts disabled. Due to the index-port/data-port (0x70/0x71) |
59 | * design of the RTC, we don't want two different things trying to | 59 | * design of the RTC, we don't want two different things trying to |
60 | * get to it at once. (e.g. the periodic 11 min sync from time.c vs. | 60 | * get to it at once. (e.g. the periodic 11 min sync from |
61 | * this driver.) | 61 | * kernel/time/ntp.c vs. this driver.) |
62 | */ | 62 | */ |
63 | 63 | ||
64 | #include <linux/interrupt.h> | 64 | #include <linux/interrupt.h> |
diff --git a/drivers/char/tlclk.c b/drivers/char/tlclk.c index 0c964cdcc22..ce29e7cce52 100644 --- a/drivers/char/tlclk.c +++ b/drivers/char/tlclk.c | |||
@@ -797,7 +797,7 @@ static int __init tlclk_init(void) | |||
797 | telclk_interrupt = (inb(TLCLK_REG7) & 0x0f); | 797 | telclk_interrupt = (inb(TLCLK_REG7) & 0x0f); |
798 | 798 | ||
799 | if (0x0F == telclk_interrupt ) { /* not MCPBL0010 ? */ | 799 | if (0x0F == telclk_interrupt ) { /* not MCPBL0010 ? */ |
800 | printk(KERN_ERR "telclk_interrup = 0x%x non-mcpbl0010 hw.\n", | 800 | printk(KERN_ERR "telclk_interrupt = 0x%x non-mcpbl0010 hw.\n", |
801 | telclk_interrupt); | 801 | telclk_interrupt); |
802 | ret = -ENXIO; | 802 | ret = -ENXIO; |
803 | goto out3; | 803 | goto out3; |
diff --git a/drivers/char/tpm/Kconfig b/drivers/char/tpm/Kconfig index 7fc75e47e6d..a048199ce86 100644 --- a/drivers/char/tpm/Kconfig +++ b/drivers/char/tpm/Kconfig | |||
@@ -5,7 +5,6 @@ | |||
5 | menuconfig TCG_TPM | 5 | menuconfig TCG_TPM |
6 | tristate "TPM Hardware Support" | 6 | tristate "TPM Hardware Support" |
7 | depends on HAS_IOMEM | 7 | depends on HAS_IOMEM |
8 | depends on EXPERIMENTAL | ||
9 | select SECURITYFS | 8 | select SECURITYFS |
10 | ---help--- | 9 | ---help--- |
11 | If you have a TPM security chip in your system, which | 10 | If you have a TPM security chip in your system, which |
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c index 32362cf35b8..ad7c7320dd1 100644 --- a/drivers/char/tpm/tpm.c +++ b/drivers/char/tpm/tpm.c | |||
@@ -1221,12 +1221,13 @@ ssize_t tpm_read(struct file *file, char __user *buf, | |||
1221 | ret_size = atomic_read(&chip->data_pending); | 1221 | ret_size = atomic_read(&chip->data_pending); |
1222 | atomic_set(&chip->data_pending, 0); | 1222 | atomic_set(&chip->data_pending, 0); |
1223 | if (ret_size > 0) { /* relay data */ | 1223 | if (ret_size > 0) { /* relay data */ |
1224 | ssize_t orig_ret_size = ret_size; | ||
1224 | if (size < ret_size) | 1225 | if (size < ret_size) |
1225 | ret_size = size; | 1226 | ret_size = size; |
1226 | 1227 | ||
1227 | mutex_lock(&chip->buffer_mutex); | 1228 | mutex_lock(&chip->buffer_mutex); |
1228 | rc = copy_to_user(buf, chip->data_buffer, ret_size); | 1229 | rc = copy_to_user(buf, chip->data_buffer, ret_size); |
1229 | memset(chip->data_buffer, 0, ret_size); | 1230 | memset(chip->data_buffer, 0, orig_ret_size); |
1230 | if (rc) | 1231 | if (rc) |
1231 | ret_size = -EFAULT; | 1232 | ret_size = -EFAULT; |
1232 | 1233 | ||
diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h index 01054713828..b1c5280ac15 100644 --- a/drivers/char/tpm/tpm.h +++ b/drivers/char/tpm/tpm.h | |||
@@ -99,6 +99,8 @@ struct tpm_vendor_specific { | |||
99 | wait_queue_head_t int_queue; | 99 | wait_queue_head_t int_queue; |
100 | }; | 100 | }; |
101 | 101 | ||
102 | #define TPM_VID_INTEL 0x8086 | ||
103 | |||
102 | struct tpm_chip { | 104 | struct tpm_chip { |
103 | struct device *dev; /* Device stuff */ | 105 | struct device *dev; /* Device stuff */ |
104 | 106 | ||
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c index a1748621111..d2a70cae76d 100644 --- a/drivers/char/tpm/tpm_tis.c +++ b/drivers/char/tpm/tpm_tis.c | |||
@@ -76,7 +76,7 @@ enum tis_defaults { | |||
76 | #define TPM_RID(l) (0x0F04 | ((l) << 12)) | 76 | #define TPM_RID(l) (0x0F04 | ((l) << 12)) |
77 | 77 | ||
78 | static LIST_HEAD(tis_chips); | 78 | static LIST_HEAD(tis_chips); |
79 | static DEFINE_SPINLOCK(tis_lock); | 79 | static DEFINE_MUTEX(tis_lock); |
80 | 80 | ||
81 | #if defined(CONFIG_PNP) && defined(CONFIG_ACPI) | 81 | #if defined(CONFIG_PNP) && defined(CONFIG_ACPI) |
82 | static int is_itpm(struct pnp_dev *dev) | 82 | static int is_itpm(struct pnp_dev *dev) |
@@ -367,7 +367,12 @@ static int probe_itpm(struct tpm_chip *chip) | |||
367 | 0x00, 0x00, 0x00, 0xf1 | 367 | 0x00, 0x00, 0x00, 0xf1 |
368 | }; | 368 | }; |
369 | size_t len = sizeof(cmd_getticks); | 369 | size_t len = sizeof(cmd_getticks); |
370 | int rem_itpm = itpm; | 370 | bool rem_itpm = itpm; |
371 | u16 vendor = ioread16(chip->vendor.iobase + TPM_DID_VID(0)); | ||
372 | |||
373 | /* probe only iTPMS */ | ||
374 | if (vendor != TPM_VID_INTEL) | ||
375 | return 0; | ||
371 | 376 | ||
372 | itpm = 0; | 377 | itpm = 0; |
373 | 378 | ||
@@ -390,9 +395,6 @@ static int probe_itpm(struct tpm_chip *chip) | |||
390 | out: | 395 | out: |
391 | itpm = rem_itpm; | 396 | itpm = rem_itpm; |
392 | tpm_tis_ready(chip); | 397 | tpm_tis_ready(chip); |
393 | /* some TPMs need a break here otherwise they will not work | ||
394 | * correctly on the immediately subsequent command */ | ||
395 | msleep(chip->vendor.timeout_b); | ||
396 | release_locality(chip, chip->vendor.locality, 0); | 398 | release_locality(chip, chip->vendor.locality, 0); |
397 | 399 | ||
398 | return rc; | 400 | return rc; |
@@ -508,7 +510,7 @@ static int tpm_tis_init(struct device *dev, resource_size_t start, | |||
508 | resource_size_t len, unsigned int irq) | 510 | resource_size_t len, unsigned int irq) |
509 | { | 511 | { |
510 | u32 vendor, intfcaps, intmask; | 512 | u32 vendor, intfcaps, intmask; |
511 | int rc, i, irq_s, irq_e; | 513 | int rc, i, irq_s, irq_e, probe; |
512 | struct tpm_chip *chip; | 514 | struct tpm_chip *chip; |
513 | 515 | ||
514 | if (!(chip = tpm_register_hardware(dev, &tpm_tis))) | 516 | if (!(chip = tpm_register_hardware(dev, &tpm_tis))) |
@@ -538,11 +540,12 @@ static int tpm_tis_init(struct device *dev, resource_size_t start, | |||
538 | vendor >> 16, ioread8(chip->vendor.iobase + TPM_RID(0))); | 540 | vendor >> 16, ioread8(chip->vendor.iobase + TPM_RID(0))); |
539 | 541 | ||
540 | if (!itpm) { | 542 | if (!itpm) { |
541 | itpm = probe_itpm(chip); | 543 | probe = probe_itpm(chip); |
542 | if (itpm < 0) { | 544 | if (probe < 0) { |
543 | rc = -ENODEV; | 545 | rc = -ENODEV; |
544 | goto out_err; | 546 | goto out_err; |
545 | } | 547 | } |
548 | itpm = (probe == 0) ? 0 : 1; | ||
546 | } | 549 | } |
547 | 550 | ||
548 | if (itpm) | 551 | if (itpm) |
@@ -689,9 +692,9 @@ static int tpm_tis_init(struct device *dev, resource_size_t start, | |||
689 | } | 692 | } |
690 | 693 | ||
691 | INIT_LIST_HEAD(&chip->vendor.list); | 694 | INIT_LIST_HEAD(&chip->vendor.list); |
692 | spin_lock(&tis_lock); | 695 | mutex_lock(&tis_lock); |
693 | list_add(&chip->vendor.list, &tis_chips); | 696 | list_add(&chip->vendor.list, &tis_chips); |
694 | spin_unlock(&tis_lock); | 697 | mutex_unlock(&tis_lock); |
695 | 698 | ||
696 | 699 | ||
697 | return 0; | 700 | return 0; |
@@ -855,7 +858,7 @@ static void __exit cleanup_tis(void) | |||
855 | { | 858 | { |
856 | struct tpm_vendor_specific *i, *j; | 859 | struct tpm_vendor_specific *i, *j; |
857 | struct tpm_chip *chip; | 860 | struct tpm_chip *chip; |
858 | spin_lock(&tis_lock); | 861 | mutex_lock(&tis_lock); |
859 | list_for_each_entry_safe(i, j, &tis_chips, list) { | 862 | list_for_each_entry_safe(i, j, &tis_chips, list) { |
860 | chip = to_tpm_chip(i); | 863 | chip = to_tpm_chip(i); |
861 | tpm_remove_hardware(chip->dev); | 864 | tpm_remove_hardware(chip->dev); |
@@ -871,7 +874,7 @@ static void __exit cleanup_tis(void) | |||
871 | iounmap(i->iobase); | 874 | iounmap(i->iobase); |
872 | list_del(&i->list); | 875 | list_del(&i->list); |
873 | } | 876 | } |
874 | spin_unlock(&tis_lock); | 877 | mutex_unlock(&tis_lock); |
875 | #ifdef CONFIG_PNP | 878 | #ifdef CONFIG_PNP |
876 | if (!force) { | 879 | if (!force) { |
877 | pnp_unregister_driver(&tis_pnp_driver); | 880 | pnp_unregister_driver(&tis_pnp_driver); |
diff --git a/drivers/char/ttyprintk.c b/drivers/char/ttyprintk.c index eedd5474850..46b77ede84c 100644 --- a/drivers/char/ttyprintk.c +++ b/drivers/char/ttyprintk.c | |||
@@ -184,12 +184,10 @@ static int __init ttyprintk_init(void) | |||
184 | if (!ttyprintk_driver) | 184 | if (!ttyprintk_driver) |
185 | return ret; | 185 | return ret; |
186 | 186 | ||
187 | ttyprintk_driver->owner = THIS_MODULE; | ||
188 | ttyprintk_driver->driver_name = "ttyprintk"; | 187 | ttyprintk_driver->driver_name = "ttyprintk"; |
189 | ttyprintk_driver->name = "ttyprintk"; | 188 | ttyprintk_driver->name = "ttyprintk"; |
190 | ttyprintk_driver->major = TTYAUX_MAJOR; | 189 | ttyprintk_driver->major = TTYAUX_MAJOR; |
191 | ttyprintk_driver->minor_start = 3; | 190 | ttyprintk_driver->minor_start = 3; |
192 | ttyprintk_driver->num = 1; | ||
193 | ttyprintk_driver->type = TTY_DRIVER_TYPE_CONSOLE; | 191 | ttyprintk_driver->type = TTY_DRIVER_TYPE_CONSOLE; |
194 | ttyprintk_driver->init_termios = tty_std_termios; | 192 | ttyprintk_driver->init_termios = tty_std_termios; |
195 | ttyprintk_driver->init_termios.c_oflag = OPOST | OCRNL | ONOCR | ONLRET; | 193 | ttyprintk_driver->init_termios.c_oflag = OPOST | OCRNL | ONOCR | ONLRET; |