lkml.org 
[lkml]   [2009]   [Dec]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] arch/powerpc/boot/devtree.c: use %pM to show MAC address
DateWed, 30 Dec 2009 14:30:39 -0500
From"H Hartley Sweeten" <>
Use the %pM kernel extension to display the MAC address.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>

---
diff --git a/arch/powerpc/boot/devtree.c b/arch/powerpc/boot/devtree.c
index a7e21a3..a2f07a5 100644
--- a/arch/powerpc/boot/devtree.c
+++ b/arch/powerpc/boot/devtree.c
@@ -93,10 +93,7 @@ void dt_fixup_mac_address_by_alias(const char *alias, const u8 *addr)
void *devp = find_node_by_alias(alias);

if (devp) {
- printf("%s: local-mac-address <-"
- " %02x:%02x:%02x:%02x:%02x:%02x\n\r", alias,
- addr[0], addr[1], addr[2],
- addr[3], addr[4], addr[5]);
+ printf("%s: local-mac-address <- %pM\n\r", alias, addr);

setprop(devp, "local-mac-address", addr, 6);
}
@@ -108,10 +105,7 @@ void dt_fixup_mac_address(u32 index, const u8 *addr)
(void*)&index, sizeof(index));

if (devp) {
- printf("ENET%d: local-mac-address <-"
- " %02x:%02x:%02x:%02x:%02x:%02x\n\r", index,
- addr[0], addr[1], addr[2],
- addr[3], addr[4], addr[5]);
+ printf("ENET%d: local-mac-address <- %pM\n\r", index, addr);

setprop(devp, "local-mac-address", addr, 6);
}

\
 
 \ /
  Last update: 2009-12-30 20:33    [from the cache]
©2003-2010