[debug] add config && fix build issue

This commit is contained in:
Yunlong Xiao 2022-06-22 18:30:30 +00:00
parent eeefb1054a
commit 8d017ba460
2 changed files with 6 additions and 2 deletions

View File

@ -11,6 +11,7 @@ CONFIG_CGROUP_SCHED=y
CONFIG_RT_GROUP_SCHED=y
CONFIG_NAMESPACES=y
#CONFIG_BLK_DEV_INITRD is not set
CONFIG_LEDS_CLASS_AVS_UX=y
# CONFIG_SYSCTL_SYSCALL is not set
CONFIG_EMBEDDED=y
# CONFIG_SLUB_DEBUG is not set

View File

@ -43,6 +43,7 @@ static int avsux_parse_pattern(struct led_avsux_animation *animation, char *buf,
char *line, *duration, *hex;
u32 rgb;
int idx;
int ret;
char *next_line = buf;
if (!buf)
@ -60,10 +61,12 @@ static int avsux_parse_pattern(struct led_avsux_animation *animation, char *buf,
if (line) {
pattern = kzalloc(sizeof(struct led_avsux_pattern), GFP_KERNEL);
if (pattern) {
kstrtou32(duration, 10, &pattern->duration);
ret = kstrtou32(duration, 10, &pattern->duration);
if(ret < 0) return ret; // add by kk
idx = 0;
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++]);
if (idx >= MAX_NUM_LEDS)
break;