diff options
author | Marek BehĂșn <marek.behun@nic.cz> | 2022-04-07 00:33:05 +0200 |
---|---|---|
committer | Ramon Fried <ramon@neureality.ai> | 2022-04-10 08:44:13 +0300 |
commit | f961b3abf88d2922e064a0b83525929aab917f1f (patch) | |
tree | 3dab8dbda4366c1619349f427efc8d2ba0f0a8d4 | |
parent | c677fb1e3196e1be1fcbbdb04650eed262708317 (diff) | |
download | u-boot-f961b3abf88d2922e064a0b83525929aab917f1f.zip u-boot-f961b3abf88d2922e064a0b83525929aab917f1f.tar.gz u-boot-f961b3abf88d2922e064a0b83525929aab917f1f.tar.bz2 |
net: phy: xilinx: Check interface type in ->config(), not ->probe()
We want to be able to have phydev->interface uninitialized during
->probe(). We should assume that phydev->interface is initialized only
before ->config().
Signed-off-by: Marek BehĂșn <marek.behun@nic.cz>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
-rw-r--r-- | drivers/net/phy/xilinx_gmii2rgmii.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/phy/xilinx_gmii2rgmii.c b/drivers/net/phy/xilinx_gmii2rgmii.c index 635c057..d92a364 100644 --- a/drivers/net/phy/xilinx_gmii2rgmii.c +++ b/drivers/net/phy/xilinx_gmii2rgmii.c @@ -26,6 +26,11 @@ static int xilinxgmiitorgmii_config(struct phy_device *phydev) debug("%s\n", __func__); + if (phydev->interface != PHY_INTERFACE_MODE_GMII) { + printf("Incorrect interface type\n"); + return -EINVAL; + } + if (!ofnode_valid(node)) return -EINVAL; @@ -114,11 +119,6 @@ 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; - } - phydev->flags |= PHY_FLAG_BROKEN_RESET; return 0; |