summaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth/bt3c_cs.c
diff options
context:
space:
mode:
authorPrasanna Karthik <mkarthi3@visteon.com>2015-09-11 15:02:36 +0000
committerMarcel Holtmann <marcel@holtmann.org>2015-09-17 13:20:07 +0200
commit10bd9731cc7257a6f53c0a208003414d872d627e (patch)
tree8bd94d66fff66473d14d3a5f18ff9699c23dda76 /drivers/bluetooth/bt3c_cs.c
parent8f9d02f470f48416444ac3a1eacecdd0f743f1a7 (diff)
downloadop-kernel-dev-10bd9731cc7257a6f53c0a208003414d872d627e.zip
op-kernel-dev-10bd9731cc7257a6f53c0a208003414d872d627e.tar.gz
Bluetooth: bt3c_cs: clean up obsolete functions
simple_strtoul is obsolete, use kstrtoul instead reported by checkpatch. Signed-off-by: Prasanna Karthik <mkarthi3@visteon.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/bluetooth/bt3c_cs.c')
-rw-r--r--drivers/bluetooth/bt3c_cs.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c
index a00bb82..772a277 100644
--- a/drivers/bluetooth/bt3c_cs.c
+++ b/drivers/bluetooth/bt3c_cs.c
@@ -453,7 +453,8 @@ static int bt3c_load_firmware(struct bt3c_info *info,
{
char *ptr = (char *) firmware;
char b[9];
- unsigned int iobase, size, addr, fcs, tmp;
+ unsigned int iobase, tmp;
+ unsigned long size, addr, fcs;
int i, err = 0;
iobase = info->p_dev->resource[0]->start;
@@ -478,15 +479,18 @@ static int bt3c_load_firmware(struct bt3c_info *info,
memset(b, 0, sizeof(b));
memcpy(b, ptr + 2, 2);
- size = simple_strtoul(b, NULL, 16);
+ if (kstrtoul(b, 16, &size) < 0)
+ return -EINVAL;
memset(b, 0, sizeof(b));
memcpy(b, ptr + 4, 8);
- addr = simple_strtoul(b, NULL, 16);
+ if (kstrtoul(b, 16, &addr) < 0)
+ return -EINVAL;
memset(b, 0, sizeof(b));
memcpy(b, ptr + (size * 2) + 2, 2);
- fcs = simple_strtoul(b, NULL, 16);
+ if (kstrtoul(b, 16, &fcs) < 0)
+ return -EINVAL;
memset(b, 0, sizeof(b));
for (tmp = 0, i = 0; i < size; i++) {
OpenPOWER on IntegriCloud