mirror of
https://github.com/adulau/aha.git
synced 2024-12-30 20:56:23 +00:00
V4L/DVB (13231): pwc: Use kernel's simple_strtol()
Change own implementation of pwc_atoi() by simple_strtol(x, NULL, 10). Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com> Acked-by: Pekka Enberg <penberg@cs.helsinki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
e67e376b1e
commit
2d8d7762d7
1 changed files with 7 additions and 16 deletions
|
@ -68,6 +68,7 @@
|
|||
#endif
|
||||
#include <linux/vmalloc.h>
|
||||
#include <asm/io.h>
|
||||
#include <linux/kernel.h> /* simple_strtol() */
|
||||
|
||||
#include "pwc.h"
|
||||
#include "pwc-kiara.h"
|
||||
|
@ -1916,19 +1917,6 @@ disconnect_out:
|
|||
unlock_kernel();
|
||||
}
|
||||
|
||||
/* *grunt* We have to do atoi ourselves :-( */
|
||||
static int pwc_atoi(const char *s)
|
||||
{
|
||||
int k = 0;
|
||||
|
||||
k = 0;
|
||||
while (*s != '\0' && *s >= '0' && *s <= '9') {
|
||||
k = 10 * k + (*s - '0');
|
||||
s++;
|
||||
}
|
||||
return k;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Initialization code & module stuff
|
||||
|
@ -2078,13 +2066,16 @@ static int __init usb_pwc_init(void)
|
|||
}
|
||||
else {
|
||||
/* No type or serial number specified, just a number. */
|
||||
device_hint[i].device_node = pwc_atoi(s);
|
||||
device_hint[i].device_node =
|
||||
simple_strtol(s, NULL, 10);
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* There's a colon, so we have at least a type and a device node */
|
||||
device_hint[i].type = pwc_atoi(s);
|
||||
device_hint[i].device_node = pwc_atoi(colon + 1);
|
||||
device_hint[i].type =
|
||||
simple_strtol(s, NULL, 10);
|
||||
device_hint[i].device_node =
|
||||
simple_strtol(colon + 1, NULL, 10);
|
||||
if (*dot != '\0') {
|
||||
/* There's a serial number as well */
|
||||
int k;
|
||||
|
|
Loading…
Reference in a new issue