]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
phy: net: Check that input interface type is gmii
authorMichal Simek <michal.simek@xilinx.com>
Fri, 15 Feb 2019 10:18:53 +0000 (11:18 +0100)
committerMichal Simek <michal.simek@xilinx.com>
Wed, 27 Feb 2019 07:53:09 +0000 (08:53 +0100)
There can't be any other interface as input. Only gmii is allowed.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/net/phy/xilinx_gmii2rgmii.c

index 08f9412ccd9a75113bddc00d206e004d7b970803..dad2bf7d84071b19354e334e7e1f2c1a96ea227d 100644 (file)
@@ -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