Commit 7093a970 authored by Russell King's avatar Russell King Committed by David S. Miller

net: mvmdio: fix interrupt disable in remove path

The pre-existing write to disable interrupts on the remove path happens
whether we have an interrupt or not.  While this may seem to be a good
idea, this driver is re-used in many different implementations, some
where the binding only specifies four bytes of register space.  This
access causes us to access registers outside of the binding.

Make it conditional on the interrupt being present, which is the same
condition used when enabling the interrupt in the first place.
Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 37282485
...@@ -263,7 +263,8 @@ static int orion_mdio_remove(struct platform_device *pdev) ...@@ -263,7 +263,8 @@ static int orion_mdio_remove(struct platform_device *pdev)
struct mii_bus *bus = platform_get_drvdata(pdev); struct mii_bus *bus = platform_get_drvdata(pdev);
struct orion_mdio_dev *dev = bus->priv; struct orion_mdio_dev *dev = bus->priv;
writel(0, dev->regs + MVMDIO_ERR_INT_MASK); if (dev->err_interrupt > 0)
writel(0, dev->regs + MVMDIO_ERR_INT_MASK);
mdiobus_unregister(bus); mdiobus_unregister(bus);
if (!IS_ERR(dev->clk)) if (!IS_ERR(dev->clk))
clk_disable_unprepare(dev->clk); clk_disable_unprepare(dev->clk);
......
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