aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-01-18 12:15:49 -0500
committerIngo Molnar <mingo@elte.hu>2009-01-18 12:15:49 -0500
commitaf37501c792107c2bde1524bdae38d9a247b841a (patch)
treeb50ee90d29e72956b8b7d8d19677fe5996755d49 /drivers/char
parentd859e29fe34cb833071b20aef860ee94fbad9bb2 (diff)
parent99937d6455cea95405ac681c86a857d0fcd530bd (diff)
Merge branch 'core/percpu' into perfcounters/core
Conflicts: arch/x86/include/asm/pda.h We merge tip/core/percpu into tip/perfcounters/core because of a semantic and contextual conflict: the former eliminates the PDA, while the latter extends it with apic_perf_irqs field. Resolve the conflict by moving the new field to the irq_cpustat structure on 64-bit too. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/amiserial.c36
-rw-r--r--drivers/char/pty.c4
-rw-r--r--drivers/char/ser_a2232.c12
-rw-r--r--drivers/char/vme_scc.c166
4 files changed, 177 insertions, 41 deletions
diff --git a/drivers/char/amiserial.c b/drivers/char/amiserial.c
index 4e0cfdeab146..a58869ea8513 100644
--- a/drivers/char/amiserial.c
+++ b/drivers/char/amiserial.c
@@ -1963,6 +1963,7 @@ static int __init rs_init(void)
1963{ 1963{
1964 unsigned long flags; 1964 unsigned long flags;
1965 struct serial_state * state; 1965 struct serial_state * state;
1966 int error;
1966 1967
1967 if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(AMI_SERIAL)) 1968 if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(AMI_SERIAL))
1968 return -ENODEV; 1969 return -ENODEV;
@@ -1975,8 +1976,11 @@ static int __init rs_init(void)
1975 * We request SERDAT and SERPER only, because the serial registers are 1976 * We request SERDAT and SERPER only, because the serial registers are
1976 * too spreaded over the custom register space 1977 * too spreaded over the custom register space
1977 */ 1978 */
1978 if (!request_mem_region(CUSTOM_PHYSADDR+0x30, 4, "amiserial [Paula]")) 1979 if (!request_mem_region(CUSTOM_PHYSADDR+0x30, 4,
1979 return -EBUSY; 1980 "amiserial [Paula]")) {
1981 error = -EBUSY;
1982 goto fail_put_tty_driver;
1983 }
1980 1984
1981 IRQ_ports = NULL; 1985 IRQ_ports = NULL;
1982 1986
@@ -1997,8 +2001,9 @@ static int __init rs_init(void)
1997 serial_driver->flags = TTY_DRIVER_REAL_RAW; 2001 serial_driver->flags = TTY_DRIVER_REAL_RAW;
1998 tty_set_operations(serial_driver, &serial_ops); 2002 tty_set_operations(serial_driver, &serial_ops);
1999 2003
2000 if (tty_register_driver(serial_driver)) 2004 error = tty_register_driver(serial_driver);
2001 panic("Couldn't register serial driver\n"); 2005 if (error)
2006 goto fail_release_mem_region;
2002 2007
2003 state = rs_table; 2008 state = rs_table;
2004 state->magic = SSTATE_MAGIC; 2009 state->magic = SSTATE_MAGIC;
@@ -2024,8 +2029,14 @@ static int __init rs_init(void)
2024 local_irq_save(flags); 2029 local_irq_save(flags);
2025 2030
2026 /* set ISRs, and then disable the rx interrupts */ 2031 /* set ISRs, and then disable the rx interrupts */
2027 request_irq(IRQ_AMIGA_TBE, ser_tx_int, 0, "serial TX", state); 2032 error = request_irq(IRQ_AMIGA_TBE, ser_tx_int, 0, "serial TX", state);
2028 request_irq(IRQ_AMIGA_RBF, ser_rx_int, IRQF_DISABLED, "serial RX", state); 2033 if (error)
2034 goto fail_unregister;
2035
2036 error = request_irq(IRQ_AMIGA_RBF, ser_rx_int, IRQF_DISABLED,
2037 "serial RX", state);
2038 if (error)
2039 goto fail_free_irq;
2029 2040
2030 /* turn off Rx and Tx interrupts */ 2041 /* turn off Rx and Tx interrupts */
2031 custom.intena = IF_RBF | IF_TBE; 2042 custom.intena = IF_RBF | IF_TBE;
@@ -2045,6 +2056,16 @@ static int __init rs_init(void)
2045 ciab.ddra &= ~(SER_DCD | SER_CTS | SER_DSR); /* inputs */ 2056 ciab.ddra &= ~(SER_DCD | SER_CTS | SER_DSR); /* inputs */
2046 2057
2047 return 0; 2058 return 0;
2059
2060fail_free_irq:
2061 free_irq(IRQ_AMIGA_TBE, state);
2062fail_unregister:
2063 tty_unregister_driver(serial_driver);
2064fail_release_mem_region:
2065 release_mem_region(CUSTOM_PHYSADDR+0x30, 4);
2066fail_put_tty_driver:
2067 put_tty_driver(serial_driver);
2068 return error;
2048} 2069}
2049 2070
2050static __exit void rs_exit(void) 2071static __exit void rs_exit(void)
@@ -2064,6 +2085,9 @@ static __exit void rs_exit(void)
2064 kfree(info); 2085 kfree(info);
2065 } 2086 }
2066 2087
2088 free_irq(IRQ_AMIGA_TBE, rs_table);
2089 free_irq(IRQ_AMIGA_RBF, rs_table);
2090
2067 release_mem_region(CUSTOM_PHYSADDR+0x30, 4); 2091 release_mem_region(CUSTOM_PHYSADDR+0x30, 4);
2068} 2092}
2069 2093
diff --git a/drivers/char/pty.c b/drivers/char/pty.c
index 146c97613da0..31038a0052a2 100644
--- a/drivers/char/pty.c
+++ b/drivers/char/pty.c
@@ -230,9 +230,7 @@ static void pty_set_termios(struct tty_struct *tty,
230/** 230/**
231 * pty_do_resize - resize event 231 * pty_do_resize - resize event
232 * @tty: tty being resized 232 * @tty: tty being resized
233 * @real_tty: real tty (not the same as tty if using a pty/tty pair) 233 * @ws: window size being set.
234 * @rows: rows (character)
235 * @cols: cols (character)
236 * 234 *
237 * Update the termios variables and send the neccessary signals to 235 * Update the termios variables and send the neccessary signals to
238 * peform a terminal resize correctly 236 * peform a terminal resize correctly
diff --git a/drivers/char/ser_a2232.c b/drivers/char/ser_a2232.c
index 33872a219df6..33a2b531802e 100644
--- a/drivers/char/ser_a2232.c
+++ b/drivers/char/ser_a2232.c
@@ -718,6 +718,7 @@ static int __init a2232board_init(void)
718 u_char *from; 718 u_char *from;
719 volatile u_char *to; 719 volatile u_char *to;
720 volatile struct a2232memory *mem; 720 volatile struct a2232memory *mem;
721 int error, i;
721 722
722#ifdef CONFIG_SMP 723#ifdef CONFIG_SMP
723 return -ENODEV; /* This driver is not SMP aware. Is there an SMP ZorroII-bus-machine? */ 724 return -ENODEV; /* This driver is not SMP aware. Is there an SMP ZorroII-bus-machine? */
@@ -797,8 +798,15 @@ static int __init a2232board_init(void)
797 */ 798 */
798 if (a2232_init_drivers()) return -ENODEV; // maybe we should use a different -Exxx? 799 if (a2232_init_drivers()) return -ENODEV; // maybe we should use a different -Exxx?
799 800
800 request_irq(IRQ_AMIGA_VERTB, a2232_vbl_inter, 0, "A2232 serial VBL", a2232_driver_ID); 801 error = request_irq(IRQ_AMIGA_VERTB, a2232_vbl_inter, 0,
801 return 0; 802 "A2232 serial VBL", a2232_driver_ID);
803 if (error) {
804 for (i = 0; i < nr_a2232; i++)
805 zorro_release_device(zd_a2232[i]);
806 tty_unregister_driver(a2232_driver);
807 put_tty_driver(a2232_driver);
808 }
809 return error;
802} 810}
803 811
804static void __exit a2232board_exit(void) 812static void __exit a2232board_exit(void)
diff --git a/drivers/char/vme_scc.c b/drivers/char/vme_scc.c
index 0e8234bd0e19..994e1a58b987 100644
--- a/drivers/char/vme_scc.c
+++ b/drivers/char/vme_scc.c
@@ -198,6 +198,7 @@ static void scc_init_portstructs(void)
198static int mvme147_scc_init(void) 198static int mvme147_scc_init(void)
199{ 199{
200 struct scc_port *port; 200 struct scc_port *port;
201 int error;
201 202
202 printk(KERN_INFO "SCC: MVME147 Serial Driver\n"); 203 printk(KERN_INFO "SCC: MVME147 Serial Driver\n");
203 /* Init channel A */ 204 /* Init channel A */
@@ -207,14 +208,23 @@ static int mvme147_scc_init(void)
207 port->datap = port->ctrlp + 1; 208 port->datap = port->ctrlp + 1;
208 port->port_a = &scc_ports[0]; 209 port->port_a = &scc_ports[0];
209 port->port_b = &scc_ports[1]; 210 port->port_b = &scc_ports[1];
210 request_irq(MVME147_IRQ_SCCA_TX, scc_tx_int, IRQF_DISABLED, 211 error = request_irq(MVME147_IRQ_SCCA_TX, scc_tx_int, IRQF_DISABLED,
211 "SCC-A TX", port); 212 "SCC-A TX", port);
212 request_irq(MVME147_IRQ_SCCA_STAT, scc_stat_int, IRQF_DISABLED, 213 if (error)
214 goto fail;
215 error = request_irq(MVME147_IRQ_SCCA_STAT, scc_stat_int, IRQF_DISABLED,
213 "SCC-A status", port); 216 "SCC-A status", port);
214 request_irq(MVME147_IRQ_SCCA_RX, scc_rx_int, IRQF_DISABLED, 217 if (error)
218 goto fail_free_a_tx;
219 error = request_irq(MVME147_IRQ_SCCA_RX, scc_rx_int, IRQF_DISABLED,
215 "SCC-A RX", port); 220 "SCC-A RX", port);
216 request_irq(MVME147_IRQ_SCCA_SPCOND, scc_spcond_int, IRQF_DISABLED, 221 if (error)
217 "SCC-A special cond", port); 222 goto fail_free_a_stat;
223 error = request_irq(MVME147_IRQ_SCCA_SPCOND, scc_spcond_int,
224 IRQF_DISABLED, "SCC-A special cond", port);
225 if (error)
226 goto fail_free_a_rx;
227
218 { 228 {
219 SCC_ACCESS_INIT(port); 229 SCC_ACCESS_INIT(port);
220 230
@@ -234,14 +244,23 @@ static int mvme147_scc_init(void)
234 port->datap = port->ctrlp + 1; 244 port->datap = port->ctrlp + 1;
235 port->port_a = &scc_ports[0]; 245 port->port_a = &scc_ports[0];
236 port->port_b = &scc_ports[1]; 246 port->port_b = &scc_ports[1];
237 request_irq(MVME147_IRQ_SCCB_TX, scc_tx_int, IRQF_DISABLED, 247 error = request_irq(MVME147_IRQ_SCCB_TX, scc_tx_int, IRQF_DISABLED,
238 "SCC-B TX", port); 248 "SCC-B TX", port);
239 request_irq(MVME147_IRQ_SCCB_STAT, scc_stat_int, IRQF_DISABLED, 249 if (error)
250 goto fail_free_a_spcond;
251 error = request_irq(MVME147_IRQ_SCCB_STAT, scc_stat_int, IRQF_DISABLED,
240 "SCC-B status", port); 252 "SCC-B status", port);
241 request_irq(MVME147_IRQ_SCCB_RX, scc_rx_int, IRQF_DISABLED, 253 if (error)
254 goto fail_free_b_tx;
255 error = request_irq(MVME147_IRQ_SCCB_RX, scc_rx_int, IRQF_DISABLED,
242 "SCC-B RX", port); 256 "SCC-B RX", port);
243 request_irq(MVME147_IRQ_SCCB_SPCOND, scc_spcond_int, IRQF_DISABLED, 257 if (error)
244 "SCC-B special cond", port); 258 goto fail_free_b_stat;
259 error = request_irq(MVME147_IRQ_SCCB_SPCOND, scc_spcond_int,
260 IRQF_DISABLED, "SCC-B special cond", port);
261 if (error)
262 goto fail_free_b_rx;
263
245 { 264 {
246 SCC_ACCESS_INIT(port); 265 SCC_ACCESS_INIT(port);
247 266
@@ -257,6 +276,23 @@ static int mvme147_scc_init(void)
257 scc_init_drivers(); 276 scc_init_drivers();
258 277
259 return 0; 278 return 0;
279
280fail_free_b_rx:
281 free_irq(MVME147_IRQ_SCCB_RX, port);
282fail_free_b_stat:
283 free_irq(MVME147_IRQ_SCCB_STAT, port);
284fail_free_b_tx:
285 free_irq(MVME147_IRQ_SCCB_TX, port);
286fail_free_a_spcond:
287 free_irq(MVME147_IRQ_SCCA_SPCOND, port);
288fail_free_a_rx:
289 free_irq(MVME147_IRQ_SCCA_RX, port);
290fail_free_a_stat:
291 free_irq(MVME147_IRQ_SCCA_STAT, port);
292fail_free_a_tx:
293 free_irq(MVME147_IRQ_SCCA_TX, port);
294fail:
295 return error;
260} 296}
261#endif 297#endif
262 298
@@ -265,6 +301,7 @@ static int mvme147_scc_init(void)
265static int mvme162_scc_init(void) 301static int mvme162_scc_init(void)
266{ 302{
267 struct scc_port *port; 303 struct scc_port *port;
304 int error;
268 305
269 if (!(mvme16x_config & MVME16x_CONFIG_GOT_SCCA)) 306 if (!(mvme16x_config & MVME16x_CONFIG_GOT_SCCA))
270 return (-ENODEV); 307 return (-ENODEV);
@@ -277,14 +314,23 @@ static int mvme162_scc_init(void)
277 port->datap = port->ctrlp + 2; 314 port->datap = port->ctrlp + 2;
278 port->port_a = &scc_ports[0]; 315 port->port_a = &scc_ports[0];
279 port->port_b = &scc_ports[1]; 316 port->port_b = &scc_ports[1];
280 request_irq(MVME162_IRQ_SCCA_TX, scc_tx_int, IRQF_DISABLED, 317 error = request_irq(MVME162_IRQ_SCCA_TX, scc_tx_int, IRQF_DISABLED,
281 "SCC-A TX", port); 318 "SCC-A TX", port);
282 request_irq(MVME162_IRQ_SCCA_STAT, scc_stat_int, IRQF_DISABLED, 319 if (error)
320 goto fail;
321 error = request_irq(MVME162_IRQ_SCCA_STAT, scc_stat_int, IRQF_DISABLED,
283 "SCC-A status", port); 322 "SCC-A status", port);
284 request_irq(MVME162_IRQ_SCCA_RX, scc_rx_int, IRQF_DISABLED, 323 if (error)
324 goto fail_free_a_tx;
325 error = request_irq(MVME162_IRQ_SCCA_RX, scc_rx_int, IRQF_DISABLED,
285 "SCC-A RX", port); 326 "SCC-A RX", port);
286 request_irq(MVME162_IRQ_SCCA_SPCOND, scc_spcond_int, IRQF_DISABLED, 327 if (error)
287 "SCC-A special cond", port); 328 goto fail_free_a_stat;
329 error = request_irq(MVME162_IRQ_SCCA_SPCOND, scc_spcond_int,
330 IRQF_DISABLED, "SCC-A special cond", port);
331 if (error)
332 goto fail_free_a_rx;
333
288 { 334 {
289 SCC_ACCESS_INIT(port); 335 SCC_ACCESS_INIT(port);
290 336
@@ -304,14 +350,22 @@ static int mvme162_scc_init(void)
304 port->datap = port->ctrlp + 2; 350 port->datap = port->ctrlp + 2;
305 port->port_a = &scc_ports[0]; 351 port->port_a = &scc_ports[0];
306 port->port_b = &scc_ports[1]; 352 port->port_b = &scc_ports[1];
307 request_irq(MVME162_IRQ_SCCB_TX, scc_tx_int, IRQF_DISABLED, 353 error = request_irq(MVME162_IRQ_SCCB_TX, scc_tx_int, IRQF_DISABLED,
308 "SCC-B TX", port); 354 "SCC-B TX", port);
309 request_irq(MVME162_IRQ_SCCB_STAT, scc_stat_int, IRQF_DISABLED, 355 if (error)
356 goto fail_free_a_spcond;
357 error = request_irq(MVME162_IRQ_SCCB_STAT, scc_stat_int, IRQF_DISABLED,
310 "SCC-B status", port); 358 "SCC-B status", port);
311 request_irq(MVME162_IRQ_SCCB_RX, scc_rx_int, IRQF_DISABLED, 359 if (error)
360 goto fail_free_b_tx;
361 error = request_irq(MVME162_IRQ_SCCB_RX, scc_rx_int, IRQF_DISABLED,
312 "SCC-B RX", port); 362 "SCC-B RX", port);
313 request_irq(MVME162_IRQ_SCCB_SPCOND, scc_spcond_int, IRQF_DISABLED, 363 if (error)
314 "SCC-B special cond", port); 364 goto fail_free_b_stat;
365 error = request_irq(MVME162_IRQ_SCCB_SPCOND, scc_spcond_int,
366 IRQF_DISABLED, "SCC-B special cond", port);
367 if (error)
368 goto fail_free_b_rx;
315 369
316 { 370 {
317 SCC_ACCESS_INIT(port); /* Either channel will do */ 371 SCC_ACCESS_INIT(port); /* Either channel will do */
@@ -328,6 +382,23 @@ static int mvme162_scc_init(void)
328 scc_init_drivers(); 382 scc_init_drivers();
329 383
330 return 0; 384 return 0;
385
386fail_free_b_rx:
387 free_irq(MVME162_IRQ_SCCB_RX, port);
388fail_free_b_stat:
389 free_irq(MVME162_IRQ_SCCB_STAT, port);
390fail_free_b_tx:
391 free_irq(MVME162_IRQ_SCCB_TX, port);
392fail_free_a_spcond:
393 free_irq(MVME162_IRQ_SCCA_SPCOND, port);
394fail_free_a_rx:
395 free_irq(MVME162_IRQ_SCCA_RX, port);
396fail_free_a_stat:
397 free_irq(MVME162_IRQ_SCCA_STAT, port);
398fail_free_a_tx:
399 free_irq(MVME162_IRQ_SCCA_TX, port);
400fail:
401 return error;
331} 402}
332#endif 403#endif
333 404
@@ -336,6 +407,7 @@ static int mvme162_scc_init(void)
336static int bvme6000_scc_init(void) 407static int bvme6000_scc_init(void)
337{ 408{
338 struct scc_port *port; 409 struct scc_port *port;
410 int error;
339 411
340 printk(KERN_INFO "SCC: BVME6000 Serial Driver\n"); 412 printk(KERN_INFO "SCC: BVME6000 Serial Driver\n");
341 /* Init channel A */ 413 /* Init channel A */
@@ -345,14 +417,23 @@ static int bvme6000_scc_init(void)
345 port->datap = port->ctrlp + 4; 417 port->datap = port->ctrlp + 4;
346 port->port_a = &scc_ports[0]; 418 port->port_a = &scc_ports[0];
347 port->port_b = &scc_ports[1]; 419 port->port_b = &scc_ports[1];
348 request_irq(BVME_IRQ_SCCA_TX, scc_tx_int, IRQF_DISABLED, 420 error = request_irq(BVME_IRQ_SCCA_TX, scc_tx_int, IRQF_DISABLED,
349 "SCC-A TX", port); 421 "SCC-A TX", port);
350 request_irq(BVME_IRQ_SCCA_STAT, scc_stat_int, IRQF_DISABLED, 422 if (error)
423 goto fail;
424 error = request_irq(BVME_IRQ_SCCA_STAT, scc_stat_int, IRQF_DISABLED,
351 "SCC-A status", port); 425 "SCC-A status", port);
352 request_irq(BVME_IRQ_SCCA_RX, scc_rx_int, IRQF_DISABLED, 426 if (error)
427 goto fail_free_a_tx;
428 error = request_irq(BVME_IRQ_SCCA_RX, scc_rx_int, IRQF_DISABLED,
353 "SCC-A RX", port); 429 "SCC-A RX", port);
354 request_irq(BVME_IRQ_SCCA_SPCOND, scc_spcond_int, IRQF_DISABLED, 430 if (error)
355 "SCC-A special cond", port); 431 goto fail_free_a_stat;
432 error = request_irq(BVME_IRQ_SCCA_SPCOND, scc_spcond_int,
433 IRQF_DISABLED, "SCC-A special cond", port);
434 if (error)
435 goto fail_free_a_rx;
436
356 { 437 {
357 SCC_ACCESS_INIT(port); 438 SCC_ACCESS_INIT(port);
358 439
@@ -372,14 +453,22 @@ static int bvme6000_scc_init(void)
372 port->datap = port->ctrlp + 4; 453 port->datap = port->ctrlp + 4;
373 port->port_a = &scc_ports[0]; 454 port->port_a = &scc_ports[0];
374 port->port_b = &scc_ports[1]; 455 port->port_b = &scc_ports[1];
375 request_irq(BVME_IRQ_SCCB_TX, scc_tx_int, IRQF_DISABLED, 456 error = request_irq(BVME_IRQ_SCCB_TX, scc_tx_int, IRQF_DISABLED,
376 "SCC-B TX", port); 457 "SCC-B TX", port);
377 request_irq(BVME_IRQ_SCCB_STAT, scc_stat_int, IRQF_DISABLED, 458 if (error)
459 goto fail_free_a_spcond;
460 error = request_irq(BVME_IRQ_SCCB_STAT, scc_stat_int, IRQF_DISABLED,
378 "SCC-B status", port); 461 "SCC-B status", port);
379 request_irq(BVME_IRQ_SCCB_RX, scc_rx_int, IRQF_DISABLED, 462 if (error)
463 goto fail_free_b_tx;
464 error = request_irq(BVME_IRQ_SCCB_RX, scc_rx_int, IRQF_DISABLED,
380 "SCC-B RX", port); 465 "SCC-B RX", port);
381 request_irq(BVME_IRQ_SCCB_SPCOND, scc_spcond_int, IRQF_DISABLED, 466 if (error)
382 "SCC-B special cond", port); 467 goto fail_free_b_stat;
468 error = request_irq(BVME_IRQ_SCCB_SPCOND, scc_spcond_int,
469 IRQF_DISABLED, "SCC-B special cond", port);
470 if (error)
471 goto fail_free_b_rx;
383 472
384 { 473 {
385 SCC_ACCESS_INIT(port); /* Either channel will do */ 474 SCC_ACCESS_INIT(port); /* Either channel will do */
@@ -393,6 +482,23 @@ static int bvme6000_scc_init(void)
393 scc_init_drivers(); 482 scc_init_drivers();
394 483
395 return 0; 484 return 0;
485
486fail:
487 free_irq(BVME_IRQ_SCCA_STAT, port);
488fail_free_a_tx:
489 free_irq(BVME_IRQ_SCCA_RX, port);
490fail_free_a_stat:
491 free_irq(BVME_IRQ_SCCA_SPCOND, port);
492fail_free_a_rx:
493 free_irq(BVME_IRQ_SCCB_TX, port);
494fail_free_a_spcond:
495 free_irq(BVME_IRQ_SCCB_STAT, port);
496fail_free_b_tx:
497 free_irq(BVME_IRQ_SCCB_RX, port);
498fail_free_b_stat:
499 free_irq(BVME_IRQ_SCCB_SPCOND, port);
500fail_free_b_rx:
501 return error;
396} 502}
397#endif 503#endif
398 504