diff mbox series

firmware: scmi: return a right errno for SCMI status code

Message ID 20230613013045.36684-1-takahiro.akashi@linaro.org
State Accepted
Commit b1d774bb8749151293a700173c79b9501ac72a2c
Headers show
Series firmware: scmi: return a right errno for SCMI status code | expand

Commit Message

AKASHI Takahiro June 13, 2023, 1:30 a.m. UTC
scmi_to_linux_errno() is set to return an appropriate errno
which corresponds to a given SCMI status code.
But the current implementation always returns the same value.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
---
 drivers/firmware/scmi/scmi_agent-uclass.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

AKASHI Takahiro July 14, 2023, 12:55 a.m. UTC | #1
Hi Tom,

Can you pick up this patch, please?
It's an easy bugfix.

-Takahiro Akashi

On Tue, Jun 13, 2023 at 10:30:45AM +0900, AKASHI Takahiro wrote:
> scmi_to_linux_errno() is set to return an appropriate errno
> which corresponds to a given SCMI status code.
> But the current implementation always returns the same value.
> 
> Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
> ---
>  drivers/firmware/scmi/scmi_agent-uclass.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/firmware/scmi/scmi_agent-uclass.c b/drivers/firmware/scmi/scmi_agent-uclass.c
> index 54d563d929b8..02de692d66f3 100644
> --- a/drivers/firmware/scmi/scmi_agent-uclass.c
> +++ b/drivers/firmware/scmi/scmi_agent-uclass.c
> @@ -46,7 +46,7 @@ int scmi_to_linux_errno(s32 scmi_code)
>  
>  	for (n = 0; n < ARRAY_SIZE(scmi_linux_errmap); n++)
>  		if (scmi_code == scmi_linux_errmap[n].scmi)
> -			return scmi_linux_errmap[1].errno;
> +			return scmi_linux_errmap[n].errno;
>  
>  	return -EPROTO;
>  }
> -- 
> 2.41.0
>
Tom Rini July 15, 2023, 3:03 p.m. UTC | #2
On Tue, Jun 13, 2023 at 10:30:45AM +0900, AKASHI Takahiro wrote:

> scmi_to_linux_errno() is set to return an appropriate errno
> which corresponds to a given SCMI status code.
> But the current implementation always returns the same value.
> 
> Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/drivers/firmware/scmi/scmi_agent-uclass.c b/drivers/firmware/scmi/scmi_agent-uclass.c
index 54d563d929b8..02de692d66f3 100644
--- a/drivers/firmware/scmi/scmi_agent-uclass.c
+++ b/drivers/firmware/scmi/scmi_agent-uclass.c
@@ -46,7 +46,7 @@  int scmi_to_linux_errno(s32 scmi_code)
 
 	for (n = 0; n < ARRAY_SIZE(scmi_linux_errmap); n++)
 		if (scmi_code == scmi_linux_errmap[n].scmi)
-			return scmi_linux_errmap[1].errno;
+			return scmi_linux_errmap[n].errno;
 
 	return -EPROTO;
 }