[debug] add config && fix build issue
This commit is contained in:
parent
eeefb1054a
commit
8d017ba460
|
@ -11,6 +11,7 @@ CONFIG_CGROUP_SCHED=y
|
||||||
CONFIG_RT_GROUP_SCHED=y
|
CONFIG_RT_GROUP_SCHED=y
|
||||||
CONFIG_NAMESPACES=y
|
CONFIG_NAMESPACES=y
|
||||||
#CONFIG_BLK_DEV_INITRD is not set
|
#CONFIG_BLK_DEV_INITRD is not set
|
||||||
|
CONFIG_LEDS_CLASS_AVS_UX=y
|
||||||
# CONFIG_SYSCTL_SYSCALL is not set
|
# CONFIG_SYSCTL_SYSCALL is not set
|
||||||
CONFIG_EMBEDDED=y
|
CONFIG_EMBEDDED=y
|
||||||
# CONFIG_SLUB_DEBUG is not set
|
# CONFIG_SLUB_DEBUG is not set
|
||||||
|
|
|
@ -43,6 +43,7 @@ static int avsux_parse_pattern(struct led_avsux_animation *animation, char *buf,
|
||||||
char *line, *duration, *hex;
|
char *line, *duration, *hex;
|
||||||
u32 rgb;
|
u32 rgb;
|
||||||
int idx;
|
int idx;
|
||||||
|
int ret;
|
||||||
char *next_line = buf;
|
char *next_line = buf;
|
||||||
|
|
||||||
if (!buf)
|
if (!buf)
|
||||||
|
@ -60,10 +61,12 @@ static int avsux_parse_pattern(struct led_avsux_animation *animation, char *buf,
|
||||||
if (line) {
|
if (line) {
|
||||||
pattern = kzalloc(sizeof(struct led_avsux_pattern), GFP_KERNEL);
|
pattern = kzalloc(sizeof(struct led_avsux_pattern), GFP_KERNEL);
|
||||||
if (pattern) {
|
if (pattern) {
|
||||||
kstrtou32(duration, 10, &pattern->duration);
|
ret = kstrtou32(duration, 10, &pattern->duration);
|
||||||
|
if(ret < 0) return ret; // add by kk
|
||||||
idx = 0;
|
idx = 0;
|
||||||
while ((hex = strsep(&line, ",")) != NULL) {
|
while ((hex = strsep(&line, ",")) != NULL) {
|
||||||
kstrtou32(hex, 16, &rgb);
|
ret = kstrtou32(hex, 16, &rgb);
|
||||||
|
if(ret < 0) return ret; // add by kk
|
||||||
avsux_parse_rgb(rgb, &pattern->colors[idx++]);
|
avsux_parse_rgb(rgb, &pattern->colors[idx++]);
|
||||||
if (idx >= MAX_NUM_LEDS)
|
if (idx >= MAX_NUM_LEDS)
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue