netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH (net.git) 1/2] stmmac: fix macro  used for debugging the xmit
@ 2013-02-07  6:47 Giuseppe CAVALLARO
  2013-02-07  6:47 ` [PATCH (net.git) 2/2] stmmac: mdio register has to fail if the phy is not found Giuseppe CAVALLARO
  2013-02-11  1:12 ` [PATCH (net.git) 1/2] stmmac: fix macro used for debugging the xmit David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Giuseppe CAVALLARO @ 2013-02-07  6:47 UTC (permalink / raw)
  To: netdev; +Cc: Giuseppe Cavallaro

This patch fixes the name of the macro used for
debugging the transmit process. I used STMMAC_TX_DEBUG
instead of STMMAC_XMIT_DEBUG.

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index f07c061..b75f4b2 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -69,7 +69,7 @@
 
 #undef STMMAC_XMIT_DEBUG
 /*#define STMMAC_XMIT_DEBUG*/
-#ifdef STMMAC_TX_DEBUG
+#ifdef STMMAC_XMIT_DEBUG
 #define TX_DBG(fmt, args...)  printk(fmt, ## args)
 #else
 #define TX_DBG(fmt, args...)  do { } while (0)
-- 
1.7.4.4

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

* [PATCH (net.git) 2/2] stmmac: mdio register has to fail if the phy is not found
  2013-02-07  6:47 [PATCH (net.git) 1/2] stmmac: fix macro used for debugging the xmit Giuseppe CAVALLARO
@ 2013-02-07  6:47 ` Giuseppe CAVALLARO
  2013-02-11  1:12   ` David Miller
  2013-02-11  1:12 ` [PATCH (net.git) 1/2] stmmac: fix macro used for debugging the xmit David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Giuseppe CAVALLARO @ 2013-02-07  6:47 UTC (permalink / raw)
  To: netdev; +Cc: Giuseppe Cavallaro

With this patch the stmmac fails in case of the phy device
is not found; w/o this fix the mdio can be register twice when
do down/up the iface and this is not correct.

Reported-by: Stas <stsp@list.ru>
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
index 0376a5e..0b9829f 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
@@ -188,8 +188,6 @@ int stmmac_mdio_register(struct net_device *ndev)
 		goto bus_register_fail;
 	}
 
-	priv->mii = new_bus;
-
 	found = 0;
 	for (addr = 0; addr < PHY_MAX_ADDR; addr++) {
 		struct phy_device *phydev = new_bus->phy_map[addr];
@@ -237,8 +235,14 @@ int stmmac_mdio_register(struct net_device *ndev)
 		}
 	}
 
-	if (!found)
+	if (!found) {
 		pr_warning("%s: No PHY found\n", ndev->name);
+		mdiobus_unregister(new_bus);
+		mdiobus_free(new_bus);
+		return -ENODEV;
+	}
+
+	priv->mii = new_bus;
 
 	return 0;
 
-- 
1.7.4.4

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

* Re: [PATCH (net.git) 1/2] stmmac: fix macro used for debugging the xmit
  2013-02-07  6:47 [PATCH (net.git) 1/2] stmmac: fix macro used for debugging the xmit Giuseppe CAVALLARO
  2013-02-07  6:47 ` [PATCH (net.git) 2/2] stmmac: mdio register has to fail if the phy is not found Giuseppe CAVALLARO
@ 2013-02-11  1:12 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2013-02-11  1:12 UTC (permalink / raw)
  To: peppe.cavallaro; +Cc: netdev

From: Giuseppe CAVALLARO <peppe.cavallaro@st.com>
Date: Thu,  7 Feb 2013 07:47:51 +0100

> This patch fixes the name of the macro used for
> debugging the transmit process. I used STMMAC_TX_DEBUG
> instead of STMMAC_XMIT_DEBUG.
> 
> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>

Applied.

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

* Re: [PATCH (net.git) 2/2] stmmac: mdio register has to fail if the phy is not found
  2013-02-07  6:47 ` [PATCH (net.git) 2/2] stmmac: mdio register has to fail if the phy is not found Giuseppe CAVALLARO
@ 2013-02-11  1:12   ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2013-02-11  1:12 UTC (permalink / raw)
  To: peppe.cavallaro; +Cc: netdev

From: Giuseppe CAVALLARO <peppe.cavallaro@st.com>
Date: Thu,  7 Feb 2013 07:47:52 +0100

> With this patch the stmmac fails in case of the phy device
> is not found; w/o this fix the mdio can be register twice when
> do down/up the iface and this is not correct.
> 
> Reported-by: Stas <stsp@list.ru>
> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>

Applied.

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

end of thread, other threads:[~2013-02-11  1:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-07  6:47 [PATCH (net.git) 1/2] stmmac: fix macro used for debugging the xmit Giuseppe CAVALLARO
2013-02-07  6:47 ` [PATCH (net.git) 2/2] stmmac: mdio register has to fail if the phy is not found Giuseppe CAVALLARO
2013-02-11  1:12   ` David Miller
2013-02-11  1:12 ` [PATCH (net.git) 1/2] stmmac: fix macro used for debugging the xmit 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).