[PATCH] lib: sbi: Return SBI_EALREADY error code if SSE event is present
Himanshu Chauhan
hchauhan at ventanamicro.com
Thu Feb 20 01:14:41 PST 2025
Return SBI_EALREADY error code instead of SBI_INVAL, in case an
event is already added to the supported list.
Signed-off-by: Himanshu Chauhan <hchauhan at ventanamicro.com>
---
lib/sbi/sbi_sse.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/sbi/sbi_sse.c b/lib/sbi/sbi_sse.c
index 9f22375..295d9bc 100644
--- a/lib/sbi/sbi_sse.c
+++ b/lib/sbi/sbi_sse.c
@@ -926,7 +926,7 @@ int sbi_sse_add_event(uint32_t event_id, const struct sbi_sse_cb_ops *cb_ops)
/* Do not allow adding an event twice */
info = sse_event_info_get(event_id);
if (info)
- return SBI_EINVAL;
+ return SBI_EALREADY;
if (cb_ops && cb_ops->set_hartid_cb && !EVENT_IS_GLOBAL(event_id))
return SBI_EINVAL;
--
2.43.0
More information about the opensbi
mailing list