aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2015-05-04 15:12:33 -0400
committerDavid S. Miller <davem@davemloft.net>2015-05-04 15:12:33 -0400
commita2d4fcb8043402fd24aaef7e00d4c24b1151cda4 (patch)
tree8b8d55560581ecea12e806509ba54c64f57f74e8
parent965b2aa78fbcb831acf4f669f494da201f4bcace (diff)
Revert "Revert "smc91x: retrieve IRQ and trigger flags in a modern way""
This reverts commit 8d7d9cca4390062ccd09ffd9fdb37d1c4eeea9ac. Now that the necessary infrastructure is really all there in the tree, we can put this change back in. Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/smsc/smc91x.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/net/ethernet/smsc/smc91x.c b/drivers/net/ethernet/smsc/smc91x.c
index 14b363a25c02..630f0b7800e4 100644
--- a/drivers/net/ethernet/smsc/smc91x.c
+++ b/drivers/net/ethernet/smsc/smc91x.c
@@ -2238,9 +2238,10 @@ static int smc_drv_probe(struct platform_device *pdev)
2238 const struct of_device_id *match = NULL; 2238 const struct of_device_id *match = NULL;
2239 struct smc_local *lp; 2239 struct smc_local *lp;
2240 struct net_device *ndev; 2240 struct net_device *ndev;
2241 struct resource *res, *ires; 2241 struct resource *res;
2242 unsigned int __iomem *addr; 2242 unsigned int __iomem *addr;
2243 unsigned long irq_flags = SMC_IRQ_FLAGS; 2243 unsigned long irq_flags = SMC_IRQ_FLAGS;
2244 unsigned long irq_resflags;
2244 int ret; 2245 int ret;
2245 2246
2246 ndev = alloc_etherdev(sizeof(struct smc_local)); 2247 ndev = alloc_etherdev(sizeof(struct smc_local));
@@ -2332,16 +2333,19 @@ static int smc_drv_probe(struct platform_device *pdev)
2332 goto out_free_netdev; 2333 goto out_free_netdev;
2333 } 2334 }
2334 2335
2335 ires = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 2336 ndev->irq = platform_get_irq(pdev, 0);
2336 if (!ires) { 2337 if (ndev->irq <= 0) {
2337 ret = -ENODEV; 2338 ret = -ENODEV;
2338 goto out_release_io; 2339 goto out_release_io;
2339 } 2340 }
2340 2341 /*
2341 ndev->irq = ires->start; 2342 * If this platform does not specify any special irqflags, or if
2342 2343 * the resource supplies a trigger, override the irqflags with
2343 if (irq_flags == -1 || ires->flags & IRQF_TRIGGER_MASK) 2344 * the trigger flags from the resource.
2344 irq_flags = ires->flags & IRQF_TRIGGER_MASK; 2345 */
2346 irq_resflags = irqd_get_trigger_type(irq_get_irq_data(ndev->irq));
2347 if (irq_flags == -1 || irq_resflags & IRQF_TRIGGER_MASK)
2348 irq_flags = irq_resflags & IRQF_TRIGGER_MASK;
2345 2349
2346 ret = smc_request_attrib(pdev, ndev); 2350 ret = smc_request_attrib(pdev, ndev);
2347 if (ret) 2351 if (ret)