]> www.infradead.org Git - users/griffoul/linux.git/commitdiff
ACPI: RISC-V: Fix FFH_CPPC_CSR error handling
authorAnup Patel <apatel@ventanamicro.com>
Mon, 18 Aug 2025 14:35:59 +0000 (20:05 +0530)
committerPaul Walmsley <pjw@kernel.org>
Thu, 4 Sep 2025 22:25:50 +0000 (16:25 -0600)
The cppc_ffh_csr_read() and cppc_ffh_csr_write() returns Linux error
code in "data->ret.error" so cpc_read_ffh() and cpc_write_ffh() must
not use sbi_err_map_linux_errno() for FFH_CPPC_CSR.

Fixes: 30f3ffbee86b ("ACPI: RISC-V: Add CPPC driver")
Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Troy Mitchell <troy.mitchell@linux.dev>
Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
Reviewed-by: Nutty Liu <nutty.liu@hotmail.com>
Reviewed-by: Atish Patra <atishp@rivosinc.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20250818143600.894385-2-apatel@ventanamicro.com
Signed-off-by: Paul Walmsley <pjw@kernel.org>
drivers/acpi/riscv/cppc.c

index 440cf9fb91aabb56152e2af61dd928a2296d59cd..42c1a90524707f22f1d03fbda1ca97b26f94ac66 100644 (file)
@@ -119,7 +119,7 @@ int cpc_read_ffh(int cpu, struct cpc_reg *reg, u64 *val)
 
                *val = data.ret.value;
 
-               return (data.ret.error) ? sbi_err_map_linux_errno(data.ret.error) : 0;
+               return data.ret.error;
        }
 
        return -EINVAL;
@@ -148,7 +148,7 @@ int cpc_write_ffh(int cpu, struct cpc_reg *reg, u64 val)
 
                smp_call_function_single(cpu, cppc_ffh_csr_write, &data, 1);
 
-               return (data.ret.error) ? sbi_err_map_linux_errno(data.ret.error) : 0;
+               return data.ret.error;
        }
 
        return -EINVAL;