Skip to content

Commit 5b37065

Browse files
avpatelPaul Walmsley
authored andcommitted
ACPI: RISC-V: Fix FFH_CPPC_CSR error handling
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: 30f3ffb ("ACPI: RISC-V: Add CPPC driver") Signed-off-by: Anup Patel <[email protected]> Reviewed-by: Andrew Jones <[email protected]> Reviewed-by: Troy Mitchell <[email protected]> Reviewed-by: Sunil V L <[email protected]> Reviewed-by: Nutty Liu <[email protected]> Reviewed-by: Atish Patra <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Paul Walmsley <[email protected]>
1 parent 41f9049 commit 5b37065

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/acpi/riscv/cppc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ int cpc_read_ffh(int cpu, struct cpc_reg *reg, u64 *val)
119119

120120
*val = data.ret.value;
121121

122-
return (data.ret.error) ? sbi_err_map_linux_errno(data.ret.error) : 0;
122+
return data.ret.error;
123123
}
124124

125125
return -EINVAL;
@@ -148,7 +148,7 @@ int cpc_write_ffh(int cpu, struct cpc_reg *reg, u64 val)
148148

149149
smp_call_function_single(cpu, cppc_ffh_csr_write, &data, 1);
150150

151-
return (data.ret.error) ? sbi_err_map_linux_errno(data.ret.error) : 0;
151+
return data.ret.error;
152152
}
153153

154154
return -EINVAL;

0 commit comments

Comments
 (0)