diff options
author | Daniel Walter <dwalter@google.com> | 2014-06-24 07:14:26 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2014-07-30 07:28:16 -0400 |
commit | 9e21c7e40b7eedce5a0a6429272dc8003b6953c6 (patch) | |
tree | 569c6565b08ec80efb75b8d32acfa7e793d256b6 /arch/mips/rb532 | |
parent | 1795cd9b3a91d4b5473c97f491d63892442212ab (diff) |
MIPS: RB532: Replace parse_mac_addr() with mac_pton().
Signed-off-by: Daniel Walter <dwalter@google.com>
Reviewed-by: James Hogan <james.hogan@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/7150/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/rb532')
-rw-r--r-- | arch/mips/rb532/devices.c | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/arch/mips/rb532/devices.c b/arch/mips/rb532/devices.c index 3af00b2a26ee..03a4cdc80226 100644 --- a/arch/mips/rb532/devices.c +++ b/arch/mips/rb532/devices.c | |||
@@ -250,28 +250,6 @@ static struct platform_device *rb532_devs[] = { | |||
250 | &rb532_wdt | 250 | &rb532_wdt |
251 | }; | 251 | }; |
252 | 252 | ||
253 | static void __init parse_mac_addr(char *macstr) | ||
254 | { | ||
255 | int i, h, l; | ||
256 | |||
257 | for (i = 0; i < 6; i++) { | ||
258 | if (i != 5 && *(macstr + 2) != ':') | ||
259 | return; | ||
260 | |||
261 | h = hex_to_bin(*macstr++); | ||
262 | if (h == -1) | ||
263 | return; | ||
264 | |||
265 | l = hex_to_bin(*macstr++); | ||
266 | if (l == -1) | ||
267 | return; | ||
268 | |||
269 | macstr++; | ||
270 | korina_dev0_data.mac[i] = (h << 4) + l; | ||
271 | } | ||
272 | } | ||
273 | |||
274 | |||
275 | /* NAND definitions */ | 253 | /* NAND definitions */ |
276 | #define NAND_CHIP_DELAY 25 | 254 | #define NAND_CHIP_DELAY 25 |
277 | 255 | ||
@@ -333,7 +311,10 @@ static int __init plat_setup_devices(void) | |||
333 | static int __init setup_kmac(char *s) | 311 | static int __init setup_kmac(char *s) |
334 | { | 312 | { |
335 | printk(KERN_INFO "korina mac = %s\n", s); | 313 | printk(KERN_INFO "korina mac = %s\n", s); |
336 | parse_mac_addr(s); | 314 | if (!mac_pton(s, korina_dev0_data.mac)) { |
315 | printk(KERN_ERR "Invalid mac\n"); | ||
316 | return -EINVAL; | ||
317 | } | ||
337 | return 0; | 318 | return 0; |
338 | } | 319 | } |
339 | 320 | ||