]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/smc91x.c
Merge current mainline tree into linux-omap tree
[linux-2.6-omap-h63xx.git] / drivers / net / smc91x.c
index 4d24c6fbec2674c361a3015076f76d587801097c..57e6426f01aa0ddeb0eb67bcee196a251c4112c0 100644 (file)
@@ -1780,7 +1780,8 @@ static int __init smc_findirq(void __iomem *ioaddr)
  * o  actually GRAB the irq.
  * o  GRAB the region
  */
-static int __init smc_probe(struct net_device *dev, void __iomem *ioaddr)
+static int __init smc_probe(struct net_device *dev, void __iomem *ioaddr,
+                           unsigned long irq_flags)
 {
        struct smc_local *lp = netdev_priv(dev);
        static int version_printed = 0;
@@ -1946,7 +1947,7 @@ static int __init smc_probe(struct net_device *dev, void __iomem *ioaddr)
        }
 
        /* Grab the IRQ */
-       retval = request_irq(dev->irq, &smc_interrupt, SMC_IRQ_FLAGS, dev->name, dev);
+       retval = request_irq(dev->irq, &smc_interrupt, irq_flags, dev->name, dev);
        if (retval)
                goto err_out;
 
@@ -2128,8 +2129,9 @@ static void smc_release_datacs(struct platform_device *pdev, struct net_device *
 static int smc_drv_probe(struct platform_device *pdev)
 {
        struct net_device *ndev;
-       struct resource *res;
+       struct resource *res, *ires;
        unsigned int __iomem *addr;
+       unsigned long irq_flags = SMC_IRQ_FLAGS;
        int ret;
 
        res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "smc91x-regs");
@@ -2155,12 +2157,17 @@ static int smc_drv_probe(struct platform_device *pdev)
        SET_NETDEV_DEV(ndev, &pdev->dev);
 
        ndev->dma = (unsigned char)-1;
-       ndev->irq = platform_get_irq(pdev, 0);
-       if (ndev->irq < 0) {
+
+       ires = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
+       if (!ires) {
                ret = -ENODEV;
                goto out_free_netdev;
        }
 
+       ndev->irq = ires->start;
+       if (SMC_IRQ_FLAGS == -1)
+               irq_flags = ires->flags & IRQF_TRIGGER_MASK;
+
        ret = smc_request_attrib(pdev);
        if (ret)
                goto out_free_netdev;
@@ -2186,7 +2193,7 @@ static int smc_drv_probe(struct platform_device *pdev)
 #endif
 
        platform_set_drvdata(pdev, ndev);
-       ret = smc_probe(ndev, addr);
+       ret = smc_probe(ndev, addr, irq_flags);
        if (ret != 0)
                goto out_iounmap;