if (i2o_dma_alloc(dev, &c->out_queue, MSG_POOL_SIZE, GFP_KERNEL)) { 
if (i2o_dma_alloc (dev, &c->out_queue, I2O_MAX_OUTBOUND_MSG_FRAMES * I2O_OUTBOUND_MSG_FRAME_SIZE * sizeof(u32), GFP_KERNEL)) { 
static int __devinit i2o_pci_alloc(struct i2o_controller *c){	struct pci_dev *pdev = c->pdev;	struct device *dev = &pdev->dev;	int i;	for (i = 0; i < 6; i++) {		/* Skip I/O spaces */		if (!(pci_resource_flags(pdev, i) & IORESOURCE_IO)) {			if (!c->base.phys) {				c->base.phys = pci_resource_start(pdev, i);				c->base.len = pci_resource_len(pdev, i);				/*				 * If we know what card it is, set the size				 * correctly. Code is taken from dpt_i2o.c				 */				if (pdev->device == 0xa501) {					if (pdev->subsystem_device >= 0xc032 &&					    pdev->subsystem_device <= 0xc03b) {						if (c->base.len > 0x400000)							c->base.len = 0x400000;					} else {						if (c->base.len > 0x100000)							c->base.len = 0x100000;					}				}				if (!c->raptor)					break;			} else {				c->in_queue.phys = pci_resource_start(pdev, i);				c->in_queue.len = pci_resource_len(pdev, i);				break;			}		}	}	if (i == 6) {		printk(KERN_ERR "%s: I2O controller has no memory regions"		       " defined.\n", c->name);		i2o_pci_free(c);		return -EINVAL;	}	/* Map the I2O controller */	if (c->raptor) {		printk(KERN_INFO "%s: PCI I2O controller\n", c->name);		printk(KERN_INFO "     BAR0 at 0x%08lX size=%ld\n",		       (unsigned long)c->base.phys, (unsigned long)c->base.len);		printk(KERN_INFO "     BAR1 at 0x%08lX size=%ld\n",		       (unsigned long)c->in_queue.phys,		       (unsigned long)c->in_queue.len);	} else		printk(KERN_INFO "%s: PCI I2O controller at %08lX size=%ld\n",		       c->name, (unsigned long)c->base.phys,		       (unsigned long)c->base.len);	c->base.virt = ioremap_nocache(c->base.phys, c->base.len);	if (!c->base.virt) {		printk(KERN_ERR "%s: Unable to map controller.\n", c->name);		return -ENOMEM;	}	if (c->raptor) {		c->in_queue.virt =		    ioremap_nocache(c->in_queue.phys, c->in_queue.len);		if (!c->in_queue.virt) {			printk(KERN_ERR "%s: Unable to map controller.\n",			       c->name);			i2o_pci_free(c);			return -ENOMEM;		}	} else		c->in_queue = c->base;	c->irq_status = c->base.virt + I2O_IRQ_STATUS;	c->irq_mask = c->base.virt + I2O_IRQ_MASK;	c->in_port = c->base.virt + I2O_IN_PORT;	c->out_port = c->base.virt + I2O_OUT_PORT;	if (i2o_dma_alloc(dev, &c->status, 8, GFP_KERNEL)) {		i2o_pci_free(c);		return -ENOMEM;	}	if (i2o_dma_alloc(dev, &c->hrt, sizeof(i2o_hrt), GFP_KERNEL)) {		i2o_pci_free(c);		return -ENOMEM;	}	if (i2o_dma_alloc(dev, &c->dlct, 8192, GFP_KERNEL)) {		i2o_pci_free(c);		return -ENOMEM;	}	if (i2o_dma_alloc(dev, &c->status_block, sizeof(i2o_status_block),			  GFP_KERNEL)) {		i2o_pci_free(c);		return -ENOMEM;	}	if (i2o_dma_alloc(dev, &c->out_queue, MSG_POOL_SIZE, GFP_KERNEL)) {		i2o_pci_free(c);		return -ENOMEM;	}	pci_set_drvdata(pdev, c);	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/f33213ecf49c98da4e85121b592c3bea8057c2e6/pci.c/clean/drivers/message/i2o/pci.c