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

mfd: intel-m10-bmc: Move m10bmc_sys_read() away from header

Move m10bmc_sys_read() out from the header to prepare it for adding
more code into the function which would make it too large to be a
static inline any more.

While at it, replace the vague wording in function comment with more
precise statements.

Reviewed-by: Russ Weight <russell.h.weight@intel.com>
Acked-by: Guenter Roeck <linux@roeck-us.net> # For hwmon
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: Xu Yilun <yilun.xu@intel.com>
Signed-off-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/20230417092653.16487-4-ilpo.jarvinen@linux.intel.com

authored by

Ilpo Järvinen and committed by
Lee Jones
e9c154ee c452e3bd

+16 -16
+1
drivers/hwmon/intel-m10-bmc-hwmon.c
··· 794 794 MODULE_AUTHOR("Intel Corporation"); 795 795 MODULE_DESCRIPTION("Intel MAX 10 BMC hardware monitor"); 796 796 MODULE_LICENSE("GPL"); 797 + MODULE_IMPORT_NS(INTEL_M10_BMC_CORE);
+14
drivers/mfd/intel-m10-bmc-core.c
··· 12 12 #include <linux/mfd/intel-m10-bmc.h> 13 13 #include <linux/module.h> 14 14 15 + /* 16 + * This function helps to simplify the accessing of the system registers. 17 + * 18 + * The base of the system registers is configured through the struct 19 + * csr_map. 20 + */ 21 + int m10bmc_sys_read(struct intel_m10bmc *m10bmc, unsigned int offset, unsigned int *val) 22 + { 23 + const struct m10bmc_csr_map *csr_map = m10bmc->info->csr_map; 24 + 25 + return m10bmc_raw_read(m10bmc, csr_map->base + offset, val); 26 + } 27 + EXPORT_SYMBOL_NS_GPL(m10bmc_sys_read, INTEL_M10_BMC_CORE); 28 + 15 29 int m10bmc_sys_update_bits(struct intel_m10bmc *m10bmc, unsigned int offset, 16 30 unsigned int msk, unsigned int val) 17 31 {
+1 -16
include/linux/mfd/intel-m10-bmc.h
··· 267 267 return ret; 268 268 } 269 269 270 - /* 271 - * The base of the system registers could be configured by HW developers, and 272 - * in HW SPEC, the base is not added to the addresses of the system registers. 273 - * 274 - * This function helps to simplify the accessing of the system registers. And if 275 - * the base is reconfigured in HW, SW developers could simply change the 276 - * csr_map's base accordingly. 277 - */ 278 - static inline int m10bmc_sys_read(struct intel_m10bmc *m10bmc, unsigned int offset, 279 - unsigned int *val) 280 - { 281 - const struct m10bmc_csr_map *csr_map = m10bmc->info->csr_map; 282 - 283 - return m10bmc_raw_read(m10bmc, csr_map->base + offset, val); 284 - } 285 - 270 + int m10bmc_sys_read(struct intel_m10bmc *m10bmc, unsigned int offset, unsigned int *val); 286 271 int m10bmc_sys_update_bits(struct intel_m10bmc *m10bmc, unsigned int offset, 287 272 unsigned int msk, unsigned int val); 288 273