Srinivas Kandagatla a5cf5ce92e net:stmmac: Add check if mdiobus is registered in stmmac_mdio_unregister
This patch adds a basic check in stmmac_mdio_unregister to see if mdio
bus registeration for this driver was actually sucessfull or not.

Use case here is, if BSP considers using mdio-gpio bus along with stmmac
driver by passing mdio_bus_data as NULL in platform data.
Call to stmmac_mdio_register with mdio_bus_data as NULL returns 0, which
is a considered sucessfull call form stmmac. Then again when we unload
the driver we just call stmmac_mdio_unregister, this is were the actual
problem is stmmac-mdio code dont really know at this instance of calling
that stmmac_mdio_register was actually successful.

So Adding a check in stmmac_mdio_unregister is always safe.

Without this patch stmmac driver calls stmmac_mdio_register from
stmmac_release which Segfaults as mii bus was never registered at the
first point.

Originally the this bug was found when unloading an stmmac driver
instance which uses mdio-gpio for smi access.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-31 16:11:16 -04:00
..
2012-06-06 09:31:33 -07:00
2012-06-06 09:31:33 -07:00
2012-06-06 09:31:33 -07:00
2012-07-16 22:38:27 -07:00
2012-08-08 16:07:51 -07:00
2012-07-26 14:30:23 -07:00
2012-05-02 20:52:48 -04:00
2012-07-09 14:42:30 -07:00
2012-06-06 09:31:33 -07:00
2012-07-16 22:38:27 -07:00
2012-06-06 09:31:33 -07:00
2012-07-16 22:38:27 -07:00
2012-07-16 22:38:27 -07:00
2012-07-18 09:40:54 -07:00
2012-07-16 22:38:27 -07:00