ixgbe: correctly add and remove napi queues
[safe/jmp/linux-2.6] / drivers / net / smc91x.c
index 34bfc60..53c2dda 100644 (file)
@@ -1939,8 +1939,11 @@ static int __init smc_probe(struct net_device *dev, void __iomem *ioaddr,
        if (retval)
                goto err_out;
 
-#ifdef SMC_USE_PXA_DMA
-       {
+#ifdef CONFIG_ARCH_PXA
+#  ifdef SMC_USE_PXA_DMA
+       lp->cfg.flags |= SMC91X_USE_DMA;
+#  endif
+       if (lp->cfg.flags & SMC91X_USE_DMA) {
                int dma = pxa_request_dma(dev->name, DMA_PRIO_LOW,
                                          smc_pxa_dma_irq, NULL);
                if (dma >= 0)
@@ -1958,7 +1961,8 @@ static int __init smc_probe(struct net_device *dev, void __iomem *ioaddr,
                if (dev->dma != (unsigned char)-1)
                        printk(" DMA %d", dev->dma);
 
-               printk("%s%s\n", nowait ? " [nowait]" : "",
+               printk("%s%s\n",
+                       lp->cfg.flags & SMC91X_NOWAIT ? " [nowait]" : "",
                        THROTTLE_TX_PKTS ? " [throttle_tx]" : "");
 
                if (!is_valid_ether_addr(dev->dev_addr)) {
@@ -1980,7 +1984,7 @@ static int __init smc_probe(struct net_device *dev, void __iomem *ioaddr,
        }
 
 err_out:
-#ifdef SMC_USE_PXA_DMA
+#ifdef CONFIG_ARCH_PXA
        if (retval && dev->dma != (unsigned char)-1)
                pxa_free_dma(dev->dma);
 #endif
@@ -2198,7 +2202,7 @@ static int smc_drv_probe(struct platform_device *pdev)
                goto out_release_attrib;
        }
 
-#ifdef SMC_USE_PXA_DMA
+#ifdef CONFIG_ARCH_PXA
        {
                struct smc_local *lp = netdev_priv(ndev);
                lp->device = &pdev->dev;
@@ -2241,7 +2245,7 @@ static int smc_drv_remove(struct platform_device *pdev)
 
        free_irq(ndev->irq, ndev);
 
-#ifdef SMC_USE_PXA_DMA
+#ifdef CONFIG_ARCH_PXA
        if (ndev->dma != (unsigned char)-1)
                pxa_free_dma(ndev->dma);
 #endif
@@ -2252,7 +2256,7 @@ static int smc_drv_remove(struct platform_device *pdev)
 
        res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "smc91x-regs");
        if (!res)
-               platform_get_resource(pdev, IORESOURCE_MEM, 0);
+               res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        release_mem_region(res->start, SMC_IO_EXTENT);
 
        free_netdev(ndev);