summaryrefslogtreecommitdiff
path: root/drivers/staging/panel
diff options
context:
space:
mode:
authorAndy Shevchenko <andy.shevchenko@gmail.com>2010-07-22 19:57:08 +0300
committerGreg Kroah-Hartman <gregkh@suse.de>2010-07-22 11:34:52 -0700
commitd85170ed30a533ef6832cf11b38488e562c311c8 (patch)
tree24050d623034199bec9cba20f91eaacc5f746a0f /drivers/staging/panel
parent47c7157f3406e83648dad1c5c4e6e8c0f574dfc3 (diff)
staging: panel: change own pieces of code by strtoul()
We have nice method simple_strtoul() to convert string to numbers which could be used here. Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/panel')
-rw-r--r--drivers/staging/panel/panel.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/staging/panel/panel.c b/drivers/staging/panel/panel.c
index 8bd7182195b3..3e07e41eb885 100644
--- a/drivers/staging/panel/panel.c
+++ b/drivers/staging/panel/panel.c
@@ -48,6 +48,7 @@
#include <linux/fcntl.h>
#include <linux/init.h>
#include <linux/delay.h>
+#include <linux/kernel.h>
#include <linux/ctype.h>
#include <linux/parport.h>
#include <linux/version.h>
@@ -1179,22 +1180,16 @@ static inline int handle_lcd_special_code(void)
break;
while (*esc) {
+ char *endp;
+
if (*esc == 'x') {
esc++;
- lcd_addr_x = 0;
- while (isdigit(*esc)) {
- lcd_addr_x = lcd_addr_x * 10 +
- (*esc - '0');
- esc++;
- }
+ lcd_addr_x = simple_strtoul(esc, &endp, 10);
+ esc = endp;
} else if (*esc == 'y') {
esc++;
- lcd_addr_y = 0;
- while (isdigit(*esc)) {
- lcd_addr_y = lcd_addr_y * 10 +
- (*esc - '0');
- esc++;
- }
+ lcd_addr_y = simple_strtoul(esc, &endp, 10);
+ esc = endp;
} else
break;
}