diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-26 14:17:28 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-26 14:17:28 -0700 |
commit | 6fd4ce886440c7a1b08b6642e606ee19097829df (patch) | |
tree | cd12dc0ec7e40e9d9a26e942999de93a5e673b4d /arch/mips/rb532 | |
parent | ba5b56cb3e3d2cab73d4fee9a022bb69462a8cd9 (diff) | |
parent | bf28607fbe529e20180080c4a0295b0a47834fde (diff) |
Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/upstream-linus
* 'upstream' of git://git.linux-mips.org/pub/scm/upstream-linus: (31 commits)
MIPS: Close races in TLB modify handlers.
MIPS: Add uasm UASM_i_SRL_SAFE macro.
MIPS: RB532: Use hex_to_bin()
MIPS: Enable cpu_has_clo_clz for MIPS Technologies' platforms
MIPS: PowerTV: Provide cpu-feature-overrides.h
MIPS: Remove pointless return statement from empty void functions.
MIPS: Limit fixrange_init() to the FIXMAP region
MIPS: Install handlers for software IRQs
MIPS: Move FIXADDR_TOP into spaces.h
MIPS: Add SYNC after cacheflush
MIPS: pfn_valid() is broken on low memory HIGHMEM systems
MIPS: HIGHMEM DMA on noncoherent MIPS32 processors
MIPS: topdown mmap support
MIPS: Remove redundant addr_limit assignment on exec.
MIPS: AR7: Replace __attribute__((__packed__)) with __packed
MIPS: AR7: Remove 'space before tabs' in platform.c
MIPS: Lantiq: Add missing clk_enable and clk_disable functions.
MIPS: AR7: Fix trailing semicolon bug in clock.c
MAINTAINERS: Update MIPS entry.
MIPS: BCM63xx: Remove duplicate PERF_IRQSTAT_REG definition
...
Diffstat (limited to 'arch/mips/rb532')
-rw-r--r-- | arch/mips/rb532/devices.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/arch/mips/rb532/devices.c b/arch/mips/rb532/devices.c index 041fc1afc3f..a969eb82663 100644 --- a/arch/mips/rb532/devices.c +++ b/arch/mips/rb532/devices.c @@ -251,28 +251,22 @@ static struct platform_device *rb532_devs[] = { static void __init parse_mac_addr(char *macstr) { - int i, j; - unsigned char result, value; + int i, h, l; for (i = 0; i < 6; i++) { - result = 0; - if (i != 5 && *(macstr + 2) != ':') return; - for (j = 0; j < 2; j++) { - if (isxdigit(*macstr) - && (value = - isdigit(*macstr) ? *macstr - - '0' : toupper(*macstr) - 'A' + 10) < 16) { - result = result * 16 + value; - macstr++; - } else - return; - } + h = hex_to_bin(*macstr++); + if (h == -1) + return; + + l = hex_to_bin(*macstr++); + if (l == -1) + return; macstr++; - korina_dev0_data.mac[i] = result; + korina_dev0_data.mac[i] = (h << 4) + l; } } |