From b2e8e6986d676005f23fc5e3b3845b027fc4330f Mon Sep 17 00:00:00 2001 From: Himanshu Chauhan Date: Thu, 20 Feb 2025 14:44:41 +0530 Subject: [PATCH] lib: sbi: Return SBI_EALREADY error code if SSE event is present Return SBI_EALREADY error code instead of SBI_EINVAL, in case an event is already added to the supported list. Signed-off-by: Himanshu Chauhan Reviewed-by: Anup Patel --- 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 2f9bdef8..ff2745a3 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;