UPSTREAM: drivers/elog: provide return status for all operations
Instead of relying on global state to determine if an error occurred provide the ability to know if an add or shrink operation is successful. Now the call chains report the error back up the stack and out to the callers. BUG=chrome-os-partner:55932 BRANCH=None TEST=None Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://review.coreboot.org/16104 Reviewed-by: Furquan Shaikh <furquan@google.com> Change-Id: Id4ed4d93e331f1bf16e038df69ef067446d00102 Reviewed-on: https://chromium-review.googlesource.com/369087 Commit-Ready: Furquan Shaikh <furquan@chromium.org> Tested-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
parent
6889096d2f
commit
de14ed31c5
2 changed files with 36 additions and 38 deletions
|
|
@ -146,23 +146,24 @@ struct elog_event_data_me_extended {
|
|||
/* Eventlog backing storage must be initialized before calling elog_init(). */
|
||||
extern int elog_init(void);
|
||||
extern int elog_clear(void);
|
||||
extern void elog_add_event_raw(u8 event_type, void *data, u8 data_size);
|
||||
extern void elog_add_event(u8 event_type);
|
||||
extern void elog_add_event_byte(u8 event_type, u8 data);
|
||||
extern void elog_add_event_word(u8 event_type, u16 data);
|
||||
extern void elog_add_event_dword(u8 event_type, u32 data);
|
||||
extern void elog_add_event_wake(u8 source, u32 instance);
|
||||
/* Event addition functions return < 0 on failure and 0 on success. */
|
||||
extern int elog_add_event_raw(u8 event_type, void *data, u8 data_size);
|
||||
extern int elog_add_event(u8 event_type);
|
||||
extern int elog_add_event_byte(u8 event_type, u8 data);
|
||||
extern int elog_add_event_word(u8 event_type, u16 data);
|
||||
extern int elog_add_event_dword(u8 event_type, u32 data);
|
||||
extern int elog_add_event_wake(u8 source, u32 instance);
|
||||
extern int elog_smbios_write_type15(unsigned long *current, int handle);
|
||||
#else
|
||||
/* Stubs to help avoid littering sources with #if CONFIG_ELOG */
|
||||
static inline int elog_init(void) { return -1; }
|
||||
static inline int elog_clear(void) { return -1; }
|
||||
static inline void elog_add_event_raw(void) { return; }
|
||||
static inline void elog_add_event(u8 event_type) { return; }
|
||||
static inline void elog_add_event_byte(u8 event_type, u8 data) { return; }
|
||||
static inline void elog_add_event_word(u8 event_type, u16 data) { return; }
|
||||
static inline void elog_add_event_dword(u8 event_type, u32 data) { return; }
|
||||
static inline void elog_add_event_wake(u8 source, u32 instance) { return; }
|
||||
static inline int elog_add_event_raw(void) { return 0; }
|
||||
static inline int elog_add_event(u8 event_type) { return 0; }
|
||||
static inline int elog_add_event_byte(u8 event_type, u8 data) { return 0; }
|
||||
static inline int elog_add_event_word(u8 event_type, u16 data) { return 0; }
|
||||
static inline int elog_add_event_dword(u8 event_type, u32 data) { return 0; }
|
||||
static inline int elog_add_event_wake(u8 source, u32 instance) { return 0; }
|
||||
static inline int elog_smbios_write_type15(unsigned long *current,
|
||||
int handle) {
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue