tty: declare MODULE_FIRMWARE in various drivers
[safe/jmp/linux-2.6] / drivers / char / cyclades.c
index 70bd61b..b861c08 100644 (file)
@@ -158,13 +158,11 @@ static unsigned int cy_isa_addresses[] = {
 
 #define NR_ISA_ADDRS ARRAY_SIZE(cy_isa_addresses)
 
-#ifdef MODULE
 static long maddr[NR_CARDS];
 static int irq[NR_CARDS];
 
 module_param_array(maddr, long, NULL, 0);
 module_param_array(irq, int, NULL, 0);
-#endif
 
 #endif                         /* CONFIG_ISA */
 
@@ -598,12 +596,6 @@ static void cyy_chip_tx(struct cyclades_card *cinfo, unsigned int chip,
        save_car = readb(base_addr + (CyCAR << index));
        cy_writeb(base_addr + (CyCAR << index), save_xir);
 
-       /* validate the port# (as configured and open) */
-       if (channel + chip * 4 >= cinfo->nports) {
-               cy_writeb(base_addr + (CySRER << index),
-                         readb(base_addr + (CySRER << index)) & ~CyTxRdy);
-               goto end;
-       }
        info = &cinfo->ports[channel + chip * 4];
        tty = tty_port_tty_get(&info->port);
        if (tty == NULL) {
@@ -729,7 +721,7 @@ static void cyy_chip_modem(struct cyclades_card *cinfo, int chip,
                if (mdm_change & CyRI)
                        info->icount.rng++;
 
-               wake_up_interruptible(&info->delta_msr_wait);
+               wake_up_interruptible(&info->port.delta_msr_wait);
        }
 
        if ((mdm_change & CyDCD) && (info->port.flags & ASYNC_CHECK_CD)) {
@@ -1197,7 +1189,7 @@ static void cyz_handle_cmd(struct cyclades_card *cinfo)
                        break;
                }
                if (delta_count)
-                       wake_up_interruptible(&info->delta_msr_wait);
+                       wake_up_interruptible(&info->port.delta_msr_wait);
                if (special_count)
                        tty_schedule_flip(tty);
                tty_kref_put(tty);
@@ -1464,7 +1456,7 @@ static void cy_shutdown(struct cyclades_port *info, struct tty_struct *tty)
                spin_lock_irqsave(&card->card_lock, flags);
 
                /* Clear delta_msr_wait queue to avoid mem leaks. */
-               wake_up_interruptible(&info->delta_msr_wait);
+               wake_up_interruptible(&info->port.delta_msr_wait);
 
                if (info->port.xmit_buf) {
                        unsigned char *temp;
@@ -2788,7 +2780,7 @@ cy_ioctl(struct tty_struct *tty, struct file *file,
                /* note the counters on entry */
                cnow = info->icount;
                spin_unlock_irqrestore(&info->card->card_lock, flags);
-               ret_val = wait_event_interruptible(info->delta_msr_wait,
+               ret_val = wait_event_interruptible(info->port.delta_msr_wait,
                                cy_cflags_changed(info, arg, &cnow));
                break;
 
@@ -3153,7 +3145,6 @@ static int __devinit cy_init_card(struct cyclades_card *cinfo)
                info->port.close_delay = 5 * HZ / 10;
                info->port.flags = STD_COM_FLAGS;
                init_completion(&info->shutdown_wait);
-               init_waitqueue_head(&info->delta_msr_wait);
 
                if (cy_is_Z(cinfo)) {
                        struct FIRM_ID *firm_id = cinfo->base_addr + ID_ADDRESS;
@@ -3317,13 +3308,10 @@ static int __init cy_detect_isa(void)
        unsigned short cy_isa_irq, nboard;
        void __iomem *cy_isa_address;
        unsigned short i, j, cy_isa_nchan;
-#ifdef MODULE
        int isparam = 0;
-#endif
 
        nboard = 0;
 
-#ifdef MODULE
        /* Check for module parameters */
        for (i = 0; i < NR_CARDS; i++) {
                if (maddr[i] || i) {
@@ -3333,7 +3321,6 @@ static int __init cy_detect_isa(void)
                if (!maddr[i])
                        break;
        }
-#endif
 
        /* scan the address table probing for Cyclom-Y/ISA boards */
        for (i = 0; i < NR_ISA_ADDRS; i++) {
@@ -3354,11 +3341,10 @@ static int __init cy_detect_isa(void)
                        iounmap(cy_isa_address);
                        continue;
                }
-#ifdef MODULE
-               if (isparam && irq[i])
+
+               if (isparam && i < NR_CARDS && irq[i])
                        cy_isa_irq = irq[i];
                else
-#endif
                        /* find out the board's irq by probing */
                        cy_isa_irq = detect_isa_irq(cy_isa_address);
                if (cy_isa_irq == 0) {
@@ -4209,3 +4195,4 @@ module_exit(cy_cleanup_module);
 MODULE_LICENSE("GPL");
 MODULE_VERSION(CY_VERSION);
 MODULE_ALIAS_CHARDEV_MAJOR(CYCLADES_MAJOR);
+MODULE_FIRMWARE("cyzfirm.bin");