]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
firmware: scmi: return a right errno for SCMI status code
authorAKASHI Takahiro <takahiro.akashi@linaro.org>
Tue, 13 Jun 2023 01:30:45 +0000 (10:30 +0900)
committerTom Rini <trini@konsulko.com>
Fri, 14 Jul 2023 19:21:07 +0000 (15:21 -0400)
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

index 54d563d929b89fb5090d38dcd26039072e654750..02de692d66f3efb6275e5c9939d613b6cd1cb86c 100644 (file)
@@ -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;
 }