net: mvneta: Disable fixed PHY code if PHY_FIXED is not compiled in
authorMarek Behún <marek.behun@nic.cz>
Wed, 27 Apr 2022 10:42:01 +0000 (12:42 +0200)
committerStefan Roese <sr@denx.de>
Wed, 4 May 2022 05:05:51 +0000 (07:05 +0200)
Guard the code handling the fixed PHY case by
CONFIG_IS_ENABLED(PHY_FIXED).

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
drivers/net/mvneta.c

index 378789b6325a568d02e00adc258d7f5394ac7418..292c364e5edf7dcd0614011ff1c50da22ba914fb 100644 (file)
@@ -812,7 +812,8 @@ static void mvneta_defaults_set(struct mvneta_port *pp)
        mvreg_write(pp, MVNETA_SDMA_CONFIG, val);
 
        /* Enable PHY polling in hardware if not in fixed-link mode */
-       if (pp->phydev->phy_id != PHY_FIXED_ID) {
+       if (!CONFIG_IS_ENABLED(PHY_FIXED) ||
+           pp->phydev->phy_id != PHY_FIXED_ID) {
                mvreg_write(pp, MVNETA_PHY_ADDR, pp->phydev->addr);
 
                val = mvreg_read(pp, MVNETA_UNIT_CONTROL);
@@ -1172,7 +1173,8 @@ static void mvneta_adjust_link(struct udevice *dev)
                 * be added). Also, why is ADVERT_FC enabled if we don't enable
                 * inband AN at all?
                 */
-               if (pp->phydev->phy_id == PHY_FIXED_ID)
+               if (CONFIG_IS_ENABLED(PHY_FIXED) &&
+                   pp->phydev->phy_id == PHY_FIXED_ID)
                        val = MVNETA_GMAC_FORCE_LINK_UP |
                              MVNETA_GMAC_IB_BYPASS_AN_EN |
                              MVNETA_GMAC_SET_FC_EN |