diff mbox

[U-Boot,1/8] net: emaclite: Change driver name and add address

Message ID 1314362843-18214-1-git-send-email-monstr@monstr.eu
State Accepted
Commit 25a025518b7034e43c420d2cfec83a9eab7f70bb
Headers show

Commit Message

Michal Simek Aug. 26, 2011, 12:47 p.m. UTC
Current xilinx emaclite use net multi registration
but doesn't support several emaclites interfaces.
Changing driver name with adding address to name
is the first step how to distiguish several drivers.

Signed-off-by: Michal Simek <monstr@monstr.eu>
---
 drivers/net/xilinx_emaclite.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Mike Frysinger Aug. 26, 2011, 7:24 p.m. UTC | #1
On Friday, August 26, 2011 08:47:16 Michal Simek wrote:
> -	sprintf(dev->name, "Xilinx_Emaclite");
> +	sprintf(dev->name, "Xelite.%x", base_addr);

you calculated this down to the byte huh ;).  i see it uses the full 16.

do we have to worry about people who specify the device in their envs ?  i'm 
guessing not if the current driver only supports one instance.
-mike
Michal Simek Aug. 29, 2011, 5:49 a.m. UTC | #2
Mike Frysinger wrote:
> On Friday, August 26, 2011 08:47:16 Michal Simek wrote:
>> -	sprintf(dev->name, "Xilinx_Emaclite");
>> +	sprintf(dev->name, "Xelite.%x", base_addr);
> 
> you calculated this down to the byte huh ;).  i see it uses the full 16.

Yes, I had to because eth_device has 16 chars array for it.

> 
> do we have to worry about people who specify the device in their envs ?  i'm 
> guessing not if the current driver only supports one instance.

The whole point is to support several instances that's why I need to add
base address to name and fit to 16 chars.

Michal
diff mbox

Patch

diff --git a/drivers/net/xilinx_emaclite.c b/drivers/net/xilinx_emaclite.c
index 3c7c250..8d170a3 100644
--- a/drivers/net/xilinx_emaclite.c
+++ b/drivers/net/xilinx_emaclite.c
@@ -350,7 +350,7 @@  int xilinx_emaclite_initialize (bd_t *bis, int base_addr)
 		return -1;
 
 	memset(dev, 0, sizeof(*dev));
-	sprintf(dev->name, "Xilinx_Emaclite");
+	sprintf(dev->name, "Xelite.%x", base_addr);
 
 	dev->iobase = base_addr;
 	dev->priv = 0;