aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/atm/speedtch.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/usb/atm/speedtch.c b/drivers/usb/atm/speedtch.c
index 1e9ba4bdffef..1335456b4f93 100644
--- a/drivers/usb/atm/speedtch.c
+++ b/drivers/usb/atm/speedtch.c
@@ -127,8 +127,6 @@ MODULE_PARM_DESC(ModemOption, "default: 0x10,0x00,0x00,0x00,0x20");
127#define ENDPOINT_ISOC_DATA 0x07 127#define ENDPOINT_ISOC_DATA 0x07
128#define ENDPOINT_FIRMWARE 0x05 128#define ENDPOINT_FIRMWARE 0x05
129 129
130#define hex2int(c) ( (c >= '0') && (c <= '9') ? (c - '0') : ((c & 0xf) + 9) )
131
132struct speedtch_params { 130struct speedtch_params {
133 unsigned int altsetting; 131 unsigned int altsetting;
134 unsigned int BMaxDSL; 132 unsigned int BMaxDSL;
@@ -669,7 +667,8 @@ static int speedtch_atm_start(struct usbatm_data *usbatm, struct atm_dev *atm_de
669 memset(atm_dev->esi, 0, sizeof(atm_dev->esi)); 667 memset(atm_dev->esi, 0, sizeof(atm_dev->esi));
670 if (usb_string(usb_dev, usb_dev->descriptor.iSerialNumber, mac_str, sizeof(mac_str)) == 12) { 668 if (usb_string(usb_dev, usb_dev->descriptor.iSerialNumber, mac_str, sizeof(mac_str)) == 12) {
671 for (i = 0; i < 6; i++) 669 for (i = 0; i < 6; i++)
672 atm_dev->esi[i] = (hex2int(mac_str[i * 2]) * 16) + (hex2int(mac_str[i * 2 + 1])); 670 atm_dev->esi[i] = (hex_to_bin(mac_str[i * 2]) << 4) +
671 hex_to_bin(mac_str[i * 2 + 1]);
673 } 672 }
674 673
675 /* Start modem synchronisation */ 674 /* Start modem synchronisation */