Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

platform/x86/intel/speed_select_if: Convert PCIBIOS_* return codes to errnos

isst_if_probe() uses pci_read_config_dword() that returns PCIBIOS_*
codes. The return code is returned from the probe function as is but
probe functions should return normal errnos. A proper implementation
can be found in drivers/leds/leds-ss4200.c.

Convert PCIBIOS_* return codes using pcibios_err_to_errno() into
normal errno before returning.

Fixes: d3a23584294c ("platform/x86: ISST: Add Intel Speed Select mmio interface")
Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Link: https://patch.msgid.link/20251117033354.132-1-vulab@iscas.ac.cn
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

authored by

Haotian Zhang and committed by
Ilpo Järvinen
d8bb447e ddf5ffff

+2 -2
+2 -2
drivers/platform/x86/intel/speed_select_if/isst_if_mmio.c
··· 108 108 109 109 ret = pci_read_config_dword(pdev, 0xD0, &mmio_base); 110 110 if (ret) 111 - return ret; 111 + return pcibios_err_to_errno(ret); 112 112 113 113 ret = pci_read_config_dword(pdev, 0xFC, &pcu_base); 114 114 if (ret) 115 - return ret; 115 + return pcibios_err_to_errno(ret); 116 116 117 117 pcu_base &= GENMASK(10, 0); 118 118 base_addr = (u64)mmio_base << 23 | (u64) pcu_base << 12;