mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-27 14:43:58 +08:00
net: mvmdio: disable interrupt if resource size is too small
Disable the MDIO interrupt, falling back to polled mode, if the resource size does not allow us to access the interrupt registers. All current DT bindings use a size of 0x84, which allows access, but verifying it is good practice. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
2c26122e2c
commit
a51e2c9da4
@ -221,6 +221,12 @@ static int orion_mdio_probe(struct platform_device *pdev)
|
||||
clk_prepare_enable(dev->clk);
|
||||
|
||||
dev->err_interrupt = platform_get_irq(pdev, 0);
|
||||
if (dev->err_interrupt > 0 &&
|
||||
resource_size(r) < MVMDIO_ERR_INT_MASK + 4) {
|
||||
dev_err(&pdev->dev,
|
||||
"disabling interrupt, resource size is too small\n");
|
||||
dev->err_interrupt = 0;
|
||||
}
|
||||
if (dev->err_interrupt > 0) {
|
||||
ret = devm_request_irq(&pdev->dev, dev->err_interrupt,
|
||||
orion_mdio_err_irq,
|
||||
|
Loading…
Reference in New Issue
Block a user