net: mscc: Fix OF_MDIO config check
authorDan Murphy <dmurphy@ti.com>
Fri, 5 Jun 2020 14:01:07 +0000 (09:01 -0500)
committerDavid S. Miller <davem@davemloft.net>
Fri, 5 Jun 2020 20:15:22 +0000 (13:15 -0700)
When CONFIG_OF_MDIO is set to be a module the code block is not
compiled. Use the IS_ENABLED macro that checks for both built in as
well as module.

Fixes: 4f58e6dceb0e4 ("net: phy: Cleanup the Edge-Rate feature in Microsemi PHYs.")
Signed-off-by: Dan Murphy <dmurphy@ti.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/mscc/mscc.h
drivers/net/phy/mscc/mscc_main.c

index f828c91..fbcee5f 100644 (file)
@@ -374,7 +374,7 @@ struct vsc8531_private {
 #endif
 };
 
-#ifdef CONFIG_OF_MDIO
+#if IS_ENABLED(CONFIG_OF_MDIO)
 struct vsc8531_edge_rate_table {
        u32 vddmac;
        u32 slowdown[8];
index 7ed0285..b9d60bc 100644 (file)
@@ -98,7 +98,7 @@ static const struct vsc85xx_hw_stat vsc8584_hw_stats[] = {
        },
 };
 
-#ifdef CONFIG_OF_MDIO
+#if IS_ENABLED(CONFIG_OF_MDIO)
 static const struct vsc8531_edge_rate_table edge_table[] = {
        {MSCC_VDDMAC_3300, { 0, 2,  4,  7, 10, 17, 29, 53} },
        {MSCC_VDDMAC_2500, { 0, 3,  6, 10, 14, 23, 37, 63} },
@@ -382,7 +382,7 @@ out_unlock:
        mutex_unlock(&phydev->lock);
 }
 
-#ifdef CONFIG_OF_MDIO
+#if IS_ENABLED(CONFIG_OF_MDIO)
 static int vsc85xx_edge_rate_magic_get(struct phy_device *phydev)
 {
        u32 vdd, sd;