summaryrefslogtreecommitdiffstats
path: root/arch/mips/include/asm
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2010-11-27 17:46:00 +0100
committerRalf Baechle <ralf@linux-mips.org>2010-12-16 18:10:59 +0000
commit59833fcf48ee7b7c8a01e590aa7b7212305c3077 (patch)
tree47e21a465253b2c65073ff5136454e76a883ff2b /arch/mips/include/asm
parent2aa088d6fd8a6c6e6020ea46b70141f0b7ccf5d2 (diff)
downloadblackbird-op-linux-59833fcf48ee7b7c8a01e590aa7b7212305c3077.tar.gz
blackbird-op-linux-59833fcf48ee7b7c8a01e590aa7b7212305c3077.zip
MIPS: BCM47xx: Use sscanf for parsing mac address
Instead of writing own function for parsing the mac address we now use sscanf. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> To: linux-mips@linux-mips.org Cc: Hauke Mehrtens <hauke@hauke-m.de> Patchwork: https://patchwork.linux-mips.org/patch/1847/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/include/asm')
-rw-r--r--arch/mips/include/asm/mach-bcm47xx/nvram.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/mips/include/asm/mach-bcm47xx/nvram.h b/arch/mips/include/asm/mach-bcm47xx/nvram.h
index c58ebd8bc155..9759588ba3cf 100644
--- a/arch/mips/include/asm/mach-bcm47xx/nvram.h
+++ b/arch/mips/include/asm/mach-bcm47xx/nvram.h
@@ -12,6 +12,7 @@
#define __NVRAM_H
#include <linux/types.h>
+#include <linux/kernel.h>
struct nvram_header {
u32 magic;
@@ -36,4 +37,10 @@ struct nvram_header {
extern int nvram_getenv(char *name, char *val, size_t val_len);
+static inline void nvram_parse_macaddr(char *buf, u8 *macaddr)
+{
+ sscanf(buf, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", &macaddr[0], &macaddr[1],
+ &macaddr[2], &macaddr[3], &macaddr[4], &macaddr[5]);
+}
+
#endif
OpenPOWER on IntegriCloud