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>
This commit is contained in:
Marek Behún 2022-04-07 00:33:05 +02:00 committed by Ramon Fried
parent c677fb1e31
commit f961b3abf8

View File

@ -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;