aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/smsc
diff options
context:
space:
mode:
authorRobert Jarzmik <robert.jarzmik@free.fr>2015-02-12 11:59:10 -0500
committerDavid S. Miller <davem@davemloft.net>2015-03-17 15:04:57 -0400
commit8d7d9cca4390062ccd09ffd9fdb37d1c4eeea9ac (patch)
treee13d853c739413609ef11a9d24a21b0ace04a0c2 /drivers/net/ethernet/smsc
parentcb7cf8a33ff73cf638481d1edf883d8968f934f8 (diff)
Revert "smc91x: retrieve IRQ and trigger flags in a modern way"
The commit breaks the legacy platforms, ie. these not using device-tree, and setting up the interrupt resources with a flag to activate edge detection. The issue was found on the zylonite platform. The reason is that zylonite uses platform resources to pass the interrupt number and the irq flags (here IORESOURCE_IRQ_HIGHEDGE). It expects the driver to request the irq with these flags, which in turn setups the irq as high edge triggered. After the patch, this was supposed to be taken care of with : irq_resflags = irqd_get_trigger_type(irq_get_irq_data(ndev->irq)); But irq_resflags is 0 for legacy platforms, while for example in arch/arm/mach-pxa/zylonite.c, in struct resource smc91x_resources[] the irq flag is specified. This breaks zylonite because the interrupt is not setup as triggered, and hardware doesn't provide interrupts. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/smsc')
-rw-r--r--drivers/net/ethernet/smsc/smc91x.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/net/ethernet/smsc/smc91x.c b/drivers/net/ethernet/smsc/smc91x.c
index 5d093dc0f5f5..8678e39aba08 100644
--- a/drivers/net/ethernet/smsc/smc91x.c
+++ b/drivers/net/ethernet/smsc/smc91x.c
@@ -2248,10 +2248,9 @@ static int smc_drv_probe(struct platform_device *pdev)
2248 const struct of_device_id *match = NULL; 2248 const struct of_device_id *match = NULL;
2249 struct smc_local *lp; 2249 struct smc_local *lp;
2250 struct net_device *ndev; 2250 struct net_device *ndev;
2251 struct resource *res; 2251 struct resource *res, *ires;
2252 unsigned int __iomem *addr; 2252 unsigned int __iomem *addr;
2253 unsigned long irq_flags = SMC_IRQ_FLAGS; 2253 unsigned long irq_flags = SMC_IRQ_FLAGS;
2254 unsigned long irq_resflags;
2255 int ret; 2254 int ret;
2256 2255
2257 ndev = alloc_etherdev(sizeof(struct smc_local)); 2256 ndev = alloc_etherdev(sizeof(struct smc_local));
@@ -2343,19 +2342,16 @@ static int smc_drv_probe(struct platform_device *pdev)
2343 goto out_free_netdev; 2342 goto out_free_netdev;
2344 } 2343 }
2345 2344
2346 ndev->irq = platform_get_irq(pdev, 0); 2345 ires = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
2347 if (ndev->irq <= 0) { 2346 if (!ires) {
2348 ret = -ENODEV; 2347 ret = -ENODEV;
2349 goto out_release_io; 2348 goto out_release_io;
2350 } 2349 }
2351 /* 2350
2352 * If this platform does not specify any special irqflags, or if 2351 ndev->irq = ires->start;
2353 * the resource supplies a trigger, override the irqflags with 2352
2354 * the trigger flags from the resource. 2353 if (irq_flags == -1 || ires->flags & IRQF_TRIGGER_MASK)
2355 */ 2354 irq_flags = ires->flags & IRQF_TRIGGER_MASK;
2356 irq_resflags = irqd_get_trigger_type(irq_get_irq_data(ndev->irq));
2357 if (irq_flags == -1 || irq_resflags & IRQF_TRIGGER_MASK)
2358 irq_flags = irq_resflags & IRQF_TRIGGER_MASK;
2359 2355
2360 ret = smc_request_attrib(pdev, ndev); 2356 ret = smc_request_attrib(pdev, ndev);
2361 if (ret) 2357 if (ret)