X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fatm%2Ffirestream.c;h=98099f526d82663343bf85bae33781616fe5e651;hb=802f389a2cc6e2771b8de915ac241456d41eb79e;hp=7f6d02ce1b5f53da024bddd9e1ef0976c593ad01;hpb=3334500b460a5eede2e3466ca97a90fe3b91ceb5;p=linux-2.6-omap-h63xx.git diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c index 7f6d02ce1b5..98099f526d8 100644 --- a/drivers/atm/firestream.c +++ b/drivers/atm/firestream.c @@ -171,8 +171,8 @@ static char *res_strings[] = { "packet purged", "packet ageing timeout", "channel ageing timeout", - "calculated lenght error", - "programmed lenght limit error", + "calculated length error", + "programmed length limit error", "aal5 crc32 error", "oam transp or transpc crc10 error", "reserved 25", @@ -331,8 +331,8 @@ module_param(fs_keystream, int, 0); #define FS_DEBUG_QSIZE 0x00001000 -#define func_enter() fs_dprintk (FS_DEBUG_FLOW, "fs: enter %s\n", __FUNCTION__) -#define func_exit() fs_dprintk (FS_DEBUG_FLOW, "fs: exit %s\n", __FUNCTION__) +#define func_enter() fs_dprintk(FS_DEBUG_FLOW, "fs: enter %s\n", __func__) +#define func_exit() fs_dprintk(FS_DEBUG_FLOW, "fs: exit %s\n", __func__) static struct fs_dev *fs_boards = NULL; @@ -978,6 +978,7 @@ static int fs_open(struct atm_vcc *atm_vcc) /* Docs are vague about this atm_hdr field. By the way, the FS * chip makes odd errors if lower bits are set.... -- REW */ tc->atm_hdr = (vpi << 20) | (vci << 4); + tmc0 = 0; { int pcr = atm_pcr_goal (txtp); @@ -1295,7 +1296,7 @@ static const struct atmdev_ops ops = { static void __devinit undocumented_pci_fix (struct pci_dev *pdev) { - int tint; + u32 tint; /* The Windows driver says: */ /* Switch off FireStream Retry Limit Threshold @@ -1596,7 +1597,7 @@ static irqreturn_t fs_irq (int irq, void *dev_id) /* print the bits in the ISR register. */ if (fs_debug & FS_DEBUG_IRQ) { - /* The FS_DEBUG things are unneccesary here. But this way it is + /* The FS_DEBUG things are unnecessary here. But this way it is clear for grep that these are debug prints. */ fs_dprintk (FS_DEBUG_IRQ, "IRQ status:"); for (i=0;i<27;i++) @@ -1654,7 +1655,7 @@ static void fs_poll (unsigned long data) { struct fs_dev *dev = (struct fs_dev *) data; - fs_irq (0, dev, NULL); + fs_irq (0, dev); dev->timer.expires = jiffies + FS_POLL_FREQ; add_timer (&dev->timer); } @@ -1710,7 +1711,7 @@ static int __devinit fs_init (struct fs_dev *dev) /* This bit is documented as "RESERVED" */ if (isr & ISR_INIT_ERR) { printk (KERN_ERR "Error initializing the FS... \n"); - return 1; + goto unmap; } if (isr & ISR_INIT) { fs_dprintk (FS_DEBUG_INIT, "Ha! Initialized OK!\n"); @@ -1723,7 +1724,7 @@ static int __devinit fs_init (struct fs_dev *dev) if (!to) { printk (KERN_ERR "timeout initializing the FS... \n"); - return 1; + goto unmap; } /* XXX fix for fs155 */ @@ -1803,7 +1804,7 @@ static int __devinit fs_init (struct fs_dev *dev) if (!dev->atm_vccs) { printk (KERN_WARNING "Couldn't allocate memory for VCC buffers. Woops!\n"); /* XXX Clean up..... */ - return 1; + goto unmap; } dev->tx_inuse = kzalloc (dev->nchannels / 8 /* bits/byte */ , GFP_KERNEL); @@ -1813,7 +1814,7 @@ static int __devinit fs_init (struct fs_dev *dev) if (!dev->tx_inuse) { printk (KERN_WARNING "Couldn't allocate memory for tx_inuse bits!\n"); /* XXX Clean up..... */ - return 1; + goto unmap; } /* -- RAS1 : FS155 and 50 differ. Default (0) should be OK for both */ /* -- RAS2 : FS50 only: Default is OK. */ @@ -1840,7 +1841,7 @@ static int __devinit fs_init (struct fs_dev *dev) if (request_irq (dev->irq, fs_irq, IRQF_SHARED, "firestream", dev)) { printk (KERN_WARNING "couldn't get irq %d for firestream.\n", pci_dev->irq); /* XXX undo all previous stuff... */ - return 1; + goto unmap; } fs_dprintk (FS_DEBUG_INIT, "Grabbed irq %d for dev at %p.\n", dev->irq, dev); @@ -1890,6 +1891,9 @@ static int __devinit fs_init (struct fs_dev *dev) func_exit (); return 0; +unmap: + iounmap(dev->base); + return 1; } static int __devinit firestream_init_one (struct pci_dev *pci_dev, @@ -2012,6 +2016,7 @@ static void __devexit firestream_remove_one (struct pci_dev *pdev) for (i=0;i < FS_NR_RX_QUEUES;i++) free_queue (dev, &dev->rx_rq[i]); + iounmap(dev->base); fs_dprintk (FS_DEBUG_ALLOC, "Free fs-dev: %p\n", dev); nxtdev = dev->next; kfree (dev);