From e3a6f1b5f3b4284fbe2382a0dba97154cd4c380a Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Fri, 15 Feb 2019 11:18:53 +0100 Subject: [PATCH] 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 --- drivers/net/phy/xilinx_gmii2rgmii.c | 5 +++++ 1 file changed, 5 insertions(+) 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 -- 2.47.3