From f3dbf4ce6b38b9ebc8e0e537b49ccf1aed456435 Mon Sep 17 00:00:00 2001 From: Kyösti Mälkki Date: Sat, 4 Jan 2020 15:55:16 +0200 Subject: drivers/pc80/rtc: Clean up post_log_path() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I605d39d907e083e73af4c72607216384e7ce166a Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/coreboot/+/38190 Reviewed-by: Angel Pons Reviewed-by: Nico Huber Tested-by: build bot (Jenkins) --- src/drivers/pc80/rtc/post.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) (limited to 'src/drivers') diff --git a/src/drivers/pc80/rtc/post.c b/src/drivers/pc80/rtc/post.c index e14367424e..5bee5be812 100644 --- a/src/drivers/pc80/rtc/post.c +++ b/src/drivers/pc80/rtc/post.c @@ -86,8 +86,11 @@ void cmos_post_code(u8 value) spin_unlock(&cmos_post_lock); } -static void __unused cmos_post_extra(u32 value) +void cmos_post_extra(u32 value) { + if (!CONFIG(CMOS_POST_EXTRA)) + return; + spin_lock(&cmos_post_lock); switch (cmos_read(CMOS_POST_BANK_OFFSET)) { @@ -102,20 +105,11 @@ static void __unused cmos_post_extra(u32 value) spin_unlock(&cmos_post_lock); } -#if CONFIG(CMOS_POST_EXTRA) -void post_log_path(const struct device *dev) -{ - if (dev) { - /* Encode path into lower 3 bytes */ - u32 path = dev_path_encode(dev); - /* Upper byte contains the log type */ - path |= CMOS_POST_EXTRA_DEV_PATH << 24; - cmos_post_extra(path); - } -} - -void post_log_clear(void) +void cmos_post_path(const struct device *dev) { - cmos_post_extra(0); + /* Encode path into lower 3 bytes */ + u32 path = dev_path_encode(dev); + /* Upper byte contains the log type */ + path |= CMOS_POST_EXTRA_DEV_PATH << 24; + cmos_post_extra(path); } -#endif /* CONFIG_CMOS_POST_EXTRA */ -- cgit v1.2.3