Skip to contentSkip to conversation

Fixes for OF_MDIO flag

PATCH In review Dan Murphy 3 participants 10 messages Jun 5, 2020

Subsystems (3)
lore
Share & tools
lore

Dan Murphy

author
#0 lore raw

cover Fixes for OF_MDIO flag

Hello

There are some residual drivers that check the CONFIG_OF_MDIO flag using the if defs. Using this check does not work when the OF_MDIO is configured as a module. Using the IS_ENABLED macro checks if the flag is declared as built-in or as a module.

Dan

Dan Murphy (4):
net: dp83869: Fix OF_MDIO config check
net: dp83867: Fix OF_MDIO config check
net: marvell: Fix OF_MDIO config check
net: mscc: Fix OF_MDIO config check

 drivers/net/phy/dp83867.c        | 2 +-
 drivers/net/phy/dp83869.c        | 2 +-
 drivers/net/phy/marvell.c        | 2 +-
 drivers/net/phy/mscc/mscc.h      | 2 +-
 drivers/net/phy/mscc/mscc_main.c | 4 ++--
 5 files changed, 6 insertions(+), 6 deletions(-)
Signature · 1 line
2.26.2
author
#1 lore raw

PATCH 1/4 net: dp83869: Fix OF_MDIO config check

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 01db923e83779 ("net: phy: dp83869: Add TI dp83869 phy")
---
 drivers/net/phy/dp83869.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/phy/dp83869.c +1 -1
index cfb22a21a2e6..df85ae5b79e4 100644
@@ -176,7 +176,7 @@ static int dp83869_set_strapped_mode(struct phy_device *phydev)
 	return 0;
 }
 
-#ifdef CONFIG_OF_MDIO
+#if IS_ENABLED(CONFIG_OF_MDIO)
 static int dp83869_of_init(struct phy_device *phydev)
 {
 	struct dp83869_private *dp83869 = phydev->priv;
Signature · 1 line
2.26.2
Reviewed-by on v1 1/4
#2 lore raw

Re: [PATCH net 1/4] net: dp83869: Fix OF_MDIO config check

Quoted 6 lines · Dan Murphy

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 01db923e83779 ("net: phy: dp83869: Add TI dp83869 phy")
Signature · 1 line
Florian
author
#3 lore raw

PATCH 2/4 net: dp83867: Fix OF_MDIO config check

In reply to Dan Murphy

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 2a10154abcb75 ("net: phy: dp83867: Add TI dp83867 phy")
---
 drivers/net/phy/dp83867.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/phy/dp83867.c +1 -1
index 4017ae1692d8..f3c04981b8da 100644
@@ -488,7 +488,7 @@ static int dp83867_verify_rgmii_cfg(struct phy_device *phydev)
 	return 0;
 }
 
-#ifdef CONFIG_OF_MDIO
+#if IS_ENABLED(CONFIG_OF_MDIO)
 static int dp83867_of_init(struct phy_device *phydev)
 {
 	struct dp83867_private *dp83867 = phydev->priv;
Signature · 1 line
2.26.2
Reviewed-by on v1 2/4
#4 lore raw

Re: [PATCH net 2/4] net: dp83867: Fix OF_MDIO config check

Quoted 6 lines · Dan Murphy

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 2a10154abcb75 ("net: phy: dp83867: Add TI dp83867 phy")
Signature · 1 line
Florian
author
#5 lore raw

PATCH 3/4 net: marvell: Fix OF_MDIO config check

In reply to Dan Murphy

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 cf41a51db8985 ("of/phylib: Use device tree properties to initialize Marvell PHYs.")
---
 drivers/net/phy/marvell.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/phy/marvell.c +1 -1
index 4ea226566cec..c9ecf3c8c3fd 100644
@@ -429,7 +429,7 @@ static int m88e1101_config_aneg(struct phy_device *phydev)
 	return marvell_config_aneg(phydev);
 }
 
-#ifdef CONFIG_OF_MDIO
+#if IS_ENABLED(CONFIG_OF_MDIO)
 /* Set and/or override some configuration registers based on the
  * marvell,reg-init property stored in the of_node for the phydev.
  *
Signature · 1 line
2.26.2
Reviewed-by on v1 3/4
#6 lore raw

Re: [PATCH net 3/4] net: marvell: Fix OF_MDIO config check

Quoted 6 lines · Dan Murphy

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 cf41a51db8985 ("of/phylib: Use device tree properties to initialize Marvell PHYs.")
Signature · 1 line
Florian
author
#7 lore raw

PATCH 4/4 net: mscc: Fix OF_MDIO config check

In reply to Dan Murphy

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.")
---
 drivers/net/phy/mscc/mscc.h      | 2 +-
 drivers/net/phy/mscc/mscc_main.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/phy/mscc/mscc.h +1 -1
index f828c917b9f7..fbcee5fce7b2 100644
@@ -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];
drivers/net/phy/mscc/mscc_main.c +2 -2
index 7ed0285206d0..b9d60bc8b6b2 100644
@@ -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 @@ static void vsc85xx_wol_get(struct phy_device *phydev,
 	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;
Signature · 1 line
2.26.2
Reviewed-by on v1 4/4
#8 lore raw

Re: [PATCH net 4/4] net: mscc: Fix OF_MDIO config check

Quoted 6 lines · Dan Murphy

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.")
Signature · 1 line
Florian
maintainer
#9 lore raw
In reply to Dan Murphy

From: Dan Murphy <[email protected]>
Date: Fri, 5 Jun 2020 09:01:03 -0500

Quoted 4 lines

There are some residual drivers that check the CONFIG_OF_MDIO flag using the if defs. Using this check does not work when the OF_MDIO is configured as a module. Using the IS_ENABLED macro checks if the flag is declared as built-in or as a module.

Series applied, thank you.