From: Michal Simek Date: Fri, 15 Feb 2019 10:18:53 +0000 (+0100) Subject: phy: net: Check that input interface type is gmii X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e3a6f1b5f3b4284fbe2382a0dba97154cd4c380a;p=thirdparty%2Fu-boot.git phy: net: Check that input interface type is gmii There can't be any other interface as input. Only gmii is allowed. Signed-off-by: Michal Simek --- diff --git a/drivers/net/phy/xilinx_gmii2rgmii.c b/drivers/net/phy/xilinx_gmii2rgmii.c index 08f9412ccd9..dad2bf7d840 100644 --- a/drivers/net/phy/xilinx_gmii2rgmii.c +++ b/drivers/net/phy/xilinx_gmii2rgmii.c @@ -62,6 +62,11 @@ static int xilinxgmiitorgmii_probe(struct phy_device *phydev) debug("%s\n", __func__); + if (phydev->interface != PHY_INTERFACE_MODE_GMII) { + printf("Incorrect interface type\n"); + return -EINVAL; + } + /* * Read the phy address again as the one we read in ethernet driver * was overwritten for the purpose of storing the ofnode