Changeset 38090


Ignore:
Timestamp:
2013-09-20T18:41:36+02:00 (4 years ago)
Author:
juhosg
Message:

ar71xx: tew-712br: use ath79_parse_ascii_mac helper

Remove the local MAC address parser function and use
the generic one instead.

Signed-off-by: Gabor Juhos <juhosg@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/ar71xx/files/arch/mips/ath79/mach-tew-712br.c

    r33231 r38090  
    4343#define TEW_712BR_ART_ADDRESS           0x1f010000 
    4444#define TEW_712BR_CALDATA_OFFSET        0x1000 
    45 #define TEW_712BR_LAN_MAC_ADDRESS       0x1f020004 
    46 #define TEW_712BR_WAN_MAC_ADDRESS       0x1f020016 
     45 
     46#define TEW_712BR_MAC_PART_ADDRESS      0x1f020000 
     47#define TEW_712BR_LAN_MAC_OFFSET        0x04 
     48#define TEW_712BR_WAN_MAC_OFFSET        0x16 
    4749 
    4850static struct gpio_led tew_712br_leds_gpio[] __initdata = { 
     
    108110}; 
    109111 
    110 static void __init tew_712br_read_ascii_mac(u8 *dest, unsigned int src_addr) 
    111 { 
    112         int ret; 
    113         u8 *src = (u8 *)KSEG1ADDR(src_addr); 
    114  
    115         ret = sscanf(src, "%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx", 
    116                      &dest[0], &dest[1], &dest[2], 
    117                      &dest[3], &dest[4], &dest[5]); 
    118  
    119         if (ret != ETH_ALEN) 
    120                 memset(dest, 0, ETH_ALEN); 
    121 } 
    122  
    123112static void __init tew_712br_setup(void) 
    124113{ 
    125114        u8 *art = (u8 *) KSEG1ADDR(TEW_712BR_ART_ADDRESS); 
     115        u8 *mac = (u8 *) KSEG1ADDR(TEW_712BR_MAC_PART_ADDRESS); 
    126116        u8 lan_mac[ETH_ALEN]; 
    127117        u8 wan_mac[ETH_ALEN]; 
     
    147137        ath79_register_m25p80(NULL); 
    148138 
    149         tew_712br_read_ascii_mac(lan_mac, TEW_712BR_LAN_MAC_ADDRESS); 
    150         tew_712br_read_ascii_mac(wan_mac, TEW_712BR_WAN_MAC_ADDRESS); 
     139        ath79_parse_ascii_mac(mac + TEW_712BR_LAN_MAC_OFFSET, lan_mac); 
     140        ath79_parse_ascii_mac(mac + TEW_712BR_WAN_MAC_OFFSET, wan_mac); 
    151141 
    152142        ath79_init_mac(ath79_eth0_data.mac_addr, wan_mac, 0); 
Note: See TracChangeset for help on using the changeset viewer.