Bluetooth: bt3c_cs: Fix obsolete function
simple_strtol and simple_strtoul are obsolete, both place use kstrtouint instead. V2: fix error tmp += tn V3: fix compile error Signed-off-by: Ding Xiang <dingxiang@cmss.chinamobile.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
This commit is contained in:
parent
7cbfd1e2aa
commit
385613506a
|
@ -448,7 +448,7 @@ static int bt3c_load_firmware(struct bt3c_info *info,
|
||||||
{
|
{
|
||||||
char *ptr = (char *) firmware;
|
char *ptr = (char *) firmware;
|
||||||
char b[9];
|
char b[9];
|
||||||
unsigned int iobase, tmp;
|
unsigned int iobase, tmp, tn;
|
||||||
unsigned long size, addr, fcs;
|
unsigned long size, addr, fcs;
|
||||||
int i, err = 0;
|
int i, err = 0;
|
||||||
|
|
||||||
|
@ -490,7 +490,9 @@ static int bt3c_load_firmware(struct bt3c_info *info,
|
||||||
memset(b, 0, sizeof(b));
|
memset(b, 0, sizeof(b));
|
||||||
for (tmp = 0, i = 0; i < size; i++) {
|
for (tmp = 0, i = 0; i < size; i++) {
|
||||||
memcpy(b, ptr + (i * 2) + 2, 2);
|
memcpy(b, ptr + (i * 2) + 2, 2);
|
||||||
tmp += simple_strtol(b, NULL, 16);
|
if (kstrtouint(b, 16, &tn))
|
||||||
|
return -EINVAL;
|
||||||
|
tmp += tn;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((tmp + fcs) & 0xff) != 0xff) {
|
if (((tmp + fcs) & 0xff) != 0xff) {
|
||||||
|
@ -505,7 +507,8 @@ static int bt3c_load_firmware(struct bt3c_info *info,
|
||||||
memset(b, 0, sizeof(b));
|
memset(b, 0, sizeof(b));
|
||||||
for (i = 0; i < (size - 4) / 2; i++) {
|
for (i = 0; i < (size - 4) / 2; i++) {
|
||||||
memcpy(b, ptr + (i * 4) + 12, 4);
|
memcpy(b, ptr + (i * 4) + 12, 4);
|
||||||
tmp = simple_strtoul(b, NULL, 16);
|
if (kstrtouint(b, 16, &tmp))
|
||||||
|
return -EINVAL;
|
||||||
bt3c_put(iobase, tmp);
|
bt3c_put(iobase, tmp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue