Commit d61780c0d384939ef31c46b47442854d5def4623
Committed by
Linus Torvalds
1 parent
34ad92c238
Exists in
master
and in
7 other branches
[PATCH] remove some more check_region stuff
Removed some more references to check_region(). I checked these changes into the 'checkreg' branch of rsync://rsync.kernel.org/pub/scm/linux/kernel/git/jgarzik/misc-2.6.git The only valid references remaining are in: drivers/scsi/advansys.c drivers/scsi/BusLogic.c drivers/cdrom/sbpcd.c sound/oss/pss.c Remove last vestiges of ide_check_region() drivers/char/specialix: trim trailing whitespace drivers/char/specialix: eliminate use of check_region() Remove outdated and unused references to check_region() [sound oss] remove check_region() usage from cs4232, wavfront [netdrvr eepro] trim trailing whitespace [netdrvr eepro] remove check_region() usage Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Showing 11 changed files with 230 additions and 228 deletions Side-by-side Diff
Documentation/i2c/writing-clients
arch/ppc/platforms/hdpu.c
... | ... | @@ -609,11 +609,6 @@ |
609 | 609 | } |
610 | 610 | |
611 | 611 | #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) |
612 | -static int hdpu_ide_check_region(ide_ioreg_t from, unsigned int extent) | |
613 | -{ | |
614 | - return check_region(from, extent); | |
615 | -} | |
616 | - | |
617 | 612 | static void |
618 | 613 | hdpu_ide_request_region(ide_ioreg_t from, unsigned int extent, const char *name) |
619 | 614 | { |
arch/sparc/kernel/pcic.c
... | ... | @@ -497,8 +497,8 @@ |
497 | 497 | * CheerIO makes a similar conversion. |
498 | 498 | * See ebus.c for details. |
499 | 499 | * |
500 | - * Note that check_region()/request_region() | |
501 | - * work for these devices. | |
500 | + * Note that request_region() | |
501 | + * works for these devices. | |
502 | 502 | * |
503 | 503 | * XXX Neat trick, but it's a *bad* idea |
504 | 504 | * to shit into regions like that. |
drivers/char/specialix.c
Changes suppressed. Click to show
... | ... | @@ -38,19 +38,19 @@ |
38 | 38 | * |
39 | 39 | * Revision 1.0: April 1st 1997. |
40 | 40 | * Initial release for alpha testing. |
41 | - * Revision 1.1: April 14th 1997. | |
42 | - * Incorporated Richard Hudsons suggestions, | |
41 | + * Revision 1.1: April 14th 1997. | |
42 | + * Incorporated Richard Hudsons suggestions, | |
43 | 43 | * removed some debugging printk's. |
44 | 44 | * Revision 1.2: April 15th 1997. |
45 | 45 | * Ported to 2.1.x kernels. |
46 | - * Revision 1.3: April 17th 1997 | |
47 | - * Backported to 2.0. (Compatibility macros). | |
46 | + * Revision 1.3: April 17th 1997 | |
47 | + * Backported to 2.0. (Compatibility macros). | |
48 | 48 | * Revision 1.4: April 18th 1997 |
49 | - * Fixed DTR/RTS bug that caused the card to indicate | |
50 | - * "don't send data" to a modem after the password prompt. | |
49 | + * Fixed DTR/RTS bug that caused the card to indicate | |
50 | + * "don't send data" to a modem after the password prompt. | |
51 | 51 | * Fixed bug for premature (fake) interrupts. |
52 | 52 | * Revision 1.5: April 19th 1997 |
53 | - * fixed a minor typo in the header file, cleanup a little. | |
53 | + * fixed a minor typo in the header file, cleanup a little. | |
54 | 54 | * performance warnings are now MAXed at once per minute. |
55 | 55 | * Revision 1.6: May 23 1997 |
56 | 56 | * Changed the specialix=... format to include interrupt. |
57 | 57 | |
... | ... | @@ -60,10 +60,10 @@ |
60 | 60 | * port to linux-2.1.43 kernel. |
61 | 61 | * Revision 1.9: Oct 9 1998 |
62 | 62 | * Added stuff for the IO8+/PCI version. |
63 | - * Revision 1.10: Oct 22 1999 / Jan 21 2000. | |
64 | - * Added stuff for setserial. | |
63 | + * Revision 1.10: Oct 22 1999 / Jan 21 2000. | |
64 | + * Added stuff for setserial. | |
65 | 65 | * Nicolas Mailhot (Nicolas.Mailhot@email.enst.fr) |
66 | - * | |
66 | + * | |
67 | 67 | */ |
68 | 68 | |
69 | 69 | #define VERSION "1.11" |
... | ... | @@ -154,7 +154,7 @@ |
154 | 154 | |
155 | 155 | |
156 | 156 | |
157 | -/* | |
157 | +/* | |
158 | 158 | * The following defines are mostly for testing purposes. But if you need |
159 | 159 | * some nice reporting in your syslog, you can define them also. |
160 | 160 | */ |
... | ... | @@ -188,7 +188,7 @@ |
188 | 188 | |
189 | 189 | static unsigned long baud_table[] = { |
190 | 190 | 0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, |
191 | - 9600, 19200, 38400, 57600, 115200, 0, | |
191 | + 9600, 19200, 38400, 57600, 115200, 0, | |
192 | 192 | }; |
193 | 193 | |
194 | 194 | static struct specialix_board sx_board[SX_NBOARD] = { |
... | ... | @@ -216,7 +216,7 @@ |
216 | 216 | KERN_ERR "sx: Warning: bad specialix port magic number for device %s in %s\n"; |
217 | 217 | static const char *badinfo = |
218 | 218 | KERN_ERR "sx: Warning: null specialix port for device %s in %s\n"; |
219 | - | |
219 | + | |
220 | 220 | if (!port) { |
221 | 221 | printk(badinfo, name, routine); |
222 | 222 | return 1; |
223 | 223 | |
... | ... | @@ -231,9 +231,9 @@ |
231 | 231 | |
232 | 232 | |
233 | 233 | /* |
234 | - * | |
234 | + * | |
235 | 235 | * Service functions for specialix IO8+ driver. |
236 | - * | |
236 | + * | |
237 | 237 | */ |
238 | 238 | |
239 | 239 | /* Get board number from pointer */ |
... | ... | @@ -246,7 +246,7 @@ |
246 | 246 | /* Get port number from pointer */ |
247 | 247 | static inline int port_No (struct specialix_port const * port) |
248 | 248 | { |
249 | - return SX_PORT(port - sx_port); | |
249 | + return SX_PORT(port - sx_port); | |
250 | 250 | } |
251 | 251 | |
252 | 252 | |
... | ... | @@ -309,7 +309,7 @@ |
309 | 309 | return; |
310 | 310 | udelay (1); |
311 | 311 | } |
312 | - | |
312 | + | |
313 | 313 | printk(KERN_ERR "sx%d: Timeout waiting for CCR.\n", board_No(bp)); |
314 | 314 | } |
315 | 315 | |
... | ... | @@ -329,7 +329,7 @@ |
329 | 329 | return; |
330 | 330 | udelay (1); |
331 | 331 | } |
332 | - | |
332 | + | |
333 | 333 | printk(KERN_ERR "sx%d: Timeout waiting for CCR.\n", board_No(bp)); |
334 | 334 | } |
335 | 335 | |
336 | 336 | |
337 | 337 | |
338 | 338 | |
339 | 339 | |
340 | 340 | |
341 | 341 | |
... | ... | @@ -338,34 +338,28 @@ |
338 | 338 | * specialix IO8+ IO range functions. |
339 | 339 | */ |
340 | 340 | |
341 | -static inline int sx_check_io_range(struct specialix_board * bp) | |
341 | +static inline int sx_request_io_range(struct specialix_board * bp) | |
342 | 342 | { |
343 | - return check_region (bp->base, SX_IO_SPACE); | |
343 | + return request_region(bp->base, | |
344 | + bp->flags & SX_BOARD_IS_PCI ? SX_PCI_IO_SPACE : SX_IO_SPACE, | |
345 | + "specialix IO8+") == NULL; | |
344 | 346 | } |
345 | 347 | |
346 | 348 | |
347 | -static inline void sx_request_io_range(struct specialix_board * bp) | |
348 | -{ | |
349 | - request_region(bp->base, | |
350 | - bp->flags&SX_BOARD_IS_PCI?SX_PCI_IO_SPACE:SX_IO_SPACE, | |
351 | - "specialix IO8+" ); | |
352 | -} | |
353 | - | |
354 | - | |
355 | 349 | static inline void sx_release_io_range(struct specialix_board * bp) |
356 | 350 | { |
357 | - release_region(bp->base, | |
351 | + release_region(bp->base, | |
358 | 352 | bp->flags&SX_BOARD_IS_PCI?SX_PCI_IO_SPACE:SX_IO_SPACE); |
359 | 353 | } |
360 | 354 | |
361 | - | |
355 | + | |
362 | 356 | /* Must be called with enabled interrupts */ |
363 | -/* Ugly. Very ugly. Don't use this for anything else than initialization | |
357 | +/* Ugly. Very ugly. Don't use this for anything else than initialization | |
364 | 358 | code */ |
365 | 359 | static inline void sx_long_delay(unsigned long delay) |
366 | 360 | { |
367 | 361 | unsigned long i; |
368 | - | |
362 | + | |
369 | 363 | for (i = jiffies + delay; time_after(i, jiffies); ) ; |
370 | 364 | } |
371 | 365 | |
... | ... | @@ -378,7 +372,7 @@ |
378 | 372 | int i; |
379 | 373 | unsigned long flags; |
380 | 374 | |
381 | - if (bp->flags & SX_BOARD_IS_PCI) | |
375 | + if (bp->flags & SX_BOARD_IS_PCI) | |
382 | 376 | return 1; |
383 | 377 | switch (bp->irq) { |
384 | 378 | /* In the same order as in the docs... */ |
... | ... | @@ -420,7 +414,7 @@ |
420 | 414 | sx_out_off(bp, CD186x_PILR3, SX_ACK_RINT); /* Prio for receiver intr */ |
421 | 415 | /* Set RegAckEn */ |
422 | 416 | sx_out_off(bp, CD186x_SRCR, sx_in (bp, CD186x_SRCR) | SRCR_REGACKEN); |
423 | - | |
417 | + | |
424 | 418 | /* Setting up prescaler. We need 4 ticks per 1 ms */ |
425 | 419 | scaler = SX_OSCFREQ/SPECIALIX_TPS; |
426 | 420 | |
... | ... | @@ -448,7 +442,7 @@ |
448 | 442 | spin_lock_irqsave(&bp->lock, flags); |
449 | 443 | for (i=0, t=0;i<8;i++) { |
450 | 444 | sx_out_off (bp, CD186x_CAR, i); |
451 | - if (sx_in_off (bp, reg) & bit) | |
445 | + if (sx_in_off (bp, reg) & bit) | |
452 | 446 | t |= 1 << i; |
453 | 447 | } |
454 | 448 | spin_unlock_irqrestore(&bp->lock, flags); |
... | ... | @@ -472,7 +466,7 @@ |
472 | 466 | spin_unlock_irqrestore(&bp->lock, flags); |
473 | 467 | if (irq) { |
474 | 468 | printk (KERN_INFO "Missed interrupt... Calling int from timer. \n"); |
475 | - sx_interrupt (((struct specialix_board *)data)->irq, | |
469 | + sx_interrupt (((struct specialix_board *)data)->irq, | |
476 | 470 | (void*)data, NULL); |
477 | 471 | } |
478 | 472 | missed_irq_timer.expires = jiffies + sx_poll; |
... | ... | @@ -495,7 +489,7 @@ |
495 | 489 | |
496 | 490 | func_enter(); |
497 | 491 | |
498 | - if (sx_check_io_range(bp)) { | |
492 | + if (sx_request_io_range(bp)) { | |
499 | 493 | func_exit(); |
500 | 494 | return 1; |
501 | 495 | } |
502 | 496 | |
503 | 497 | |
... | ... | @@ -509,15 +503,16 @@ |
509 | 503 | short_pause (); |
510 | 504 | val2 = sx_in_off(bp, CD186x_PPRL); |
511 | 505 | |
512 | - | |
506 | + | |
513 | 507 | if ((val1 != 0x5a) || (val2 != 0xa5)) { |
514 | 508 | printk(KERN_INFO "sx%d: specialix IO8+ Board at 0x%03x not found.\n", |
515 | 509 | board_No(bp), bp->base); |
510 | + sx_release_io_range(bp); | |
516 | 511 | func_exit(); |
517 | 512 | return 1; |
518 | 513 | } |
519 | 514 | |
520 | - /* Check the DSR lines that Specialix uses as board | |
515 | + /* Check the DSR lines that Specialix uses as board | |
521 | 516 | identification */ |
522 | 517 | val1 = read_cross_byte (bp, CD186x_MSVR, MSVR_DSR); |
523 | 518 | val2 = read_cross_byte (bp, CD186x_MSVR, MSVR_RTS); |
... | ... | @@ -532,6 +527,7 @@ |
532 | 527 | if (val1 != val2) { |
533 | 528 | printk(KERN_INFO "sx%d: specialix IO8+ ID %02x at 0x%03x not found (%02x).\n", |
534 | 529 | board_No(bp), val2, bp->base, val1); |
530 | + sx_release_io_range(bp); | |
535 | 531 | func_exit(); |
536 | 532 | return 1; |
537 | 533 | } |
... | ... | @@ -546,7 +542,7 @@ |
546 | 542 | sx_wait_CCR(bp); |
547 | 543 | sx_out(bp, CD186x_CCR, CCR_TXEN); /* Enable transmitter */ |
548 | 544 | sx_out(bp, CD186x_IER, IER_TXRDY); /* Enable tx empty intr */ |
549 | - sx_long_delay(HZ/20); | |
545 | + sx_long_delay(HZ/20); | |
550 | 546 | irqs = probe_irq_off(irqs); |
551 | 547 | |
552 | 548 | dprintk (SX_DEBUG_INIT, "SRSR = %02x, ", sx_in(bp, CD186x_SRSR)); |
553 | 549 | |
554 | 550 | |
... | ... | @@ -561,14 +557,15 @@ |
561 | 557 | } |
562 | 558 | |
563 | 559 | dprintk (SX_DEBUG_INIT "val1 = %02x, val2 = %02x, val3 = %02x.\n", |
564 | - val1, val2, val3); | |
565 | - | |
560 | + val1, val2, val3); | |
561 | + | |
566 | 562 | } |
567 | - | |
563 | + | |
568 | 564 | #if 0 |
569 | 565 | if (irqs <= 0) { |
570 | 566 | printk(KERN_ERR "sx%d: Can't find IRQ for specialix IO8+ board at 0x%03x.\n", |
571 | 567 | board_No(bp), bp->base); |
568 | + sx_release_io_range(bp); | |
572 | 569 | func_exit(); |
573 | 570 | return 1; |
574 | 571 | } |
575 | 572 | |
576 | 573 | |
577 | 574 | |
... | ... | @@ -579,19 +576,20 @@ |
579 | 576 | #endif |
580 | 577 | /* Reset CD186x again */ |
581 | 578 | if (!sx_init_CD186x(bp)) { |
579 | + sx_release_io_range(bp); | |
582 | 580 | func_exit(); |
583 | - return -EIO; | |
581 | + return 1; | |
584 | 582 | } |
585 | 583 | |
586 | 584 | sx_request_io_range(bp); |
587 | 585 | bp->flags |= SX_BOARD_PRESENT; |
588 | - | |
586 | + | |
589 | 587 | /* Chip revcode pkgtype |
590 | 588 | GFRCR SRCR bit 7 |
591 | 589 | CD180 rev B 0x81 0 |
592 | 590 | CD180 rev C 0x82 0 |
593 | 591 | CD1864 rev A 0x82 1 |
594 | - CD1865 rev A 0x83 1 -- Do not use!!! Does not work. | |
592 | + CD1865 rev A 0x83 1 -- Do not use!!! Does not work. | |
595 | 593 | CD1865 rev B 0x84 1 |
596 | 594 | -- Thanks to Gwen Wang, Cirrus Logic. |
597 | 595 | */ |
... | ... | @@ -623,8 +621,8 @@ |
623 | 621 | return 0; |
624 | 622 | } |
625 | 623 | |
626 | -/* | |
627 | - * | |
624 | +/* | |
625 | + * | |
628 | 626 | * Interrupt processing routines. |
629 | 627 | * */ |
630 | 628 | |
... | ... | @@ -657,7 +655,7 @@ |
657 | 655 | return port; |
658 | 656 | } |
659 | 657 | } |
660 | - printk(KERN_INFO "sx%d: %s interrupt from invalid port %d\n", | |
658 | + printk(KERN_INFO "sx%d: %s interrupt from invalid port %d\n", | |
661 | 659 | board_No(bp), what, channel); |
662 | 660 | return NULL; |
663 | 661 | } |
... | ... | @@ -681,7 +679,7 @@ |
681 | 679 | tty = port->tty; |
682 | 680 | dprintk (SX_DEBUG_RX, "port: %p count: %d BUFF_SIZE: %d\n", |
683 | 681 | port, tty->flip.count, TTY_FLIPBUF_SIZE); |
684 | - | |
682 | + | |
685 | 683 | status = sx_in(bp, CD186x_RCSR); |
686 | 684 | |
687 | 685 | dprintk (SX_DEBUG_RX, "status: 0x%x\n", status); |
688 | 686 | |
689 | 687 | |
690 | 688 | |
691 | 689 | |
692 | 690 | |
693 | 691 | |
... | ... | @@ -707,30 +705,30 @@ |
707 | 705 | return; |
708 | 706 | } |
709 | 707 | if (status & RCSR_TOUT) { |
710 | - printk(KERN_INFO "sx%d: port %d: Receiver timeout. Hardware problems ?\n", | |
708 | + printk(KERN_INFO "sx%d: port %d: Receiver timeout. Hardware problems ?\n", | |
711 | 709 | board_No(bp), port_No(port)); |
712 | 710 | func_exit(); |
713 | 711 | return; |
714 | - | |
712 | + | |
715 | 713 | } else if (status & RCSR_BREAK) { |
716 | 714 | dprintk(SX_DEBUG_RX, "sx%d: port %d: Handling break...\n", |
717 | 715 | board_No(bp), port_No(port)); |
718 | 716 | *tty->flip.flag_buf_ptr++ = TTY_BREAK; |
719 | 717 | if (port->flags & ASYNC_SAK) |
720 | 718 | do_SAK(tty); |
721 | - | |
722 | - } else if (status & RCSR_PE) | |
719 | + | |
720 | + } else if (status & RCSR_PE) | |
723 | 721 | *tty->flip.flag_buf_ptr++ = TTY_PARITY; |
724 | - | |
725 | - else if (status & RCSR_FE) | |
722 | + | |
723 | + else if (status & RCSR_FE) | |
726 | 724 | *tty->flip.flag_buf_ptr++ = TTY_FRAME; |
727 | - | |
725 | + | |
728 | 726 | else if (status & RCSR_OE) |
729 | 727 | *tty->flip.flag_buf_ptr++ = TTY_OVERRUN; |
730 | - | |
728 | + | |
731 | 729 | else |
732 | 730 | *tty->flip.flag_buf_ptr++ = 0; |
733 | - | |
731 | + | |
734 | 732 | *tty->flip.char_buf_ptr++ = ch; |
735 | 733 | tty->flip.count++; |
736 | 734 | schedule_delayed_work(&tty->flip.work, 1); |
737 | 735 | |
738 | 736 | |
... | ... | @@ -746,18 +744,18 @@ |
746 | 744 | unsigned char count; |
747 | 745 | |
748 | 746 | func_enter(); |
749 | - | |
747 | + | |
750 | 748 | if (!(port = sx_get_port(bp, "Receive"))) { |
751 | 749 | dprintk (SX_DEBUG_RX, "Hmm, couldn't find port.\n"); |
752 | 750 | func_exit(); |
753 | 751 | return; |
754 | 752 | } |
755 | 753 | tty = port->tty; |
756 | - | |
754 | + | |
757 | 755 | count = sx_in(bp, CD186x_RDCR); |
758 | 756 | dprintk (SX_DEBUG_RX, "port: %p: count: %d\n", port, count); |
759 | 757 | port->hits[count > 8 ? 9 : count]++; |
760 | - | |
758 | + | |
761 | 759 | while (count--) { |
762 | 760 | if (tty->flip.count >= TTY_FLIPBUF_SIZE) { |
763 | 761 | printk(KERN_INFO "sx%d: port %d: Working around flip buffer overflow.\n", |
... | ... | @@ -787,7 +785,7 @@ |
787 | 785 | } |
788 | 786 | dprintk (SX_DEBUG_TX, "port: %p\n", port); |
789 | 787 | tty = port->tty; |
790 | - | |
788 | + | |
791 | 789 | if (port->IER & IER_TXEMPTY) { |
792 | 790 | /* FIFO drained */ |
793 | 791 | sx_out(bp, CD186x_CAR, port_No(port)); |
... | ... | @@ -796,7 +794,7 @@ |
796 | 794 | func_exit(); |
797 | 795 | return; |
798 | 796 | } |
799 | - | |
797 | + | |
800 | 798 | if ((port->xmit_cnt <= 0 && !port->break_length) |
801 | 799 | || tty->stopped || tty->hw_stopped) { |
802 | 800 | sx_out(bp, CD186x_CAR, port_No(port)); |
... | ... | @@ -805,7 +803,7 @@ |
805 | 803 | func_exit(); |
806 | 804 | return; |
807 | 805 | } |
808 | - | |
806 | + | |
809 | 807 | if (port->break_length) { |
810 | 808 | if (port->break_length > 0) { |
811 | 809 | if (port->COR2 & COR2_ETC) { |
... | ... | @@ -831,7 +829,7 @@ |
831 | 829 | func_exit(); |
832 | 830 | return; |
833 | 831 | } |
834 | - | |
832 | + | |
835 | 833 | count = CD186x_NFIFO; |
836 | 834 | do { |
837 | 835 | sx_out(bp, CD186x_TDR, port->xmit_buf[port->xmit_tail++]); |
... | ... | @@ -839,7 +837,7 @@ |
839 | 837 | if (--port->xmit_cnt <= 0) |
840 | 838 | break; |
841 | 839 | } while (--count > 0); |
842 | - | |
840 | + | |
843 | 841 | if (port->xmit_cnt <= 0) { |
844 | 842 | sx_out(bp, CD186x_CAR, port_No(port)); |
845 | 843 | port->IER &= ~IER_TXRDY; |
846 | 844 | |
... | ... | @@ -862,9 +860,9 @@ |
862 | 860 | dprintk (SX_DEBUG_SIGNALS, "Modem intr. "); |
863 | 861 | if (!(port = sx_get_port(bp, "Modem"))) |
864 | 862 | return; |
865 | - | |
863 | + | |
866 | 864 | tty = port->tty; |
867 | - | |
865 | + | |
868 | 866 | mcr = sx_in(bp, CD186x_MCR); |
869 | 867 | printk ("mcr = %02x.\n", mcr); |
870 | 868 | |
... | ... | @@ -879,7 +877,7 @@ |
879 | 877 | schedule_work(&port->tqueue_hangup); |
880 | 878 | } |
881 | 879 | } |
882 | - | |
880 | + | |
883 | 881 | #ifdef SPECIALIX_BRAIN_DAMAGED_CTS |
884 | 882 | if (mcr & MCR_CTSCHG) { |
885 | 883 | if (sx_in(bp, CD186x_MSVR) & MSVR_CTS) { |
... | ... | @@ -906,7 +904,7 @@ |
906 | 904 | sx_out(bp, CD186x_IER, port->IER); |
907 | 905 | } |
908 | 906 | #endif /* SPECIALIX_BRAIN_DAMAGED_CTS */ |
909 | - | |
907 | + | |
910 | 908 | /* Clear change bits */ |
911 | 909 | sx_out(bp, CD186x_MCR, 0); |
912 | 910 | } |
... | ... | @@ -940,7 +938,7 @@ |
940 | 938 | while ((++loop < 16) && (status = (sx_in(bp, CD186x_SRSR) & |
941 | 939 | (SRSR_RREQint | |
942 | 940 | SRSR_TREQint | |
943 | - SRSR_MREQint)))) { | |
941 | + SRSR_MREQint)))) { | |
944 | 942 | if (status & SRSR_RREQint) { |
945 | 943 | ack = sx_in(bp, CD186x_RRAR); |
946 | 944 | |
... | ... | @@ -951,7 +949,7 @@ |
951 | 949 | else |
952 | 950 | printk(KERN_ERR "sx%d: status: 0x%x Bad receive ack 0x%02x.\n", |
953 | 951 | board_No(bp), status, ack); |
954 | - | |
952 | + | |
955 | 953 | } else if (status & SRSR_TREQint) { |
956 | 954 | ack = sx_in(bp, CD186x_TRAR); |
957 | 955 | |
958 | 956 | |
959 | 957 | |
... | ... | @@ -963,14 +961,14 @@ |
963 | 961 | } else if (status & SRSR_MREQint) { |
964 | 962 | ack = sx_in(bp, CD186x_MRAR); |
965 | 963 | |
966 | - if (ack == (SX_ID | GIVR_IT_MODEM)) | |
964 | + if (ack == (SX_ID | GIVR_IT_MODEM)) | |
967 | 965 | sx_check_modem(bp); |
968 | 966 | else |
969 | 967 | printk(KERN_ERR "sx%d: status: 0x%x Bad modem ack 0x%02x.\n", |
970 | 968 | board_No(bp), status, ack); |
971 | - | |
972 | - } | |
973 | 969 | |
970 | + } | |
971 | + | |
974 | 972 | sx_out(bp, CD186x_EOIR, 0); /* Mark end of interrupt */ |
975 | 973 | } |
976 | 974 | bp->reg = saved_reg; |
... | ... | @@ -1026,7 +1024,7 @@ |
1026 | 1024 | { |
1027 | 1025 | int error; |
1028 | 1026 | |
1029 | - if (bp->flags & SX_BOARD_ACTIVE) | |
1027 | + if (bp->flags & SX_BOARD_ACTIVE) | |
1030 | 1028 | return 0; |
1031 | 1029 | |
1032 | 1030 | if (bp->flags & SX_BOARD_IS_PCI) |
... | ... | @@ -1034,7 +1032,7 @@ |
1034 | 1032 | else |
1035 | 1033 | error = request_irq(bp->irq, sx_interrupt, SA_INTERRUPT, "specialix IO8+", bp); |
1036 | 1034 | |
1037 | - if (error) | |
1035 | + if (error) | |
1038 | 1036 | return error; |
1039 | 1037 | |
1040 | 1038 | turn_ints_on (bp); |
... | ... | @@ -1055,7 +1053,7 @@ |
1055 | 1053 | } |
1056 | 1054 | |
1057 | 1055 | bp->flags &= ~SX_BOARD_ACTIVE; |
1058 | - | |
1056 | + | |
1059 | 1057 | dprintk (SX_DEBUG_IRQ, "Freeing IRQ%d for board %d.\n", |
1060 | 1058 | bp->irq, board_No (bp)); |
1061 | 1059 | free_irq(bp->irq, bp); |
... | ... | @@ -1068,7 +1066,7 @@ |
1068 | 1066 | |
1069 | 1067 | |
1070 | 1068 | /* |
1071 | - * Setting up port characteristics. | |
1069 | + * Setting up port characteristics. | |
1072 | 1070 | * Must be called with disabled interrupts |
1073 | 1071 | */ |
1074 | 1072 | static void sx_change_speed(struct specialix_board *bp, struct specialix_port *port) |
1075 | 1073 | |
... | ... | @@ -1103,10 +1101,10 @@ |
1103 | 1101 | spin_unlock_irqrestore(&bp->lock, flags); |
1104 | 1102 | dprintk (SX_DEBUG_TERMIOS, "sx: got MSVR=%02x.\n", port->MSVR); |
1105 | 1103 | baud = C_BAUD(tty); |
1106 | - | |
1104 | + | |
1107 | 1105 | if (baud & CBAUDEX) { |
1108 | 1106 | baud &= ~CBAUDEX; |
1109 | - if (baud < 1 || baud > 2) | |
1107 | + if (baud < 1 || baud > 2) | |
1110 | 1108 | port->tty->termios->c_cflag &= ~CBAUDEX; |
1111 | 1109 | else |
1112 | 1110 | baud += 15; |
... | ... | @@ -1117,8 +1115,8 @@ |
1117 | 1115 | if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI) |
1118 | 1116 | baud += 2; |
1119 | 1117 | } |
1120 | - | |
1121 | - | |
1118 | + | |
1119 | + | |
1122 | 1120 | if (!baud_table[baud]) { |
1123 | 1121 | /* Drop DTR & exit */ |
1124 | 1122 | dprintk (SX_DEBUG_TERMIOS, "Dropping DTR... Hmm....\n"); |
... | ... | @@ -1127,7 +1125,7 @@ |
1127 | 1125 | spin_lock_irqsave(&bp->lock, flags); |
1128 | 1126 | sx_out(bp, CD186x_MSVR, port->MSVR ); |
1129 | 1127 | spin_unlock_irqrestore(&bp->lock, flags); |
1130 | - } | |
1128 | + } | |
1131 | 1129 | else |
1132 | 1130 | dprintk (SX_DEBUG_TERMIOS, "Can't drop DTR: no DTR.\n"); |
1133 | 1131 | return; |
1134 | 1132 | |
... | ... | @@ -1137,9 +1135,9 @@ |
1137 | 1135 | port ->MSVR |= MSVR_DTR; |
1138 | 1136 | } |
1139 | 1137 | } |
1140 | - | |
1138 | + | |
1141 | 1139 | /* |
1142 | - * Now we must calculate some speed depended things | |
1140 | + * Now we must calculate some speed depended things | |
1143 | 1141 | */ |
1144 | 1142 | |
1145 | 1143 | /* Set baud rate for port */ |
... | ... | @@ -1152,7 +1150,7 @@ |
1152 | 1150 | tmp = (((SX_OSCFREQ + baud_table[baud]/2) / baud_table[baud] + |
1153 | 1151 | CD186x_TPC/2) / CD186x_TPC); |
1154 | 1152 | |
1155 | - if ((tmp < 0x10) && time_before(again, jiffies)) { | |
1153 | + if ((tmp < 0x10) && time_before(again, jiffies)) { | |
1156 | 1154 | again = jiffies + HZ * 60; |
1157 | 1155 | /* Page 48 of version 2.0 of the CL-CD1865 databook */ |
1158 | 1156 | if (tmp >= 12) { |
1159 | 1157 | |
1160 | 1158 | |
1161 | 1159 | |
1162 | 1160 | |
... | ... | @@ -1164,27 +1162,27 @@ |
1164 | 1162 | printk (KERN_INFO "sx%d: Baud rate divisor is %ld. \n" |
1165 | 1163 | "Warning: overstressing Cirrus chip. " |
1166 | 1164 | "This might not work.\n" |
1167 | - "Read specialix.txt for more info.\n", | |
1165 | + "Read specialix.txt for more info.\n", | |
1168 | 1166 | port_No (port), tmp); |
1169 | 1167 | } |
1170 | 1168 | } |
1171 | 1169 | spin_lock_irqsave(&bp->lock, flags); |
1172 | - sx_out(bp, CD186x_RBPRH, (tmp >> 8) & 0xff); | |
1173 | - sx_out(bp, CD186x_TBPRH, (tmp >> 8) & 0xff); | |
1174 | - sx_out(bp, CD186x_RBPRL, tmp & 0xff); | |
1170 | + sx_out(bp, CD186x_RBPRH, (tmp >> 8) & 0xff); | |
1171 | + sx_out(bp, CD186x_TBPRH, (tmp >> 8) & 0xff); | |
1172 | + sx_out(bp, CD186x_RBPRL, tmp & 0xff); | |
1175 | 1173 | sx_out(bp, CD186x_TBPRL, tmp & 0xff); |
1176 | 1174 | spin_unlock_irqrestore(&bp->lock, flags); |
1177 | 1175 | if (port->custom_divisor) { |
1178 | 1176 | baud = (SX_OSCFREQ + port->custom_divisor/2) / port->custom_divisor; |
1179 | 1177 | baud = ( baud + 5 ) / 10; |
1180 | - } else | |
1178 | + } else | |
1181 | 1179 | baud = (baud_table[baud] + 5) / 10; /* Estimated CPS */ |
1182 | 1180 | |
1183 | 1181 | /* Two timer ticks seems enough to wakeup something like SLIP driver */ |
1184 | - tmp = ((baud + HZ/2) / HZ) * 2 - CD186x_NFIFO; | |
1182 | + tmp = ((baud + HZ/2) / HZ) * 2 - CD186x_NFIFO; | |
1185 | 1183 | port->wakeup_chars = (tmp < 0) ? 0 : ((tmp >= SERIAL_XMIT_SIZE) ? |
1186 | 1184 | SERIAL_XMIT_SIZE - 1 : tmp); |
1187 | - | |
1185 | + | |
1188 | 1186 | /* Receiver timeout will be transmission time for 1.5 chars */ |
1189 | 1187 | tmp = (SPECIALIX_TPS + SPECIALIX_TPS/2 + baud/2) / baud; |
1190 | 1188 | tmp = (tmp > 0xff) ? 0xff : tmp; |
1191 | 1189 | |
1192 | 1190 | |
1193 | 1191 | |
1194 | 1192 | |
1195 | 1193 | |
1196 | 1194 | |
1197 | 1195 | |
... | ... | @@ -1205,29 +1203,29 @@ |
1205 | 1203 | cor1 |= COR1_8BITS; |
1206 | 1204 | break; |
1207 | 1205 | } |
1208 | - | |
1209 | - if (C_CSTOPB(tty)) | |
1206 | + | |
1207 | + if (C_CSTOPB(tty)) | |
1210 | 1208 | cor1 |= COR1_2SB; |
1211 | - | |
1209 | + | |
1212 | 1210 | cor1 |= COR1_IGNORE; |
1213 | 1211 | if (C_PARENB(tty)) { |
1214 | 1212 | cor1 |= COR1_NORMPAR; |
1215 | - if (C_PARODD(tty)) | |
1213 | + if (C_PARODD(tty)) | |
1216 | 1214 | cor1 |= COR1_ODDP; |
1217 | - if (I_INPCK(tty)) | |
1215 | + if (I_INPCK(tty)) | |
1218 | 1216 | cor1 &= ~COR1_IGNORE; |
1219 | 1217 | } |
1220 | 1218 | /* Set marking of some errors */ |
1221 | 1219 | port->mark_mask = RCSR_OE | RCSR_TOUT; |
1222 | - if (I_INPCK(tty)) | |
1220 | + if (I_INPCK(tty)) | |
1223 | 1221 | port->mark_mask |= RCSR_FE | RCSR_PE; |
1224 | - if (I_BRKINT(tty) || I_PARMRK(tty)) | |
1222 | + if (I_BRKINT(tty) || I_PARMRK(tty)) | |
1225 | 1223 | port->mark_mask |= RCSR_BREAK; |
1226 | - if (I_IGNPAR(tty)) | |
1224 | + if (I_IGNPAR(tty)) | |
1227 | 1225 | port->mark_mask &= ~(RCSR_FE | RCSR_PE); |
1228 | 1226 | if (I_IGNBRK(tty)) { |
1229 | 1227 | port->mark_mask &= ~RCSR_BREAK; |
1230 | - if (I_IGNPAR(tty)) | |
1228 | + if (I_IGNPAR(tty)) | |
1231 | 1229 | /* Real raw mode. Ignore all */ |
1232 | 1230 | port->mark_mask &= ~RCSR_OE; |
1233 | 1231 | } |
... | ... | @@ -1241,7 +1239,7 @@ |
1241 | 1239 | tty->hw_stopped = !(sx_in(bp, CD186x_MSVR) & (MSVR_CTS|MSVR_DSR)); |
1242 | 1240 | spin_unlock_irqrestore(&bp->lock, flags); |
1243 | 1241 | #else |
1244 | - port->COR2 |= COR2_CTSAE; | |
1242 | + port->COR2 |= COR2_CTSAE; | |
1245 | 1243 | #endif |
1246 | 1244 | } |
1247 | 1245 | /* Enable Software Flow Control. FIXME: I'm not sure about this */ |
1248 | 1246 | |
... | ... | @@ -1264,11 +1262,11 @@ |
1264 | 1262 | mcor1 |= MCOR1_CDZD; |
1265 | 1263 | mcor2 |= MCOR2_CDOD; |
1266 | 1264 | } |
1267 | - | |
1268 | - if (C_CREAD(tty)) | |
1265 | + | |
1266 | + if (C_CREAD(tty)) | |
1269 | 1267 | /* Enable receiver */ |
1270 | 1268 | port->IER |= IER_RXD; |
1271 | - | |
1269 | + | |
1272 | 1270 | /* Set input FIFO size (1-8 bytes) */ |
1273 | 1271 | cor3 |= sx_rxfifo; |
1274 | 1272 | /* Setting up CD186x channel registers */ |
1275 | 1273 | |
... | ... | @@ -1311,11 +1309,11 @@ |
1311 | 1309 | func_exit(); |
1312 | 1310 | return 0; |
1313 | 1311 | } |
1314 | - | |
1312 | + | |
1315 | 1313 | if (!port->xmit_buf) { |
1316 | 1314 | /* We may sleep in get_zeroed_page() */ |
1317 | 1315 | unsigned long tmp; |
1318 | - | |
1316 | + | |
1319 | 1317 | if (!(tmp = get_zeroed_page(GFP_KERNEL))) { |
1320 | 1318 | func_exit(); |
1321 | 1319 | return -ENOMEM; |
1322 | 1320 | |
... | ... | @@ -1328,10 +1326,10 @@ |
1328 | 1326 | } |
1329 | 1327 | port->xmit_buf = (unsigned char *) tmp; |
1330 | 1328 | } |
1331 | - | |
1329 | + | |
1332 | 1330 | spin_lock_irqsave(&port->lock, flags); |
1333 | 1331 | |
1334 | - if (port->tty) | |
1332 | + if (port->tty) | |
1335 | 1333 | clear_bit(TTY_IO_ERROR, &port->tty->flags); |
1336 | 1334 | |
1337 | 1335 | port->xmit_cnt = port->xmit_head = port->xmit_tail = 0; |
... | ... | @@ -1340,7 +1338,7 @@ |
1340 | 1338 | |
1341 | 1339 | spin_unlock_irqrestore(&port->lock, flags); |
1342 | 1340 | |
1343 | - | |
1341 | + | |
1344 | 1342 | func_exit(); |
1345 | 1343 | return 0; |
1346 | 1344 | } |
1347 | 1345 | |
... | ... | @@ -1352,14 +1350,14 @@ |
1352 | 1350 | struct tty_struct *tty; |
1353 | 1351 | int i; |
1354 | 1352 | unsigned long flags; |
1355 | - | |
1353 | + | |
1356 | 1354 | func_enter(); |
1357 | 1355 | |
1358 | 1356 | if (!(port->flags & ASYNC_INITIALIZED)) { |
1359 | 1357 | func_exit(); |
1360 | 1358 | return; |
1361 | 1359 | } |
1362 | - | |
1360 | + | |
1363 | 1361 | if (sx_debug & SX_DEBUG_FIFO) { |
1364 | 1362 | dprintk(SX_DEBUG_FIFO, "sx%d: port %d: %ld overruns, FIFO hits [ ", |
1365 | 1363 | board_No(bp), port_No(port), port->overrun); |
1366 | 1364 | |
... | ... | @@ -1394,13 +1392,13 @@ |
1394 | 1392 | if (tty) |
1395 | 1393 | set_bit(TTY_IO_ERROR, &tty->flags); |
1396 | 1394 | port->flags &= ~ASYNC_INITIALIZED; |
1397 | - | |
1398 | - if (!bp->count) | |
1395 | + | |
1396 | + if (!bp->count) | |
1399 | 1397 | sx_shutdown_board(bp); |
1400 | 1398 | func_exit(); |
1401 | 1399 | } |
1402 | 1400 | |
1403 | - | |
1401 | + | |
1404 | 1402 | static int block_til_ready(struct tty_struct *tty, struct file * filp, |
1405 | 1403 | struct specialix_port *port) |
1406 | 1404 | { |
... | ... | @@ -1427,7 +1425,7 @@ |
1427 | 1425 | return -ERESTARTSYS; |
1428 | 1426 | } |
1429 | 1427 | } |
1430 | - | |
1428 | + | |
1431 | 1429 | /* |
1432 | 1430 | * If non-blocking mode is set, or the port is not enabled, |
1433 | 1431 | * then make the check up front and then exit. |
... | ... | @@ -1477,7 +1475,7 @@ |
1477 | 1475 | if (port->flags & ASYNC_HUP_NOTIFY) |
1478 | 1476 | retval = -EAGAIN; |
1479 | 1477 | else |
1480 | - retval = -ERESTARTSYS; | |
1478 | + retval = -ERESTARTSYS; | |
1481 | 1479 | break; |
1482 | 1480 | } |
1483 | 1481 | if (!(port->flags & ASYNC_CLOSING) && |
... | ... | @@ -1506,7 +1504,7 @@ |
1506 | 1504 | port->flags |= ASYNC_NORMAL_ACTIVE; |
1507 | 1505 | func_exit(); |
1508 | 1506 | return 0; |
1509 | -} | |
1507 | +} | |
1510 | 1508 | |
1511 | 1509 | |
1512 | 1510 | static int sx_open(struct tty_struct * tty, struct file * filp) |
... | ... | @@ -1526,7 +1524,7 @@ |
1526 | 1524 | func_exit(); |
1527 | 1525 | return -ENODEV; |
1528 | 1526 | } |
1529 | - | |
1527 | + | |
1530 | 1528 | bp = &sx_board[board]; |
1531 | 1529 | port = sx_port + board * SX_NPORT + SX_PORT(tty->index); |
1532 | 1530 | port->overrun = 0; |
... | ... | @@ -1557,7 +1555,7 @@ |
1557 | 1555 | func_enter(); |
1558 | 1556 | return error; |
1559 | 1557 | } |
1560 | - | |
1558 | + | |
1561 | 1559 | if ((error = block_til_ready(tty, filp, port))) { |
1562 | 1560 | func_enter(); |
1563 | 1561 | return error; |
... | ... | @@ -1574,7 +1572,7 @@ |
1574 | 1572 | struct specialix_board *bp; |
1575 | 1573 | unsigned long flags; |
1576 | 1574 | unsigned long timeout; |
1577 | - | |
1575 | + | |
1578 | 1576 | func_enter(); |
1579 | 1577 | if (!port || sx_paranoia_check(port, tty->name, "close")) { |
1580 | 1578 | func_exit(); |
... | ... | @@ -1587,7 +1585,7 @@ |
1587 | 1585 | func_exit(); |
1588 | 1586 | return; |
1589 | 1587 | } |
1590 | - | |
1588 | + | |
1591 | 1589 | bp = port_Board(port); |
1592 | 1590 | if ((tty->count == 1) && (port->count != 1)) { |
1593 | 1591 | printk(KERN_ERR "sx%d: sx_close: bad port count;" |
... | ... | @@ -1607,7 +1605,7 @@ |
1607 | 1605 | } |
1608 | 1606 | port->flags |= ASYNC_CLOSING; |
1609 | 1607 | /* |
1610 | - * Now we wait for the transmit buffer to clear; and we notify | |
1608 | + * Now we wait for the transmit buffer to clear; and we notify | |
1611 | 1609 | * the line discipline to only process XON/XOFF characters. |
1612 | 1610 | */ |
1613 | 1611 | tty->closing = 1; |
... | ... | @@ -1681,7 +1679,7 @@ |
1681 | 1679 | } |
1682 | 1680 | |
1683 | 1681 | |
1684 | -static int sx_write(struct tty_struct * tty, | |
1682 | +static int sx_write(struct tty_struct * tty, | |
1685 | 1683 | const unsigned char *buf, int count) |
1686 | 1684 | { |
1687 | 1685 | struct specialix_port *port = (struct specialix_port *)tty->driver_data; |
... | ... | @@ -1694,7 +1692,7 @@ |
1694 | 1692 | func_exit(); |
1695 | 1693 | return 0; |
1696 | 1694 | } |
1697 | - | |
1695 | + | |
1698 | 1696 | bp = port_Board(port); |
1699 | 1697 | |
1700 | 1698 | if (!tty || !port->xmit_buf || !tmp_buf) { |
... | ... | @@ -1824,7 +1822,7 @@ |
1824 | 1822 | struct specialix_port *port = (struct specialix_port *)tty->driver_data; |
1825 | 1823 | |
1826 | 1824 | func_enter(); |
1827 | - | |
1825 | + | |
1828 | 1826 | if (sx_paranoia_check(port, tty->name, "sx_chars_in_buffer")) { |
1829 | 1827 | func_exit(); |
1830 | 1828 | return 0; |
1831 | 1829 | |
... | ... | @@ -1881,13 +1879,13 @@ |
1881 | 1879 | port_No(port), status, sx_in (bp, CD186x_CAR)); |
1882 | 1880 | dprintk (SX_DEBUG_INIT, "sx_port = %p, port = %p\n", sx_port, port); |
1883 | 1881 | if (SX_CRTSCTS(port->tty)) { |
1884 | - result = /* (status & MSVR_RTS) ? */ TIOCM_DTR /* : 0) */ | |
1882 | + result = /* (status & MSVR_RTS) ? */ TIOCM_DTR /* : 0) */ | |
1885 | 1883 | | ((status & MSVR_DTR) ? TIOCM_RTS : 0) |
1886 | 1884 | | ((status & MSVR_CD) ? TIOCM_CAR : 0) |
1887 | 1885 | |/* ((status & MSVR_DSR) ? */ TIOCM_DSR /* : 0) */ |
1888 | 1886 | | ((status & MSVR_CTS) ? TIOCM_CTS : 0); |
1889 | 1887 | } else { |
1890 | - result = /* (status & MSVR_RTS) ? */ TIOCM_RTS /* : 0) */ | |
1888 | + result = /* (status & MSVR_RTS) ? */ TIOCM_RTS /* : 0) */ | |
1891 | 1889 | | ((status & MSVR_DTR) ? TIOCM_DTR : 0) |
1892 | 1890 | | ((status & MSVR_CD) ? TIOCM_CAR : 0) |
1893 | 1891 | |/* ((status & MSVR_DSR) ? */ TIOCM_DSR /* : 0) */ |
... | ... | @@ -1955,7 +1953,7 @@ |
1955 | 1953 | { |
1956 | 1954 | struct specialix_board *bp = port_Board(port); |
1957 | 1955 | unsigned long flags; |
1958 | - | |
1956 | + | |
1959 | 1957 | func_enter(); |
1960 | 1958 | |
1961 | 1959 | spin_lock_irqsave (&port->lock, flags); |
... | ... | @@ -1996,8 +1994,8 @@ |
1996 | 1994 | func_enter(); |
1997 | 1995 | return -EFAULT; |
1998 | 1996 | } |
1999 | - | |
2000 | -#if 0 | |
1997 | + | |
1998 | +#if 0 | |
2001 | 1999 | if ((tmp.irq != bp->irq) || |
2002 | 2000 | (tmp.port != bp->base) || |
2003 | 2001 | (tmp.type != PORT_CIRRUS) || |
2004 | 2002 | |
... | ... | @@ -2008,12 +2006,12 @@ |
2008 | 2006 | func_exit(); |
2009 | 2007 | return -EINVAL; |
2010 | 2008 | } |
2011 | -#endif | |
2009 | +#endif | |
2012 | 2010 | |
2013 | 2011 | change_speed = ((port->flags & ASYNC_SPD_MASK) != |
2014 | 2012 | (tmp.flags & ASYNC_SPD_MASK)); |
2015 | 2013 | change_speed |= (tmp.custom_divisor != port->custom_divisor); |
2016 | - | |
2014 | + | |
2017 | 2015 | if (!capable(CAP_SYS_ADMIN)) { |
2018 | 2016 | if ((tmp.close_delay != port->close_delay) || |
2019 | 2017 | (tmp.closing_wait != port->closing_wait) || |
... | ... | @@ -2045,7 +2043,7 @@ |
2045 | 2043 | { |
2046 | 2044 | struct serial_struct tmp; |
2047 | 2045 | struct specialix_board *bp = port_Board(port); |
2048 | - | |
2046 | + | |
2049 | 2047 | func_enter(); |
2050 | 2048 | |
2051 | 2049 | /* |
... | ... | @@ -2074,7 +2072,7 @@ |
2074 | 2072 | } |
2075 | 2073 | |
2076 | 2074 | |
2077 | -static int sx_ioctl(struct tty_struct * tty, struct file * filp, | |
2075 | +static int sx_ioctl(struct tty_struct * tty, struct file * filp, | |
2078 | 2076 | unsigned int cmd, unsigned long arg) |
2079 | 2077 | { |
2080 | 2078 | struct specialix_port *port = (struct specialix_port *)tty->driver_data; |
... | ... | @@ -2087,7 +2085,7 @@ |
2087 | 2085 | func_exit(); |
2088 | 2086 | return -ENODEV; |
2089 | 2087 | } |
2090 | - | |
2088 | + | |
2091 | 2089 | switch (cmd) { |
2092 | 2090 | case TCSBRK: /* SVID version: non-zero arg --> no break */ |
2093 | 2091 | retval = tty_check_change(tty); |
... | ... | @@ -2129,7 +2127,7 @@ |
2129 | 2127 | case TIOCGSERIAL: |
2130 | 2128 | func_exit(); |
2131 | 2129 | return sx_get_serial_info(port, argp); |
2132 | - case TIOCSSERIAL: | |
2130 | + case TIOCSSERIAL: | |
2133 | 2131 | func_exit(); |
2134 | 2132 | return sx_set_serial_info(port, argp); |
2135 | 2133 | default: |
2136 | 2134 | |
2137 | 2135 | |
2138 | 2136 | |
... | ... | @@ -2153,16 +2151,16 @@ |
2153 | 2151 | func_exit(); |
2154 | 2152 | return; |
2155 | 2153 | } |
2156 | - | |
2154 | + | |
2157 | 2155 | bp = port_Board(port); |
2158 | - | |
2156 | + | |
2159 | 2157 | /* Use DTR instead of RTS ! */ |
2160 | - if (SX_CRTSCTS (tty)) | |
2158 | + if (SX_CRTSCTS (tty)) | |
2161 | 2159 | port->MSVR &= ~MSVR_DTR; |
2162 | 2160 | else { |
2163 | 2161 | /* Auch!!! I think the system shouldn't call this then. */ |
2164 | 2162 | /* Or maybe we're supposed (allowed?) to do our side of hw |
2165 | - handshake anyway, even when hardware handshake is off. | |
2163 | + handshake anyway, even when hardware handshake is off. | |
2166 | 2164 | When you see this in your logs, please report.... */ |
2167 | 2165 | printk (KERN_ERR "sx%d: Need to throttle, but can't (hardware hs is off)\n", |
2168 | 2166 | port_No (port)); |
2169 | 2167 | |
2170 | 2168 | |
... | ... | @@ -2193,14 +2191,14 @@ |
2193 | 2191 | unsigned long flags; |
2194 | 2192 | |
2195 | 2193 | func_enter(); |
2196 | - | |
2194 | + | |
2197 | 2195 | if (sx_paranoia_check(port, tty->name, "sx_unthrottle")) { |
2198 | 2196 | func_exit(); |
2199 | 2197 | return; |
2200 | 2198 | } |
2201 | - | |
2199 | + | |
2202 | 2200 | bp = port_Board(port); |
2203 | - | |
2201 | + | |
2204 | 2202 | spin_lock_irqsave(&port->lock, flags); |
2205 | 2203 | /* XXXX Use DTR INSTEAD???? */ |
2206 | 2204 | if (SX_CRTSCTS(tty)) { |
2207 | 2205 | |
... | ... | @@ -2234,14 +2232,14 @@ |
2234 | 2232 | unsigned long flags; |
2235 | 2233 | |
2236 | 2234 | func_enter(); |
2237 | - | |
2235 | + | |
2238 | 2236 | if (sx_paranoia_check(port, tty->name, "sx_stop")) { |
2239 | 2237 | func_exit(); |
2240 | 2238 | return; |
2241 | 2239 | } |
2242 | 2240 | |
2243 | 2241 | bp = port_Board(port); |
2244 | - | |
2242 | + | |
2245 | 2243 | spin_lock_irqsave(&port->lock, flags); |
2246 | 2244 | port->IER &= ~IER_TXRDY; |
2247 | 2245 | spin_lock_irqsave(&bp->lock, flags); |
2248 | 2246 | |
2249 | 2247 | |
... | ... | @@ -2261,14 +2259,14 @@ |
2261 | 2259 | unsigned long flags; |
2262 | 2260 | |
2263 | 2261 | func_enter(); |
2264 | - | |
2262 | + | |
2265 | 2263 | if (sx_paranoia_check(port, tty->name, "sx_start")) { |
2266 | 2264 | func_exit(); |
2267 | 2265 | return; |
2268 | 2266 | } |
2269 | - | |
2267 | + | |
2270 | 2268 | bp = port_Board(port); |
2271 | - | |
2269 | + | |
2272 | 2270 | spin_lock_irqsave(&port->lock, flags); |
2273 | 2271 | if (port->xmit_cnt && port->xmit_buf && !(port->IER & IER_TXRDY)) { |
2274 | 2272 | port->IER |= IER_TXRDY; |
2275 | 2273 | |
... | ... | @@ -2290,13 +2288,13 @@ |
2290 | 2288 | * |
2291 | 2289 | * serial interrupt routine -> (workqueue) -> |
2292 | 2290 | * do_sx_hangup() -> tty->hangup() -> sx_hangup() |
2293 | - * | |
2291 | + * | |
2294 | 2292 | */ |
2295 | 2293 | static void do_sx_hangup(void *private_) |
2296 | 2294 | { |
2297 | 2295 | struct specialix_port *port = (struct specialix_port *) private_; |
2298 | 2296 | struct tty_struct *tty; |
2299 | - | |
2297 | + | |
2300 | 2298 | func_enter(); |
2301 | 2299 | |
2302 | 2300 | tty = port->tty; |
2303 | 2301 | |
... | ... | @@ -2319,9 +2317,9 @@ |
2319 | 2317 | func_exit(); |
2320 | 2318 | return; |
2321 | 2319 | } |
2322 | - | |
2320 | + | |
2323 | 2321 | bp = port_Board(port); |
2324 | - | |
2322 | + | |
2325 | 2323 | sx_shutdown_port(bp, port); |
2326 | 2324 | spin_lock_irqsave(&port->lock, flags); |
2327 | 2325 | port->event = 0; |
2328 | 2326 | |
... | ... | @@ -2346,10 +2344,10 @@ |
2346 | 2344 | struct specialix_port *port = (struct specialix_port *)tty->driver_data; |
2347 | 2345 | unsigned long flags; |
2348 | 2346 | struct specialix_board * bp; |
2349 | - | |
2347 | + | |
2350 | 2348 | if (sx_paranoia_check(port, tty->name, "sx_set_termios")) |
2351 | 2349 | return; |
2352 | - | |
2350 | + | |
2353 | 2351 | if (tty->termios->c_cflag == old_termios->c_cflag && |
2354 | 2352 | tty->termios->c_iflag == old_termios->c_iflag) |
2355 | 2353 | return; |
... | ... | @@ -2420,7 +2418,7 @@ |
2420 | 2418 | func_exit(); |
2421 | 2419 | return 1; |
2422 | 2420 | } |
2423 | - | |
2421 | + | |
2424 | 2422 | if (!(tmp_buf = (unsigned char *) get_zeroed_page(GFP_KERNEL))) { |
2425 | 2423 | printk(KERN_ERR "sx: Couldn't get free page.\n"); |
2426 | 2424 | put_tty_driver(specialix_driver); |
... | ... | @@ -2457,7 +2455,7 @@ |
2457 | 2455 | init_waitqueue_head(&sx_port[i].close_wait); |
2458 | 2456 | spin_lock_init(&sx_port[i].lock); |
2459 | 2457 | } |
2460 | - | |
2458 | + | |
2461 | 2459 | func_exit(); |
2462 | 2460 | return 0; |
2463 | 2461 | } |
... | ... | @@ -2472,8 +2470,8 @@ |
2472 | 2470 | func_exit(); |
2473 | 2471 | } |
2474 | 2472 | |
2475 | -/* | |
2476 | - * This routine must be called by kernel at boot time | |
2473 | +/* | |
2474 | + * This routine must be called by kernel at boot time | |
2477 | 2475 | */ |
2478 | 2476 | static int __init specialix_init(void) |
2479 | 2477 | { |
... | ... | @@ -2489,7 +2487,7 @@ |
2489 | 2487 | #else |
2490 | 2488 | printk (KERN_INFO "sx: DTR/RTS pin is RTS when CRTSCTS is on.\n"); |
2491 | 2489 | #endif |
2492 | - | |
2490 | + | |
2493 | 2491 | for (i = 0; i < SX_NBOARD; i++) |
2494 | 2492 | sx_board[i].lock = SPIN_LOCK_UNLOCKED; |
2495 | 2493 | |
... | ... | @@ -2498,7 +2496,7 @@ |
2498 | 2496 | return -EIO; |
2499 | 2497 | } |
2500 | 2498 | |
2501 | - for (i = 0; i < SX_NBOARD; i++) | |
2499 | + for (i = 0; i < SX_NBOARD; i++) | |
2502 | 2500 | if (sx_board[i].base && !sx_probe(&sx_board[i])) |
2503 | 2501 | found++; |
2504 | 2502 | |
... | ... | @@ -2512,8 +2510,8 @@ |
2512 | 2510 | i++; |
2513 | 2511 | continue; |
2514 | 2512 | } |
2515 | - pdev = pci_find_device (PCI_VENDOR_ID_SPECIALIX, | |
2516 | - PCI_DEVICE_ID_SPECIALIX_IO8, | |
2513 | + pdev = pci_find_device (PCI_VENDOR_ID_SPECIALIX, | |
2514 | + PCI_DEVICE_ID_SPECIALIX_IO8, | |
2517 | 2515 | pdev); |
2518 | 2516 | if (!pdev) break; |
2519 | 2517 | |
2520 | 2518 | |
... | ... | @@ -2557,10 +2555,10 @@ |
2557 | 2555 | /* |
2558 | 2556 | * You can setup up to 4 boards. |
2559 | 2557 | * by specifying "iobase=0xXXX,0xXXX ..." as insmod parameter. |
2560 | - * You should specify the IRQs too in that case "irq=....,...". | |
2561 | - * | |
2558 | + * You should specify the IRQs too in that case "irq=....,...". | |
2559 | + * | |
2562 | 2560 | * More than 4 boards in one computer is not possible, as the card can |
2563 | - * only use 4 different interrupts. | |
2561 | + * only use 4 different interrupts. | |
2564 | 2562 | * |
2565 | 2563 | */ |
2566 | 2564 | static int __init specialix_init_module(void) |
2567 | 2565 | |
2568 | 2566 | |
... | ... | @@ -2583,16 +2581,16 @@ |
2583 | 2581 | |
2584 | 2582 | return specialix_init(); |
2585 | 2583 | } |
2586 | - | |
2584 | + | |
2587 | 2585 | static void __exit specialix_exit_module(void) |
2588 | 2586 | { |
2589 | 2587 | int i; |
2590 | - | |
2588 | + | |
2591 | 2589 | func_enter(); |
2592 | 2590 | |
2593 | 2591 | sx_release_drivers(); |
2594 | 2592 | for (i = 0; i < SX_NBOARD; i++) |
2595 | - if (sx_board[i].flags & SX_BOARD_PRESENT) | |
2593 | + if (sx_board[i].flags & SX_BOARD_PRESENT) | |
2596 | 2594 | sx_release_io_range(&sx_board[i]); |
2597 | 2595 | #ifdef SPECIALIX_TIMER |
2598 | 2596 | del_timer (&missed_irq_timer); |
drivers/net/eepro.c
... | ... | @@ -552,8 +552,7 @@ |
552 | 552 | { |
553 | 553 | unsigned short int WS[32]=WakeupSeq; |
554 | 554 | |
555 | - if (check_region(WakeupPort, 2)==0) { | |
556 | - | |
555 | + if (request_region(WakeupPort, 2, "eepro wakeup")) { | |
557 | 556 | if (net_debug>5) |
558 | 557 | printk(KERN_DEBUG "Waking UP\n"); |
559 | 558 | |
... | ... | @@ -563,7 +562,10 @@ |
563 | 562 | outb_p(WS[i],WakeupPort); |
564 | 563 | if (net_debug>5) printk(KERN_DEBUG ": %#x ",WS[i]); |
565 | 564 | } |
566 | - } else printk(KERN_WARNING "Checkregion Failed!\n"); | |
565 | + | |
566 | + release_region(WakeupPort, 2); | |
567 | + } else | |
568 | + printk(KERN_WARNING "PnP wakeup region busy!\n"); | |
567 | 569 | } |
568 | 570 | #endif |
569 | 571 | |
... | ... | @@ -705,7 +707,7 @@ |
705 | 707 | dev->name, (unsigned)dev->base_addr); |
706 | 708 | break; |
707 | 709 | case LAN595FX: |
708 | - printk("%s: Intel EtherExpress Pro/10+ ISA\n at %#x,", | |
710 | + printk("%s: Intel EtherExpress Pro/10+ ISA\n at %#x,", | |
709 | 711 | dev->name, (unsigned)dev->base_addr); |
710 | 712 | break; |
711 | 713 | case LAN595TX: |
... | ... | @@ -713,7 +715,7 @@ |
713 | 715 | dev->name, (unsigned)dev->base_addr); |
714 | 716 | break; |
715 | 717 | case LAN595: |
716 | - printk("%s: Intel 82595-based lan card at %#x,", | |
718 | + printk("%s: Intel 82595-based lan card at %#x,", | |
717 | 719 | dev->name, (unsigned)dev->base_addr); |
718 | 720 | } |
719 | 721 | |
... | ... | @@ -726,7 +728,7 @@ |
726 | 728 | |
727 | 729 | if (dev->irq > 2) |
728 | 730 | printk(", IRQ %d, %s.\n", dev->irq, ifmap[dev->if_port]); |
729 | - else | |
731 | + else | |
730 | 732 | printk(", %s.\n", ifmap[dev->if_port]); |
731 | 733 | |
732 | 734 | if (net_debug > 3) { |
... | ... | @@ -756,7 +758,7 @@ |
756 | 758 | int err; |
757 | 759 | |
758 | 760 | /* Grab the region so we can find another board if autoIRQ fails. */ |
759 | - if (!request_region(ioaddr, EEPRO_IO_EXTENT, DRV_NAME)) { | |
761 | + if (!request_region(ioaddr, EEPRO_IO_EXTENT, DRV_NAME)) { | |
760 | 762 | if (!autoprobe) |
761 | 763 | printk(KERN_WARNING "EEPRO: io-port 0x%04x in use \n", |
762 | 764 | ioaddr); |
763 | 765 | |
764 | 766 | |
765 | 767 | |
... | ... | @@ -838,15 +840,15 @@ |
838 | 840 | /* Mask off INT number */ |
839 | 841 | int count = lp->word[1] & 7; |
840 | 842 | unsigned irqMask = lp->word[7]; |
841 | - | |
843 | + | |
842 | 844 | while (count--) |
843 | 845 | irqMask &= irqMask - 1; |
844 | - | |
846 | + | |
845 | 847 | count = ffs(irqMask); |
846 | - | |
848 | + | |
847 | 849 | if (count) |
848 | 850 | dev->irq = count - 1; |
849 | - | |
851 | + | |
850 | 852 | if (dev->irq < 2) { |
851 | 853 | printk(KERN_ERR " Duh! illegal interrupt vector stored in EEPROM.\n"); |
852 | 854 | goto exit; |
... | ... | @@ -854,7 +856,7 @@ |
854 | 856 | dev->irq = 9; |
855 | 857 | } |
856 | 858 | } |
857 | - | |
859 | + | |
858 | 860 | dev->open = eepro_open; |
859 | 861 | dev->stop = eepro_close; |
860 | 862 | dev->hard_start_xmit = eepro_send_packet; |
... | ... | @@ -863,7 +865,7 @@ |
863 | 865 | dev->tx_timeout = eepro_tx_timeout; |
864 | 866 | dev->watchdog_timeo = TX_TIMEOUT; |
865 | 867 | dev->ethtool_ops = &eepro_ethtool_ops; |
866 | - | |
868 | + | |
867 | 869 | /* print boot time info */ |
868 | 870 | eepro_print_info(dev); |
869 | 871 | |
... | ... | @@ -1047,8 +1049,8 @@ |
1047 | 1049 | |
1048 | 1050 | |
1049 | 1051 | /* Initialize the RCV and XMT upper and lower limits */ |
1050 | - outb(lp->rcv_lower_limit >> 8, ioaddr + RCV_LOWER_LIMIT_REG); | |
1051 | - outb(lp->rcv_upper_limit >> 8, ioaddr + RCV_UPPER_LIMIT_REG); | |
1052 | + outb(lp->rcv_lower_limit >> 8, ioaddr + RCV_LOWER_LIMIT_REG); | |
1053 | + outb(lp->rcv_upper_limit >> 8, ioaddr + RCV_UPPER_LIMIT_REG); | |
1052 | 1054 | outb(lp->xmt_lower_limit >> 8, ioaddr + lp->xmt_lower_limit_reg); |
1053 | 1055 | outb(lp->xmt_upper_limit >> 8, ioaddr + lp->xmt_upper_limit_reg); |
1054 | 1056 | |
1055 | 1057 | |
1056 | 1058 | |
... | ... | @@ -1065,12 +1067,12 @@ |
1065 | 1067 | eepro_clear_int(ioaddr); |
1066 | 1068 | |
1067 | 1069 | /* Initialize RCV */ |
1068 | - outw(lp->rcv_lower_limit, ioaddr + RCV_BAR); | |
1070 | + outw(lp->rcv_lower_limit, ioaddr + RCV_BAR); | |
1069 | 1071 | lp->rx_start = lp->rcv_lower_limit; |
1070 | - outw(lp->rcv_upper_limit | 0xfe, ioaddr + RCV_STOP); | |
1072 | + outw(lp->rcv_upper_limit | 0xfe, ioaddr + RCV_STOP); | |
1071 | 1073 | |
1072 | 1074 | /* Initialize XMT */ |
1073 | - outw(lp->xmt_lower_limit, ioaddr + lp->xmt_bar); | |
1075 | + outw(lp->xmt_lower_limit, ioaddr + lp->xmt_bar); | |
1074 | 1076 | lp->tx_start = lp->tx_end = lp->xmt_lower_limit; |
1075 | 1077 | lp->tx_last = 0; |
1076 | 1078 | |
... | ... | @@ -1411,7 +1413,7 @@ |
1411 | 1413 | outb(0x08, ioaddr + STATUS_REG); |
1412 | 1414 | |
1413 | 1415 | if (i & 0x20) { /* command ABORTed */ |
1414 | - printk(KERN_NOTICE "%s: multicast setup failed.\n", | |
1416 | + printk(KERN_NOTICE "%s: multicast setup failed.\n", | |
1415 | 1417 | dev->name); |
1416 | 1418 | break; |
1417 | 1419 | } else if ((i & 0x0f) == 0x03) { /* MC-Done */ |
... | ... | @@ -1512,7 +1514,7 @@ |
1512 | 1514 | end = last + (((length + 3) >> 1) << 1) + XMT_HEADER; |
1513 | 1515 | |
1514 | 1516 | if (end >= lp->xmt_upper_limit + 2) { /* the transmit buffer is wrapped around */ |
1515 | - if ((lp->xmt_upper_limit + 2 - last) <= XMT_HEADER) { | |
1517 | + if ((lp->xmt_upper_limit + 2 - last) <= XMT_HEADER) { | |
1516 | 1518 | /* Arrrr!!!, must keep the xmt header together, |
1517 | 1519 | several days were lost to chase this one down. */ |
1518 | 1520 | last = lp->xmt_lower_limit; |
... | ... | @@ -1643,7 +1645,7 @@ |
1643 | 1645 | else if (rcv_status & 0x0800) |
1644 | 1646 | lp->stats.rx_crc_errors++; |
1645 | 1647 | |
1646 | - printk(KERN_DEBUG "%s: event = %#x, status = %#x, next = %#x, size = %#x\n", | |
1648 | + printk(KERN_DEBUG "%s: event = %#x, status = %#x, next = %#x, size = %#x\n", | |
1647 | 1649 | dev->name, rcv_event, rcv_status, rcv_next_frame, rcv_size); |
1648 | 1650 | } |
1649 | 1651 | |
1650 | 1652 | |
... | ... | @@ -1674,10 +1676,10 @@ |
1674 | 1676 | { |
1675 | 1677 | struct eepro_local *lp = netdev_priv(dev); |
1676 | 1678 | short ioaddr = dev->base_addr; |
1677 | - short boguscount = 25; | |
1679 | + short boguscount = 25; | |
1678 | 1680 | short xmt_status; |
1679 | 1681 | |
1680 | - while ((lp->tx_start != lp->tx_end) && boguscount--) { | |
1682 | + while ((lp->tx_start != lp->tx_end) && boguscount--) { | |
1681 | 1683 | |
1682 | 1684 | outw(lp->tx_start, ioaddr + HOST_ADDRESS_REG); |
1683 | 1685 | xmt_status = inw(ioaddr+IO_PORT); |
... | ... | @@ -1723,7 +1725,7 @@ |
1723 | 1725 | { |
1724 | 1726 | struct eepro_local *lp = (struct eepro_local *)dev->priv; |
1725 | 1727 | |
1726 | - cmd->supported = SUPPORTED_10baseT_Half | | |
1728 | + cmd->supported = SUPPORTED_10baseT_Half | | |
1727 | 1729 | SUPPORTED_10baseT_Full | |
1728 | 1730 | SUPPORTED_Autoneg; |
1729 | 1731 | cmd->advertising = ADVERTISED_10baseT_Half | |
include/asm-m68k/sun3xflop.h
... | ... | @@ -27,10 +27,8 @@ |
27 | 27 | |
28 | 28 | /* We don't need no stinkin' I/O port allocation crap. */ |
29 | 29 | #undef release_region |
30 | -#undef check_region | |
31 | 30 | #undef request_region |
32 | 31 | #define release_region(X, Y) do { } while(0) |
33 | -#define check_region(X, Y) (0) | |
34 | 32 | #define request_region(X, Y, Z) (1) |
35 | 33 | |
36 | 34 | struct sun3xflop_private { |
include/asm-m68knommu/ide.h
... | ... | @@ -163,13 +163,6 @@ |
163 | 163 | } |
164 | 164 | |
165 | 165 | |
166 | -static IDE_INLINE int | |
167 | -ide_check_region(ide_ioreg_t from, unsigned int extent) | |
168 | -{ | |
169 | - return 0; | |
170 | -} | |
171 | - | |
172 | - | |
173 | 166 | static IDE_INLINE void |
174 | 167 | ide_request_region(ide_ioreg_t from, unsigned int extent, const char *name) |
175 | 168 | { |
include/asm-parisc/ide.h
... | ... | @@ -22,7 +22,6 @@ |
22 | 22 | |
23 | 23 | #define ide_request_irq(irq,hand,flg,dev,id) request_irq((irq),(hand),(flg),(dev),(id)) |
24 | 24 | #define ide_free_irq(irq,dev_id) free_irq((irq), (dev_id)) |
25 | -#define ide_check_region(from,extent) check_region((from), (extent)) | |
26 | 25 | #define ide_request_region(from,extent,name) request_region((from), (extent), (name)) |
27 | 26 | #define ide_release_region(from,extent) release_region((from), (extent)) |
28 | 27 | /* Generic I/O and MEMIO string operations. */ |
include/asm-sparc/floppy.h
... | ... | @@ -17,10 +17,8 @@ |
17 | 17 | |
18 | 18 | /* We don't need no stinkin' I/O port allocation crap. */ |
19 | 19 | #undef release_region |
20 | -#undef check_region | |
21 | 20 | #undef request_region |
22 | 21 | #define release_region(X, Y) do { } while(0) |
23 | -#define check_region(X, Y) (0) | |
24 | 22 | #define request_region(X, Y, Z) (1) |
25 | 23 | |
26 | 24 | /* References: |
sound/oss/cs4232.c
... | ... | @@ -195,10 +195,12 @@ |
195 | 195 | CS_OUT2(0x15, 0x00); /* Select logical device 0 (WSS/SB/FM) */ |
196 | 196 | CS_OUT3(0x47, (base >> 8) & 0xff, base & 0xff); /* WSS base */ |
197 | 197 | |
198 | - if (check_region(0x388, 4)) /* Not free */ | |
198 | + if (!request_region(0x388, 4, "FM")) /* Not free */ | |
199 | 199 | CS_OUT3(0x48, 0x00, 0x00) /* FM base off */ |
200 | - else | |
200 | + else { | |
201 | + release_region(0x388, 4); | |
201 | 202 | CS_OUT3(0x48, 0x03, 0x88); /* FM base 0x388 */ |
203 | + } | |
202 | 204 | |
203 | 205 | CS_OUT3(0x42, 0x00, 0x00); /* SB base off */ |
204 | 206 | CS_OUT2(0x22, irq); /* SB+WSS IRQ */ |
sound/oss/wavfront.c
... | ... | @@ -2434,7 +2434,7 @@ |
2434 | 2434 | consumes 16. |
2435 | 2435 | */ |
2436 | 2436 | |
2437 | - if (check_region (io_base, 16)) { | |
2437 | + if (!request_region (io_base, 16, "wavfront")) { | |
2438 | 2438 | printk (KERN_ERR LOGNAME "IO address range 0x%x - 0x%x " |
2439 | 2439 | "already in use - ignored\n", dev.base, |
2440 | 2440 | dev.base+15); |
2441 | 2441 | |
... | ... | @@ -2466,10 +2466,13 @@ |
2466 | 2466 | } else { |
2467 | 2467 | printk (KERN_WARNING LOGNAME "not raw, but no " |
2468 | 2468 | "hardware version!\n"); |
2469 | + release_region (io_base, 16); | |
2469 | 2470 | return 0; |
2470 | 2471 | } |
2471 | 2472 | |
2472 | 2473 | if (!wf_raw) { |
2474 | + /* will re-acquire region in install_wavefront() */ | |
2475 | + release_region (io_base, 16); | |
2473 | 2476 | return 1; |
2474 | 2477 | } else { |
2475 | 2478 | printk (KERN_INFO LOGNAME |
... | ... | @@ -2489,6 +2492,7 @@ |
2489 | 2492 | |
2490 | 2493 | if (wavefront_hw_reset ()) { |
2491 | 2494 | printk (KERN_WARNING LOGNAME "hardware reset failed\n"); |
2495 | + release_region (io_base, 16); | |
2492 | 2496 | return 0; |
2493 | 2497 | } |
2494 | 2498 | |
... | ... | @@ -2496,6 +2500,8 @@ |
2496 | 2500 | |
2497 | 2501 | dev.has_fx = (detect_wffx () == 0); |
2498 | 2502 | |
2503 | + /* will re-acquire region in install_wavefront() */ | |
2504 | + release_region (io_base, 16); | |
2499 | 2505 | return 1; |
2500 | 2506 | } |
2501 | 2507 | |
2502 | 2508 | |
2503 | 2509 | |
2504 | 2510 | |
... | ... | @@ -2804,17 +2810,27 @@ |
2804 | 2810 | } |
2805 | 2811 | |
2806 | 2812 | static int __init install_wavefront (void) |
2807 | - | |
2808 | 2813 | { |
2814 | + if (!request_region (dev.base+2, 6, "wavefront synth")) | |
2815 | + return -1; | |
2816 | + | |
2817 | + if (dev.has_fx) { | |
2818 | + if (!request_region (dev.base+8, 8, "wavefront fx")) { | |
2819 | + release_region (dev.base+2, 6); | |
2820 | + return -1; | |
2821 | + } | |
2822 | + } | |
2823 | + | |
2809 | 2824 | if ((dev.synth_dev = register_sound_synth (&wavefront_fops, -1)) < 0) { |
2810 | 2825 | printk (KERN_ERR LOGNAME "cannot register raw synth\n"); |
2811 | - return -1; | |
2826 | + goto err_out; | |
2812 | 2827 | } |
2813 | 2828 | |
2814 | 2829 | #if OSS_SUPPORT_LEVEL & OSS_SUPPORT_SEQ |
2815 | 2830 | if ((dev.oss_dev = sound_alloc_synthdev()) == -1) { |
2816 | 2831 | printk (KERN_ERR LOGNAME "Too many sequencers\n"); |
2817 | - return -1; | |
2832 | + /* FIXME: leak: should unregister sound synth */ | |
2833 | + goto err_out; | |
2818 | 2834 | } else { |
2819 | 2835 | synth_devs[dev.oss_dev] = &wavefront_operations; |
2820 | 2836 | } |
2821 | 2837 | |
2822 | 2838 | |
... | ... | @@ -2827,20 +2843,20 @@ |
2827 | 2843 | sound_unload_synthdev (dev.oss_dev); |
2828 | 2844 | #endif /* OSS_SUPPORT_SEQ */ |
2829 | 2845 | |
2830 | - return -1; | |
2846 | + goto err_out; | |
2831 | 2847 | } |
2832 | 2848 | |
2833 | - request_region (dev.base+2, 6, "wavefront synth"); | |
2834 | - | |
2835 | - if (dev.has_fx) { | |
2836 | - request_region (dev.base+8, 8, "wavefront fx"); | |
2837 | - } | |
2838 | - | |
2839 | 2849 | if (wavefront_config_midi ()) { |
2840 | 2850 | printk (KERN_WARNING LOGNAME "could not initialize MIDI.\n"); |
2841 | 2851 | } |
2842 | 2852 | |
2843 | 2853 | return dev.oss_dev; |
2854 | + | |
2855 | +err_out: | |
2856 | + release_region (dev.base+2, 6); | |
2857 | + if (dev.has_fx) | |
2858 | + release_region (dev.base+8, 8); | |
2859 | + return -1; | |
2844 | 2860 | } |
2845 | 2861 | |
2846 | 2862 | static void __exit uninstall_wavefront (void) |