summaryrefslogtreecommitdiffstats
path: root/drivers/net/orion-gbe.c
diff options
context:
space:
mode:
authorSebastian Hesselbarth <sebastian.hesselbarth@gmail.com>2014-06-24 12:18:09 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-06-25 08:31:26 +0200
commit724876deab47f7d73ad9772464ff754bfe452846 (patch)
treeb384747deef31341d55dec88719d21c3178df64e /drivers/net/orion-gbe.c
parentde20089ea81a99046b0f5a4bc80685c4f528244a (diff)
downloadbarebox-724876deab47f7d73ad9772464ff754bfe452846.tar.gz
barebox-724876deab47f7d73ad9772464ff754bfe452846.tar.xz
net: orion: generate unique port device names
Marvell Orion ethernet IP originally is multi-port capable, but SoCs using the IP usually have multiple single-port controllers built in. Currently, orion-gbe driver registers each port device with a constant name, which causes a name conflict with multiple controller instances. This patch uniquifies port device name generation by prepending controller's base register address to resolve the name conflict. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/net/orion-gbe.c')
-rw-r--r--drivers/net/orion-gbe.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/orion-gbe.c b/drivers/net/orion-gbe.c
index 9315127ac7..23c8346ec5 100644
--- a/drivers/net/orion-gbe.c
+++ b/drivers/net/orion-gbe.c
@@ -399,6 +399,7 @@ static int port_open(struct eth_device *edev)
static int port_probe(struct device_d *parent, struct port_priv *port)
{
+ struct orion_gbe *gbe = parent->priv;
struct device_d *dev = &port->dev;
u32 reg;
int ret;
@@ -450,7 +451,7 @@ static int port_probe(struct device_d *parent, struct port_priv *port)
reg |= RGMII_ENABLE;
writel(reg, port->regs + PORT_SC1);
- sprintf(dev->name, "orion-gbe-port");
+ snprintf(dev->name, MAX_DRIVER_NAME, "%08x.ethernet-port", (u32)gbe->regs);
dev->id = port->portno;
dev->parent = parent;
dev->device_node = port->np;