diff options
author | Ezequiel Garcia <ezequiel.garcia@free-electrons.com> | 2014-04-30 12:28:51 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-05-02 16:18:54 -0400 |
commit | 39076b047b160821110cb4deed13424ddfdf8d00 (patch) | |
tree | aabbab28ca9bfe23bcee95efefab4717d2d3fd87 /drivers/net | |
parent | e46e08b843d8ff8c46ad8d7b0b95acaacc4e6195 (diff) |
net: mvmdio: Check for a valid interrupt instead of an error
The following commit:
commit 9ec36cafe43bf835f8f29273597a5b0cbc8267ef
Author: Rob Herring <robh@kernel.org>
Date: Wed Apr 23 17:57:41 2014 -0500
of/irq: do irq resolution in platform_get_irq
changed platform_get_irq() which now returns EINVAL and EPROBE_DEFER,
in addition to ENXIO. If there's no interrupt for mvmdio, platform_get_irq()
returns EINVAL, but we currently check only for ENXIO.
Fix this by looking for a positive integer, which is the proper way of
validating a virtual interrupt number.
While at it, add a proper handling for the deferral probe case.
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Reviewed-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/marvell/mvmdio.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/ethernet/marvell/mvmdio.c b/drivers/net/ethernet/marvell/mvmdio.c index b161a525fc5b..9d5ced263a5e 100644 --- a/drivers/net/ethernet/marvell/mvmdio.c +++ b/drivers/net/ethernet/marvell/mvmdio.c | |||
@@ -232,7 +232,7 @@ static int orion_mdio_probe(struct platform_device *pdev) | |||
232 | clk_prepare_enable(dev->clk); | 232 | clk_prepare_enable(dev->clk); |
233 | 233 | ||
234 | dev->err_interrupt = platform_get_irq(pdev, 0); | 234 | dev->err_interrupt = platform_get_irq(pdev, 0); |
235 | if (dev->err_interrupt != -ENXIO) { | 235 | if (dev->err_interrupt > 0) { |
236 | ret = devm_request_irq(&pdev->dev, dev->err_interrupt, | 236 | ret = devm_request_irq(&pdev->dev, dev->err_interrupt, |
237 | orion_mdio_err_irq, | 237 | orion_mdio_err_irq, |
238 | IRQF_SHARED, pdev->name, dev); | 238 | IRQF_SHARED, pdev->name, dev); |
@@ -241,6 +241,9 @@ static int orion_mdio_probe(struct platform_device *pdev) | |||
241 | 241 | ||
242 | writel(MVMDIO_ERR_INT_SMI_DONE, | 242 | writel(MVMDIO_ERR_INT_SMI_DONE, |
243 | dev->regs + MVMDIO_ERR_INT_MASK); | 243 | dev->regs + MVMDIO_ERR_INT_MASK); |
244 | |||
245 | } else if (dev->err_interrupt == -EPROBE_DEFER) { | ||
246 | return -EPROBE_DEFER; | ||
244 | } | 247 | } |
245 | 248 | ||
246 | mutex_init(&dev->lock); | 249 | mutex_init(&dev->lock); |