]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/wan/c101.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394...
[linux-2.6-omap-h63xx.git] / drivers / net / wan / c101.c
index 2c09ec908a3fa94390df7db514cd9fa05a0ef593..c4c8eab8574f79bb36fc3352648d8df09ab579fb 100644 (file)
@@ -118,7 +118,7 @@ static inline void openwin(card_t *card, u8 page)
 
 static inline void set_carrier(port_t *port)
 {
-       if (!sca_in(MSCI1_OFFSET + ST3, port) & ST3_DCD)
+       if (!(sca_in(MSCI1_OFFSET + ST3, port) & ST3_DCD))
                netif_carrier_on(port_to_dev(port));
        else
                netif_carrier_off(port_to_dev(port));
@@ -127,10 +127,10 @@ static inline void set_carrier(port_t *port)
 
 static void sca_msci_intr(port_t *port)
 {
-       u8 stat = sca_in(MSCI1_OFFSET + ST1, port); /* read MSCI ST1 status */
+       u8 stat = sca_in(MSCI0_OFFSET + ST1, port); /* read MSCI ST1 status */
 
-       /* Reset MSCI TX underrun status bit */
-       sca_out(stat & ST1_UDRN, MSCI0_OFFSET + ST1, port);
+       /* Reset MSCI TX underrun and CDCD (ignored) status bit */
+       sca_out(stat & (ST1_UDRN | ST1_CDCD), MSCI0_OFFSET + ST1, port);
 
        if (stat & ST1_UDRN) {
                struct net_device_stats *stats = hdlc_stats(port_to_dev(port));
@@ -138,6 +138,7 @@ static void sca_msci_intr(port_t *port)
                stats->tx_fifo_errors++;
        }
 
+       stat = sca_in(MSCI1_OFFSET + ST1, port); /* read MSCI1 ST1 status */
        /* Reset MSCI CDCD status bit - uses ch#2 DCD input */
        sca_out(stat & ST1_CDCD, MSCI1_OFFSET + ST1, port);
 
@@ -197,7 +198,6 @@ static int c101_open(struct net_device *dev)
        sca_out(IE0_TXINT, MSCI0_OFFSET + IE0, port);
 
        set_carrier(port);
-       printk(KERN_DEBUG "0x%X\n", sca_in(MSCI1_OFFSET + ST3, port));
 
        /* enable MSCI1 CDCD interrupt */
        sca_out(IE1_CDCD, MSCI1_OFFSET + IE1, port);
@@ -315,12 +315,11 @@ static int __init c101_run(unsigned long irq, unsigned long winbase)
                return -ENODEV;
        }
 
-       card = kmalloc(sizeof(card_t), GFP_KERNEL);
+       card = kzalloc(sizeof(card_t), GFP_KERNEL);
        if (card == NULL) {
                printk(KERN_ERR "c101: unable to allocate memory\n");
                return -ENOBUFS;
        }
-       memset(card, 0, sizeof(card_t));
 
        card->dev = alloc_hdlcdev(card);
        if (!card->dev) {
@@ -364,7 +363,6 @@ static int __init c101_run(unsigned long irq, unsigned long winbase)
        hdlc = dev_to_hdlc(dev);
 
        spin_lock_init(&card->lock);
-       SET_MODULE_OWNER(dev);
        dev->irq = irq;
        dev->mem_start = winbase;
        dev->mem_end = winbase + C101_MAPPED_RAM_SIZE - 1;
@@ -449,4 +447,5 @@ module_exit(c101_cleanup);
 MODULE_AUTHOR("Krzysztof Halasa <khc@pm.waw.pl>");
 MODULE_DESCRIPTION("Moxa C101 serial port driver");
 MODULE_LICENSE("GPL v2");
-module_param(hw, charp, 0444); /* hw=irq,ram:irq,... */
+module_param(hw, charp, 0444);
+MODULE_PARM_DESC(hw, "irq,ram:irq,...");