diff options
| author | Jiri Kosina <jkosina@suse.cz> | 2011-09-15 15:08:05 +0200 | 
|---|---|---|
| committer | Jiri Kosina <jkosina@suse.cz> | 2011-09-15 15:08:18 +0200 | 
| commit | e060c38434b2caa78efe7cedaff4191040b65a15 (patch) | |
| tree | 407361230bf6733f63d8e788e4b5e6566ee04818 /arch/mips/rb532/devices.c | |
| parent | 10e4ac572eeffe5317019bd7330b6058a400dfc2 (diff) | |
| parent | cc39c6a9bbdebfcf1a7dee64d83bf302bc38d941 (diff) | |
| download | olio-linux-3.10-e060c38434b2caa78efe7cedaff4191040b65a15.tar.xz olio-linux-3.10-e060c38434b2caa78efe7cedaff4191040b65a15.zip  | |
Merge branch 'master' into for-next
Fast-forward merge with Linus to be able to merge patches
based on more recent version of the tree.
Diffstat (limited to 'arch/mips/rb532/devices.c')
| -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;  	}  }  |