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: a9049e0c ("mdio: Add support for mdio drivers.") Reported-by: NAaro Koskinen <aaro.koskinen@nokia.com> Reported-by: NOlof Johansson <olof@lixom.net> Signed-off-by: NAndrew Lunn <andrew@lunn.ch> Tested-by: NAaro Koskinen <aaro.koskinen@nokia.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Showing
想要评论请 注册 或 登录