diff options
author | Andy Shevchenko <ext-andriy.shevchenko@nokia.com> | 2009-09-24 06:58:09 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-12-05 15:41:01 -0500 |
commit | 2d8d7762d75d36a08a4a5c3d3f1c301f76cb8f56 (patch) | |
tree | 76f642b232cef9f67383d117223a0328458c077c /drivers/media/video | |
parent | e67e376b1e50b60238410893971c5e6c4dd19ef1 (diff) |
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>
Diffstat (limited to 'drivers/media/video')
-rw-r--r-- | drivers/media/video/pwc/pwc-if.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/drivers/media/video/pwc/pwc-if.c b/drivers/media/video/pwc/pwc-if.c index f976df452a3..89b620f6db7 100644 --- a/drivers/media/video/pwc/pwc-if.c +++ b/drivers/media/video/pwc/pwc-if.c | |||
@@ -68,6 +68,7 @@ | |||
68 | #endif | 68 | #endif |
69 | #include <linux/vmalloc.h> | 69 | #include <linux/vmalloc.h> |
70 | #include <asm/io.h> | 70 | #include <asm/io.h> |
71 | #include <linux/kernel.h> /* simple_strtol() */ | ||
71 | 72 | ||
72 | #include "pwc.h" | 73 | #include "pwc.h" |
73 | #include "pwc-kiara.h" | 74 | #include "pwc-kiara.h" |
@@ -1916,19 +1917,6 @@ disconnect_out: | |||
1916 | unlock_kernel(); | 1917 | unlock_kernel(); |
1917 | } | 1918 | } |
1918 | 1919 | ||
1919 | /* *grunt* We have to do atoi ourselves :-( */ | ||
1920 | static int pwc_atoi(const char *s) | ||
1921 | { | ||
1922 | int k = 0; | ||
1923 | |||
1924 | k = 0; | ||
1925 | while (*s != '\0' && *s >= '0' && *s <= '9') { | ||
1926 | k = 10 * k + (*s - '0'); | ||
1927 | s++; | ||
1928 | } | ||
1929 | return k; | ||
1930 | } | ||
1931 | |||
1932 | 1920 | ||
1933 | /* | 1921 | /* |
1934 | * Initialization code & module stuff | 1922 | * Initialization code & module stuff |
@@ -2078,13 +2066,16 @@ static int __init usb_pwc_init(void) | |||
2078 | } | 2066 | } |
2079 | else { | 2067 | else { |
2080 | /* No type or serial number specified, just a number. */ | 2068 | /* No type or serial number specified, just a number. */ |
2081 | device_hint[i].device_node = pwc_atoi(s); | 2069 | device_hint[i].device_node = |
2070 | simple_strtol(s, NULL, 10); | ||
2082 | } | 2071 | } |
2083 | } | 2072 | } |
2084 | else { | 2073 | else { |
2085 | /* There's a colon, so we have at least a type and a device node */ | 2074 | /* There's a colon, so we have at least a type and a device node */ |
2086 | device_hint[i].type = pwc_atoi(s); | 2075 | device_hint[i].type = |
2087 | device_hint[i].device_node = pwc_atoi(colon + 1); | 2076 | simple_strtol(s, NULL, 10); |
2077 | device_hint[i].device_node = | ||
2078 | simple_strtol(colon + 1, NULL, 10); | ||
2088 | if (*dot != '\0') { | 2079 | if (*dot != '\0') { |
2089 | /* There's a serial number as well */ | 2080 | /* There's a serial number as well */ |
2090 | int k; | 2081 | int k; |