diff mbox

net, fixed phy: make BUSID configurable

Message ID 1322991444-20626-1-git-send-email-hs@denx.de
State Rejected, archived
Delegated to: David Miller
Headers show

Commit Message

Heiko Schocher Dec. 4, 2011, 9:37 a.m. UTC
Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: netdev@vger.kernel.org
Cc: Vitaly Bordug <vbordug@ru.mvista.com>
Cc: Andrew Morton <akpm@osdl.org>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: Wolfgang Denk <wd@denx.de>
---
 drivers/net/phy/Kconfig |    5 +++++
 drivers/net/phy/fixed.c |    2 +-
 2 files changed, 6 insertions(+), 1 deletions(-)

Comments

David Miller Dec. 4, 2011, 6:23 p.m. UTC | #1
From: Heiko Schocher <hs@denx.de>
Date: Sun,  4 Dec 2011 10:37:24 +0100

> Signed-off-by: Heiko Schocher <hs@denx.de>

Give me a break.

You can't submit a change like this with essentially an
empty commit message.

Why in the world does this ever need to be configurable?
Are there alternative (and much better) ways to deal with
whatever problem this patch solves?

You've presented no information about why you need to make this
change, and more importantly why no viable alternatives exist
to solve your problem.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Heiko Schocher Dec. 5, 2011, 10:21 a.m. UTC | #2
Hello David,

David Miller wrote:
> From: Heiko Schocher <hs@denx.de>
> Date: Sun,  4 Dec 2011 10:37:24 +0100
> 
>> Signed-off-by: Heiko Schocher <hs@denx.de>
> 
> Give me a break.
> 
> You can't submit a change like this with essentially an
> empty commit message.

Uh, yes, sorry!

> Why in the world does this ever need to be configurable?
> Are there alternative (and much better) ways to deal with
> whatever problem this patch solves?
> 
> You've presented no information about why you need to make this
> change, and more importantly why no viable alternatives exist
> to solve your problem.

On a am1808 based board porting to current kernel, I have connected
a KSZ8864RMN switch and using the drivers/net/ethernet/ti/davinci_emac.c
driver. To the switch I have always 100/FULL connection and so
I decided to use the fixed PHY driver. But the busid 0 is used
from the drivers/net/ethernet/ti/davinci_emac.c driver, and the
fixed PHY driver is fix at busid 0 ...

Looking in the drivers/net/ethernet/ti/davinci_emac.c in emac_dev_open()
there is the possibility if no priv->phy_id is defined through
plattform code, to use a fixed 100/FULL speed and duplex settings ...
which would fix my needs ...

But code did not reach this, because first a:

        if (!priv->phy_id) {
                struct device *phy;

                phy = bus_find_device(&mdio_bus_type, NULL, NULL,
                                      match_first_device);
                if (phy)
                        priv->phy_id = dev_name(phy);
        }

is checked ... maybe it is better to fix this here by removing this
"if (!priv->phy_id) {" and do not use the fixed PHY driver?

bye,
Heiko
diff mbox

Patch

diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
index bb88e12..bed4bdd 100644
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -101,6 +101,11 @@  config FIXED_PHY
 
 	  Currently tested with mpc866ads and mpc8349e-mitx.
 
+config FIXED_PHY_ID
+	int "BUS ID for fixed Bus/PHY emulation"
+	depends on FIXED_PHY
+	default "0"
+
 config MDIO_BITBANG
 	tristate "Support for bitbanged MDIO buses"
 	help
diff --git a/drivers/net/phy/fixed.c b/drivers/net/phy/fixed.c
index 1fa4d73..5c77478 100644
--- a/drivers/net/phy/fixed.c
+++ b/drivers/net/phy/fixed.c
@@ -220,7 +220,7 @@  static int __init fixed_mdio_bus_init(void)
 		goto err_mdiobus_reg;
 	}
 
-	snprintf(fmb->mii_bus->id, MII_BUS_ID_SIZE, "0");
+	snprintf(fmb->mii_bus->id, MII_BUS_ID_SIZE, "%d", CONFIG_FIXED_PHY_ID);
 	fmb->mii_bus->name = "Fixed MDIO Bus";
 	fmb->mii_bus->priv = fmb;
 	fmb->mii_bus->parent = &pdev->dev;