From 8d017ba46037d95a1750533558d2c94846219d7e Mon Sep 17 00:00:00 2001 From: Yunlong Xiao Date: Wed, 22 Jun 2022 18:30:30 +0000 Subject: [PATCH] [debug] add config && fix build issue --- .../arm64/configs/aud8516p1v2_consys_slc_yocto_defconfig | 1 + src/kernel/linux/v4.4/drivers/leds/led-class-avsux.c | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/kernel/linux/v4.4/arch/arm64/configs/aud8516p1v2_consys_slc_yocto_defconfig b/src/kernel/linux/v4.4/arch/arm64/configs/aud8516p1v2_consys_slc_yocto_defconfig index d4ccaf279..b4d6f9026 100644 --- a/src/kernel/linux/v4.4/arch/arm64/configs/aud8516p1v2_consys_slc_yocto_defconfig +++ b/src/kernel/linux/v4.4/arch/arm64/configs/aud8516p1v2_consys_slc_yocto_defconfig @@ -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 diff --git a/src/kernel/linux/v4.4/drivers/leds/led-class-avsux.c b/src/kernel/linux/v4.4/drivers/leds/led-class-avsux.c index 35a1d28f4..3f82cd249 100755 --- a/src/kernel/linux/v4.4/drivers/leds/led-class-avsux.c +++ b/src/kernel/linux/v4.4/drivers/leds/led-class-avsux.c @@ -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;