Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
[sfrench/cifs-2.6.git] / drivers / ieee1394 / ohci1394.c
index 4cf9b8f3e33607af45eba4eca2f388c6e00a374d..b6b96fa04d6234ccfdcd5fa65697b614e04b2e58 100644 (file)
@@ -161,9 +161,6 @@ printk(level "%s: " fmt "\n" , OHCI1394_DRIVER_NAME , ## args)
 #define PRINT(level, fmt, args...) \
 printk(level "%s: fw-host%d: " fmt "\n" , OHCI1394_DRIVER_NAME, ohci->host->id , ## args)
 
-static char version[] __devinitdata =
-       "$Rev: 1313 $ Ben Collins <bcollins@debian.org>";
-
 /* Module Parameters */
 static int phys_dma = 1;
 module_param(phys_dma, int, 0644);
@@ -587,12 +584,13 @@ static void ohci_initialize(struct ti_ohci *ohci)
        sprintf (irq_buf, "%s", __irq_itoa(ohci->dev->irq));
 #endif
        PRINT(KERN_INFO, "OHCI-1394 %d.%d (PCI): IRQ=[%s]  "
-             "MMIO=[%lx-%lx]  Max Packet=[%d]",
+             "MMIO=[%lx-%lx]  Max Packet=[%d]  IR/IT contexts=[%d/%d]",
              ((((buf) >> 16) & 0xf) + (((buf) >> 20) & 0xf) * 10),
              ((((buf) >> 4) & 0xf) + ((buf) & 0xf) * 10), irq_buf,
              pci_resource_start(ohci->dev, 0),
              pci_resource_start(ohci->dev, 0) + OHCI1394_REGISTER_SIZE - 1,
-             ohci->max_packet_size);
+             ohci->max_packet_size,
+             ohci->nb_iso_rcv_ctx, ohci->nb_iso_xmit_ctx);
 
        /* Check all of our ports to make sure that if anything is
         * connected, we enable that port. */
@@ -2960,28 +2958,23 @@ alloc_dma_rcv_ctx(struct ti_ohci *ohci, struct dma_rcv_ctx *d,
        d->ctrlClear = 0;
        d->cmdPtr = 0;
 
-       d->buf_cpu = kmalloc(d->num_desc * sizeof(quadlet_t*), GFP_ATOMIC);
-       d->buf_bus = kmalloc(d->num_desc * sizeof(dma_addr_t), GFP_ATOMIC);
+       d->buf_cpu = kzalloc(d->num_desc * sizeof(*d->buf_cpu), GFP_ATOMIC);
+       d->buf_bus = kzalloc(d->num_desc * sizeof(*d->buf_bus), GFP_ATOMIC);
 
        if (d->buf_cpu == NULL || d->buf_bus == NULL) {
                PRINT(KERN_ERR, "Failed to allocate dma buffer");
                free_dma_rcv_ctx(d);
                return -ENOMEM;
        }
-       memset(d->buf_cpu, 0, d->num_desc * sizeof(quadlet_t*));
-       memset(d->buf_bus, 0, d->num_desc * sizeof(dma_addr_t));
 
-       d->prg_cpu = kmalloc(d->num_desc * sizeof(struct dma_cmd*),
-                               GFP_ATOMIC);
-       d->prg_bus = kmalloc(d->num_desc * sizeof(dma_addr_t), GFP_ATOMIC);
+       d->prg_cpu = kzalloc(d->num_desc * sizeof(*d->prg_cpu), GFP_ATOMIC);
+       d->prg_bus = kzalloc(d->num_desc * sizeof(*d->prg_bus), GFP_ATOMIC);
 
        if (d->prg_cpu == NULL || d->prg_bus == NULL) {
                PRINT(KERN_ERR, "Failed to allocate dma prg");
                free_dma_rcv_ctx(d);
                return -ENOMEM;
        }
-       memset(d->prg_cpu, 0, d->num_desc * sizeof(struct dma_cmd*));
-       memset(d->prg_bus, 0, d->num_desc * sizeof(dma_addr_t));
 
        d->spb = kmalloc(d->split_buf_size, GFP_ATOMIC);
 
@@ -3093,17 +3086,14 @@ alloc_dma_trm_ctx(struct ti_ohci *ohci, struct dma_trm_ctx *d,
        d->ctrlClear = 0;
        d->cmdPtr = 0;
 
-       d->prg_cpu = kmalloc(d->num_desc * sizeof(struct at_dma_prg*),
-                            GFP_KERNEL);
-       d->prg_bus = kmalloc(d->num_desc * sizeof(dma_addr_t), GFP_KERNEL);
+       d->prg_cpu = kzalloc(d->num_desc * sizeof(*d->prg_cpu), GFP_KERNEL);
+       d->prg_bus = kzalloc(d->num_desc * sizeof(*d->prg_bus), GFP_KERNEL);
 
        if (d->prg_cpu == NULL || d->prg_bus == NULL) {
                PRINT(KERN_ERR, "Failed to allocate at dma prg");
                free_dma_trm_ctx(d);
                return -ENOMEM;
        }
-       memset(d->prg_cpu, 0, d->num_desc * sizeof(struct at_dma_prg*));
-       memset(d->prg_bus, 0, d->num_desc * sizeof(dma_addr_t));
 
        len = sprintf(pool_name, "ohci1394_trm_prg");
        sprintf(pool_name+len, "%d", num_allocs);
@@ -3201,8 +3191,6 @@ static struct hpsb_host_driver ohci1394_driver = {
        .hw_csr_reg =           ohci_hw_csr_reg,
 };
 
-\f
-
 /***********************************
  * PCI Driver Interface functions  *
  ***********************************/
@@ -3217,15 +3205,10 @@ do {                                            \
 static int __devinit ohci1394_pci_probe(struct pci_dev *dev,
                                        const struct pci_device_id *ent)
 {
-       static int version_printed = 0;
-
        struct hpsb_host *host;
        struct ti_ohci *ohci;   /* shortcut to currently handled device */
        unsigned long ohci_base;
 
-       if (version_printed++ == 0)
-               PRINT_G(KERN_INFO, "%s", version);
-
         if (pci_enable_device(dev))
                FAIL(-ENXIO, "Failed to enable OHCI hardware");
         pci_set_master(dev);
@@ -3369,13 +3352,8 @@ static int __devinit ohci1394_pci_probe(struct pci_dev *dev,
        /* Determine the number of available IR and IT contexts. */
        ohci->nb_iso_rcv_ctx =
                get_nb_iso_ctx(ohci, OHCI1394_IsoRecvIntMaskSet);
-       DBGMSG("%d iso receive contexts available",
-              ohci->nb_iso_rcv_ctx);
-
        ohci->nb_iso_xmit_ctx =
                get_nb_iso_ctx(ohci, OHCI1394_IsoXmitIntMaskSet);
-       DBGMSG("%d iso transmit contexts available",
-              ohci->nb_iso_xmit_ctx);
 
        /* Set the usage bits for non-existent contexts so they can't
         * be allocated */
@@ -3606,8 +3584,6 @@ static struct pci_driver ohci1394_pci_driver = {
        .suspend =      ohci1394_pci_suspend,
 };
 
-\f
-
 /***********************************
  * OHCI1394 Video Interface        *
  ***********************************/
@@ -3714,7 +3690,6 @@ EXPORT_SYMBOL(ohci1394_init_iso_tasklet);
 EXPORT_SYMBOL(ohci1394_register_iso_tasklet);
 EXPORT_SYMBOL(ohci1394_unregister_iso_tasklet);
 
-
 /***********************************
  * General module initialization   *
  ***********************************/