Commit 61307ed8 authored by Steve Glendinning's avatar Steve Glendinning Committed by David S. Miller

smsc911x: add support for platform-specific irq flags

this patch adds support for the platform_device's resources to indicate
additional flags to use when registering the irq, for example
IORESOURCE_IRQ_LOWLEVEL (which corresponds to IRQF_TRIGGER_LOW).  These
should be set in the irq resource flags field.
Signed-off-by: default avatarSteve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 05bee473
...@@ -1886,9 +1886,9 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev) ...@@ -1886,9 +1886,9 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev)
struct net_device *dev; struct net_device *dev;
struct smsc911x_data *pdata; struct smsc911x_data *pdata;
struct smsc911x_platform_config *config = pdev->dev.platform_data; struct smsc911x_platform_config *config = pdev->dev.platform_data;
struct resource *res; struct resource *res, *irq_res;
unsigned int intcfg = 0; unsigned int intcfg = 0;
int res_size; int res_size, irq_flags;
int retval; int retval;
DECLARE_MAC_BUF(mac); DECLARE_MAC_BUF(mac);
...@@ -1913,6 +1913,14 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev) ...@@ -1913,6 +1913,14 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev)
} }
res_size = res->end - res->start; res_size = res->end - res->start;
irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
if (!irq_res) {
pr_warning("%s: Could not allocate irq resource.\n",
SMSC_CHIPNAME);
retval = -ENODEV;
goto out_0;
}
if (!request_mem_region(res->start, res_size, SMSC_CHIPNAME)) { if (!request_mem_region(res->start, res_size, SMSC_CHIPNAME)) {
retval = -EBUSY; retval = -EBUSY;
goto out_0; goto out_0;
...@@ -1929,7 +1937,8 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev) ...@@ -1929,7 +1937,8 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev)
pdata = netdev_priv(dev); pdata = netdev_priv(dev);
dev->irq = platform_get_irq(pdev, 0); dev->irq = irq_res->start;
irq_flags = irq_res->flags & IRQF_TRIGGER_MASK;
pdata->ioaddr = ioremap_nocache(res->start, res_size); pdata->ioaddr = ioremap_nocache(res->start, res_size);
/* copy config parameters across to pdata */ /* copy config parameters across to pdata */
...@@ -1962,8 +1971,8 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev) ...@@ -1962,8 +1971,8 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev)
smsc911x_reg_write(pdata, INT_EN, 0); smsc911x_reg_write(pdata, INT_EN, 0);
smsc911x_reg_write(pdata, INT_STS, 0xFFFFFFFF); smsc911x_reg_write(pdata, INT_STS, 0xFFFFFFFF);
retval = request_irq(dev->irq, smsc911x_irqhandler, IRQF_DISABLED, retval = request_irq(dev->irq, smsc911x_irqhandler,
dev->name, dev); irq_flags | IRQF_DISABLED, dev->name, dev);
if (retval) { if (retval) {
SMSC_WARNING(PROBE, SMSC_WARNING(PROBE,
"Unable to claim requested irq: %d", dev->irq); "Unable to claim requested irq: %d", dev->irq);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment