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 #include #include +#include #include #include #include @@ -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; }