From a35f1810a238f92cdac50524f89a006ec3cddb13 Mon Sep 17 00:00:00 2001 From: Angel Pons Date: Mon, 26 Apr 2021 16:49:40 +0200 Subject: superio/nuvoton/npcd378: Fall back to non-negative value This change is needed to update the option API to use unsigned integers. The CMOS option system does not support negative numbers. So, adjust the call to get_int_option() to use 3 as fallback instead of -1. Change-Id: I46c5f5c6f47f99379cbafc0d60258b99dc512e9d Signed-off-by: Angel Pons Reviewed-on: https://review.coreboot.org/c/coreboot/+/52671 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Rudolph Reviewed-by: Nico Huber --- src/superio/nuvoton/npcd378/superio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/superio/nuvoton/npcd378/superio.c') diff --git a/src/superio/nuvoton/npcd378/superio.c b/src/superio/nuvoton/npcd378/superio.c index 6a56ac8b89..36458329a8 100644 --- a/src/superio/nuvoton/npcd378/superio.c +++ b/src/superio/nuvoton/npcd378/superio.c @@ -68,8 +68,8 @@ static void npcd378_init(struct device *dev) npcd378_hwm_write_start(res->base); - int fan_lvl = get_int_option("psu_fan_lvl", -1); - if (fan_lvl < 0 || fan_lvl > 7) + unsigned int fan_lvl = get_int_option("psu_fan_lvl", 3); + if (fan_lvl > 7) fan_lvl = 3; uint8_t pwm = NPCD378_HWM_PSU_FAN_MIN + -- cgit v1.2.3