aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/pwc/pwc-if.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/pwc/pwc-if.c')
-rw-r--r--drivers/media/video/pwc/pwc-if.c23
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 f976df452a34..89b620f6db7b 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 :-( */
1920static 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;