mainboard: Use read_int_option()

Change-Id: I9273b90b6a21b8f52fa42d9ff03a9b56eec9fcbf
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/47137
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
diff --git a/src/mainboard/dell/optiplex_9010/sch5545_ec.c b/src/mainboard/dell/optiplex_9010/sch5545_ec.c
index 8110963..db13495 100644
--- a/src/mainboard/dell/optiplex_9010/sch5545_ec.c
+++ b/src/mainboard/dell/optiplex_9010/sch5545_ec.c
@@ -603,7 +603,7 @@
 
 void sch5545_ec_hwm_init(void *unused)
 {
-	uint8_t val = 0, val_2fc, chassis_type, fan_speed_full = 0;
+	uint8_t val = 0, val_2fc, chassis_type;
 
 	printk(BIOS_DEBUG, "%s\n", __func__);
 	sch5545_emi_init(0x2e);
@@ -656,9 +656,12 @@
 
 	ec_read_write_reg(EC_HWM_LDN, 0x02fc, &val_2fc, WRITE_OP);
 
-	if (get_option(&fan_speed_full, "fan_full_speed") != CB_SUCCESS)
+	int fan_speed_full = get_int_option("fan_full_speed", -1);
+	if (fan_speed_full < 0) {
+		fan_speed_full = 0;
 		printk(BIOS_INFO, "fan_full_speed CMOS option not found. "
 				  "Fans will be set up for automatic control\n");
+	}
 
 	if (fan_speed_full) {
 		ec_read_write_reg(EC_HWM_LDN, 0x0080, &val, READ_OP);