]> git.baikalelectronics.ru Git - kernel.git/commit
of: of_mdio: Ensure mdio device is a PHY
authorAndrew Lunn <andrew@lunn.ch>
Tue, 26 Jan 2016 14:12:30 +0000 (15:12 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 29 Jan 2016 00:07:32 +0000 (16:07 -0800)
commit400fee995a8016d8f85c004216115eaf00dface5
tree08e6525c8b92236ccaf8ca2bd9394d8ef5673f11
parent0f18e0bf9077db27962fc91258e1be7a5bae8f89
of: of_mdio: Ensure mdio device is a PHY

of_phy_find_device() is used to find the phy device associated with a
device node. It is expected the node is for a PHY device, but in fact
it could of been probed as a generic MDIO device. Ensure the device is
a PHY before returning it.

Fixes: 11c48ce728a3 ("mdio: Add support for mdio drivers.")
Reported-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Reported-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/of/of_mdio.c