Commit df1086fb authored by Andy Shevchenko's avatar Andy Shevchenko Committed by David S. Miller

drivers/net/cxgb3/t3_hw.c: use new hex_to_bin() method

Get rid of own implementation of hex_to_bin().
Signed-off-by: default avatarAndy Shevchenko <ext-andriy.shevchenko@nokia.com>
Acked-by: default avatarDivy Le Ray <divy@chelsio.com>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 11fe8839
...@@ -679,14 +679,6 @@ int t3_seeprom_wp(struct adapter *adapter, int enable) ...@@ -679,14 +679,6 @@ int t3_seeprom_wp(struct adapter *adapter, int enable)
return t3_seeprom_write(adapter, EEPROM_STAT_ADDR, enable ? 0xc : 0); return t3_seeprom_write(adapter, EEPROM_STAT_ADDR, enable ? 0xc : 0);
} }
/*
* Convert a character holding a hex digit to a number.
*/
static unsigned int hex2int(unsigned char c)
{
return isdigit(c) ? c - '0' : toupper(c) - 'A' + 10;
}
/** /**
* get_vpd_params - read VPD parameters from VPD EEPROM * get_vpd_params - read VPD parameters from VPD EEPROM
* @adapter: adapter to read * @adapter: adapter to read
...@@ -727,15 +719,15 @@ static int get_vpd_params(struct adapter *adapter, struct vpd_params *p) ...@@ -727,15 +719,15 @@ static int get_vpd_params(struct adapter *adapter, struct vpd_params *p)
p->port_type[0] = uses_xaui(adapter) ? 1 : 2; p->port_type[0] = uses_xaui(adapter) ? 1 : 2;
p->port_type[1] = uses_xaui(adapter) ? 6 : 2; p->port_type[1] = uses_xaui(adapter) ? 6 : 2;
} else { } else {
p->port_type[0] = hex2int(vpd.port0_data[0]); p->port_type[0] = hex_to_bin(vpd.port0_data[0]);
p->port_type[1] = hex2int(vpd.port1_data[0]); p->port_type[1] = hex_to_bin(vpd.port1_data[0]);
p->xauicfg[0] = simple_strtoul(vpd.xaui0cfg_data, NULL, 16); p->xauicfg[0] = simple_strtoul(vpd.xaui0cfg_data, NULL, 16);
p->xauicfg[1] = simple_strtoul(vpd.xaui1cfg_data, NULL, 16); p->xauicfg[1] = simple_strtoul(vpd.xaui1cfg_data, NULL, 16);
} }
for (i = 0; i < 6; i++) for (i = 0; i < 6; i++)
p->eth_base[i] = hex2int(vpd.na_data[2 * i]) * 16 + p->eth_base[i] = hex_to_bin(vpd.na_data[2 * i]) * 16 +
hex2int(vpd.na_data[2 * i + 1]); hex_to_bin(vpd.na_data[2 * i + 1]);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment