netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/4] Fixes for OF_MDIO flag
@ 2020-06-05 14:01 Dan Murphy
  2020-06-05 14:01 ` [PATCH net 1/4] net: dp83869: Fix OF_MDIO config check Dan Murphy
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Dan Murphy @ 2020-06-05 14:01 UTC (permalink / raw)
  To: andrew, f.fainelli, hkallweit1, davem, kuba
  Cc: linux, netdev, linux-kernel, michael, Dan Murphy

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(-)

-- 
2.26.2


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH net 1/4] net: dp83869: Fix OF_MDIO config check
  2020-06-05 14:01 [PATCH net 0/4] Fixes for OF_MDIO flag Dan Murphy
@ 2020-06-05 14:01 ` Dan Murphy
  2020-06-05 16:30   ` Florian Fainelli
  2020-06-05 14:01 ` [PATCH net 2/4] net: dp83867: " Dan Murphy
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Dan Murphy @ 2020-06-05 14:01 UTC (permalink / raw)
  To: andrew, f.fainelli, hkallweit1, davem, kuba
  Cc: linux, netdev, linux-kernel, michael, 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")
Signed-off-by: Dan Murphy <dmurphy@ti.com>
---
 drivers/net/phy/dp83869.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/phy/dp83869.c b/drivers/net/phy/dp83869.c
index cfb22a21a2e6..df85ae5b79e4 100644
--- a/drivers/net/phy/dp83869.c
+++ b/drivers/net/phy/dp83869.c
@@ -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;
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH net 2/4] net: dp83867: Fix OF_MDIO config check
  2020-06-05 14:01 [PATCH net 0/4] Fixes for OF_MDIO flag Dan Murphy
  2020-06-05 14:01 ` [PATCH net 1/4] net: dp83869: Fix OF_MDIO config check Dan Murphy
@ 2020-06-05 14:01 ` Dan Murphy
  2020-06-05 16:30   ` Florian Fainelli
  2020-06-05 14:01 ` [PATCH net 3/4] net: marvell: " Dan Murphy
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Dan Murphy @ 2020-06-05 14:01 UTC (permalink / raw)
  To: andrew, f.fainelli, hkallweit1, davem, kuba
  Cc: linux, netdev, linux-kernel, michael, 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")
Signed-off-by: Dan Murphy <dmurphy@ti.com>
---
 drivers/net/phy/dp83867.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c
index 4017ae1692d8..f3c04981b8da 100644
--- a/drivers/net/phy/dp83867.c
+++ b/drivers/net/phy/dp83867.c
@@ -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;
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH net 3/4] net: marvell: Fix OF_MDIO config check
  2020-06-05 14:01 [PATCH net 0/4] Fixes for OF_MDIO flag Dan Murphy
  2020-06-05 14:01 ` [PATCH net 1/4] net: dp83869: Fix OF_MDIO config check Dan Murphy
  2020-06-05 14:01 ` [PATCH net 2/4] net: dp83867: " Dan Murphy
@ 2020-06-05 14:01 ` Dan Murphy
  2020-06-05 16:30   ` Florian Fainelli
  2020-06-05 14:01 ` [PATCH net 4/4] net: mscc: " Dan Murphy
  2020-06-05 20:15 ` [PATCH net 0/4] Fixes for OF_MDIO flag David Miller
  4 siblings, 1 reply; 10+ messages in thread
From: Dan Murphy @ 2020-06-05 14:01 UTC (permalink / raw)
  To: andrew, f.fainelli, hkallweit1, davem, kuba
  Cc: linux, netdev, linux-kernel, michael, 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.")
Signed-off-by: Dan Murphy <dmurphy@ti.com>
---
 drivers/net/phy/marvell.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index 4ea226566cec..c9ecf3c8c3fd 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -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.
  *
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH net 4/4] net: mscc: Fix OF_MDIO config check
  2020-06-05 14:01 [PATCH net 0/4] Fixes for OF_MDIO flag Dan Murphy
                   ` (2 preceding siblings ...)
  2020-06-05 14:01 ` [PATCH net 3/4] net: marvell: " Dan Murphy
@ 2020-06-05 14:01 ` Dan Murphy
  2020-06-05 16:30   ` Florian Fainelli
  2020-06-05 20:15 ` [PATCH net 0/4] Fixes for OF_MDIO flag David Miller
  4 siblings, 1 reply; 10+ messages in thread
From: Dan Murphy @ 2020-06-05 14:01 UTC (permalink / raw)
  To: andrew, f.fainelli, hkallweit1, davem, kuba
  Cc: linux, netdev, linux-kernel, michael, 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.")
Signed-off-by: Dan Murphy <dmurphy@ti.com>
---
 drivers/net/phy/mscc/mscc.h      | 2 +-
 drivers/net/phy/mscc/mscc_main.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/phy/mscc/mscc.h b/drivers/net/phy/mscc/mscc.h
index f828c917b9f7..fbcee5fce7b2 100644
--- a/drivers/net/phy/mscc/mscc.h
+++ b/drivers/net/phy/mscc/mscc.h
@@ -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];
diff --git a/drivers/net/phy/mscc/mscc_main.c b/drivers/net/phy/mscc/mscc_main.c
index 7ed0285206d0..b9d60bc8b6b2 100644
--- a/drivers/net/phy/mscc/mscc_main.c
+++ b/drivers/net/phy/mscc/mscc_main.c
@@ -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;
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH net 1/4] net: dp83869: Fix OF_MDIO config check
  2020-06-05 14:01 ` [PATCH net 1/4] net: dp83869: Fix OF_MDIO config check Dan Murphy
@ 2020-06-05 16:30   ` Florian Fainelli
  0 siblings, 0 replies; 10+ messages in thread
From: Florian Fainelli @ 2020-06-05 16:30 UTC (permalink / raw)
  To: Dan Murphy, andrew, hkallweit1, davem, kuba
  Cc: linux, netdev, linux-kernel, michael



On 6/5/2020 7:01 AM, Dan Murphy wrote:
> 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")
> Signed-off-by: Dan Murphy <dmurphy@ti.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH net 2/4] net: dp83867: Fix OF_MDIO config check
  2020-06-05 14:01 ` [PATCH net 2/4] net: dp83867: " Dan Murphy
@ 2020-06-05 16:30   ` Florian Fainelli
  0 siblings, 0 replies; 10+ messages in thread
From: Florian Fainelli @ 2020-06-05 16:30 UTC (permalink / raw)
  To: Dan Murphy, andrew, hkallweit1, davem, kuba
  Cc: linux, netdev, linux-kernel, michael



On 6/5/2020 7:01 AM, Dan Murphy wrote:
> 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")
> Signed-off-by: Dan Murphy <dmurphy@ti.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH net 3/4] net: marvell: Fix OF_MDIO config check
  2020-06-05 14:01 ` [PATCH net 3/4] net: marvell: " Dan Murphy
@ 2020-06-05 16:30   ` Florian Fainelli
  0 siblings, 0 replies; 10+ messages in thread
From: Florian Fainelli @ 2020-06-05 16:30 UTC (permalink / raw)
  To: Dan Murphy, andrew, hkallweit1, davem, kuba
  Cc: linux, netdev, linux-kernel, michael



On 6/5/2020 7:01 AM, Dan Murphy wrote:
> 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.")
> Signed-off-by: Dan Murphy <dmurphy@ti.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH net 4/4] net: mscc: Fix OF_MDIO config check
  2020-06-05 14:01 ` [PATCH net 4/4] net: mscc: " Dan Murphy
@ 2020-06-05 16:30   ` Florian Fainelli
  0 siblings, 0 replies; 10+ messages in thread
From: Florian Fainelli @ 2020-06-05 16:30 UTC (permalink / raw)
  To: Dan Murphy, andrew, hkallweit1, davem, kuba
  Cc: linux, netdev, linux-kernel, michael



On 6/5/2020 7:01 AM, Dan Murphy wrote:
> 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>
-- 
Florian

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH net 0/4] Fixes for OF_MDIO flag
  2020-06-05 14:01 [PATCH net 0/4] Fixes for OF_MDIO flag Dan Murphy
                   ` (3 preceding siblings ...)
  2020-06-05 14:01 ` [PATCH net 4/4] net: mscc: " Dan Murphy
@ 2020-06-05 20:15 ` David Miller
  4 siblings, 0 replies; 10+ messages in thread
From: David Miller @ 2020-06-05 20:15 UTC (permalink / raw)
  To: dmurphy
  Cc: andrew, f.fainelli, hkallweit1, kuba, linux, netdev,
	linux-kernel, michael

From: Dan Murphy <dmurphy@ti.com>
Date: Fri, 5 Jun 2020 09:01:03 -0500

> 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.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-06-05 20:15 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-05 14:01 [PATCH net 0/4] Fixes for OF_MDIO flag Dan Murphy
2020-06-05 14:01 ` [PATCH net 1/4] net: dp83869: Fix OF_MDIO config check Dan Murphy
2020-06-05 16:30   ` Florian Fainelli
2020-06-05 14:01 ` [PATCH net 2/4] net: dp83867: " Dan Murphy
2020-06-05 16:30   ` Florian Fainelli
2020-06-05 14:01 ` [PATCH net 3/4] net: marvell: " Dan Murphy
2020-06-05 16:30   ` Florian Fainelli
2020-06-05 14:01 ` [PATCH net 4/4] net: mscc: " Dan Murphy
2020-06-05 16:30   ` Florian Fainelli
2020-06-05 20:15 ` [PATCH net 0/4] Fixes for OF_MDIO flag David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).