summaryrefslogtreecommitdiff
path: root/src/include/pc80
diff options
context:
space:
mode:
authorAlexandru Gagniuc <mr.nuke.me@gmail.com>2013-11-23 18:54:44 -0600
committerAlexandru Gagniuc <mr.nuke.me@gmail.com>2013-11-25 23:59:59 +0100
commitd7134e06b1b1ac21108b23438604b7385e4a43fa (patch)
treeaf710fa02c9dc7a87593aa22627e34fc89eca571 /src/include/pc80
parentfe9e30d6b74e340f9a97b9e358e20ec8a2785954 (diff)
pc80/mc146818rtc: Return an error code rather than an integer
Do not return hardcoded numerical values to communicate succes/failure, but instead use an enumeration. Change-Id: I742b08796adf136dce5984b702533f91640846dd Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-on: http://review.coreboot.org/4265 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Diffstat (limited to 'src/include/pc80')
-rw-r--r--src/include/pc80/mc146818rtc.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/include/pc80/mc146818rtc.h b/src/include/pc80/mc146818rtc.h
index 170a433d8d..ef48a361d3 100644
--- a/src/include/pc80/mc146818rtc.h
+++ b/src/include/pc80/mc146818rtc.h
@@ -1,6 +1,8 @@
#ifndef PC80_MC146818RTC_H
#define PC80_MC146818RTC_H
+#include <types.h>
+
#ifndef RTC_BASE_PORT
#define RTC_BASE_PORT 0x70
#endif
@@ -171,13 +173,16 @@ static inline void cmos_write32(u8 offset, u32 value)
void rtc_init(int invalid);
void rtc_check_update_cmos_date(u8 has_century);
#if CONFIG_USE_OPTION_TABLE
-int set_option(const char *name, void *val);
-int get_option(void *dest, const char *name);
+enum cb_err set_option(const char *name, void *val);
+enum cb_err get_option(void *dest, const char *name);
unsigned read_option_lowlevel(unsigned start, unsigned size, unsigned def);
#else
-static inline int set_option(const char *name __attribute__((unused)), void *val __attribute__((unused))) { return -2; };
-static inline int get_option(void *dest __attribute__((unused)),
- const char *name __attribute__((unused))) { return -2; }
+static inline enum cb_err set_option(const char *name __attribute__((unused)),
+ void *val __attribute__((unused)))
+ { return CB_CMOS_OTABLE_DISABLED; };
+static inline enum cb_err get_option(void *dest __attribute__((unused)),
+ const char *name __attribute__((unused)))
+ { return CB_CMOS_OTABLE_DISABLED; }
#define read_option_lowlevel(start, size, def) def
#endif
#else