netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] r6040: use an unique MDIO bus name
@ 2012-01-02  9:50 Florian Fainelli
  2012-01-02 20:49 ` David Miller
  2012-01-04 18:50 ` [PATCH v2] " Florian Fainelli
  0 siblings, 2 replies; 4+ messages in thread
From: Florian Fainelli @ 2012-01-02  9:50 UTC (permalink / raw)
  To: davem; +Cc: netdev, vova.kolpakov, Florian Fainelli

We should use an unique MDIO bus name which does not clash with anything
else in the system like the Fixed MDIO bus. The bus is now named:
<dev_name>-<card number> which is unique in the system.

Reported-by: Vladimir Kolpakov <vova.kolpakov@gmail.com>
Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
 drivers/net/ethernet/rdc/r6040.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/rdc/r6040.c b/drivers/net/ethernet/rdc/r6040.c
index 4bf68cf..de5e923 100644
--- a/drivers/net/ethernet/rdc/r6040.c
+++ b/drivers/net/ethernet/rdc/r6040.c
@@ -1188,7 +1188,8 @@ static int __devinit r6040_init_one(struct pci_dev *pdev,
 	lp->mii_bus->write = r6040_mdiobus_write;
 	lp->mii_bus->reset = r6040_mdiobus_reset;
 	lp->mii_bus->name = "r6040_eth_mii";
-	snprintf(lp->mii_bus->id, MII_BUS_ID_SIZE, "%x", card_idx);
+	snprintf(lp->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x",
+					dev_name(&pdev->dev), card_idx);
 	lp->mii_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL);
 	if (!lp->mii_bus->irq) {
 		dev_err(&pdev->dev, "mii_bus irq allocation failed\n");
-- 
1.7.5.4

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

* Re: [PATCH] r6040: use an unique MDIO bus name
  2012-01-02  9:50 [PATCH] r6040: use an unique MDIO bus name Florian Fainelli
@ 2012-01-02 20:49 ` David Miller
  2012-01-04 18:50 ` [PATCH v2] " Florian Fainelli
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2012-01-02 20:49 UTC (permalink / raw)
  To: florian; +Cc: netdev, vova.kolpakov

From: Florian Fainelli <florian@openwrt.org>
Date: Mon,  2 Jan 2012 10:50:00 +0100

> +	snprintf(lp->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x",
> +					dev_name(&pdev->dev), card_idx);

Please don't be so sloppy with the formatting like this,
make the arguments on the second line get indented exactly
to the first column after the openning parenthesis on the
first line.

If you can't be bothered to get this right by hand, use
something like emacs's C-mode to do it for you when you hit
TAB.

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

* [PATCH v2] r6040: use an unique MDIO bus name
  2012-01-02  9:50 [PATCH] r6040: use an unique MDIO bus name Florian Fainelli
  2012-01-02 20:49 ` David Miller
@ 2012-01-04 18:50 ` Florian Fainelli
  2012-01-04 20:56   ` David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Florian Fainelli @ 2012-01-04 18:50 UTC (permalink / raw)
  To: davem; +Cc: netdev, vova.kolpakov, Florian Fainelli

We should use an unique MDIO bus name which does not clash with anything
else in the system like the Fixed MDIO bus. The bus is now named:
r6040-<card number> which is unique in the system.

Reported-by: Vladimir Kolpakov <vova.kolpakov@gmail.com>
Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
Changes since v1:
- fixed snprintf arguments formatting

 drivers/net/ethernet/rdc/r6040.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/rdc/r6040.c b/drivers/net/ethernet/rdc/r6040.c
index 4bf68cf..a63b23f 100644
--- a/drivers/net/ethernet/rdc/r6040.c
+++ b/drivers/net/ethernet/rdc/r6040.c
@@ -1188,7 +1188,8 @@ static int __devinit r6040_init_one(struct pci_dev *pdev,
 	lp->mii_bus->write = r6040_mdiobus_write;
 	lp->mii_bus->reset = r6040_mdiobus_reset;
 	lp->mii_bus->name = "r6040_eth_mii";
-	snprintf(lp->mii_bus->id, MII_BUS_ID_SIZE, "%x", card_idx);
+	snprintf(lp->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x",
+		dev_name(&pdev->dev), card_idx);
 	lp->mii_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL);
 	if (!lp->mii_bus->irq) {
 		dev_err(&pdev->dev, "mii_bus irq allocation failed\n");
-- 
1.7.5.4

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

* Re: [PATCH v2] r6040: use an unique MDIO bus name
  2012-01-04 18:50 ` [PATCH v2] " Florian Fainelli
@ 2012-01-04 20:56   ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2012-01-04 20:56 UTC (permalink / raw)
  To: florian; +Cc: netdev, vova.kolpakov

From: Florian Fainelli <florian@openwrt.org>
Date: Wed,  4 Jan 2012 19:50:40 +0100

> We should use an unique MDIO bus name which does not clash with anything
> else in the system like the Fixed MDIO bus. The bus is now named:
> r6040-<card number> which is unique in the system.
> 
> Reported-by: Vladimir Kolpakov <vova.kolpakov@gmail.com>
> Signed-off-by: Florian Fainelli <florian@openwrt.org>

Applied.

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

end of thread, other threads:[~2012-01-04 20:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-02  9:50 [PATCH] r6040: use an unique MDIO bus name Florian Fainelli
2012-01-02 20:49 ` David Miller
2012-01-04 18:50 ` [PATCH v2] " Florian Fainelli
2012-01-04 20:56   ` 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).