~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to arch/mips/include/asm/mach-bcm47xx/nvram.h

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
 
40
40
static inline void nvram_parse_macaddr(char *buf, u8 *macaddr)
41
41
{
42
 
        sscanf(buf, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", &macaddr[0], &macaddr[1],
43
 
               &macaddr[2], &macaddr[3], &macaddr[4], &macaddr[5]);
 
42
        if (strchr(buf, ':'))
 
43
                sscanf(buf, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", &macaddr[0],
 
44
                        &macaddr[1], &macaddr[2], &macaddr[3], &macaddr[4],
 
45
                        &macaddr[5]);
 
46
        else if (strchr(buf, '-'))
 
47
                sscanf(buf, "%hhx-%hhx-%hhx-%hhx-%hhx-%hhx", &macaddr[0],
 
48
                        &macaddr[1], &macaddr[2], &macaddr[3], &macaddr[4],
 
49
                        &macaddr[5]);
 
50
        else
 
51
                printk(KERN_WARNING "Can not parse mac address: %s\n", buf);
44
52
}
45
53
 
46
54
#endif