mfd: intel-m10-bmc: Move m10bmc_sys_read() away from header
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Mon, 17 Apr 2023 09:26:52 +0000 (12:26 +0300)
committerLee Jones <lee@kernel.org>
Thu, 15 Jun 2023 08:19:36 +0000 (09:19 +0100)
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
drivers/hwmon/intel-m10-bmc-hwmon.c
drivers/mfd/intel-m10-bmc-core.c
include/linux/mfd/intel-m10-bmc.h

index 6512f4bec79aad848e5193599858b0f15d9c24e2..6500ca548f9c73f1b2c9ebdce6ae59a82e63c55a 100644 (file)
@@ -794,3 +794,4 @@ MODULE_DEVICE_TABLE(platform, intel_m10bmc_hwmon_ids);
 MODULE_AUTHOR("Intel Corporation");
 MODULE_DESCRIPTION("Intel MAX 10 BMC hardware monitor");
 MODULE_LICENSE("GPL");
+MODULE_IMPORT_NS(INTEL_M10_BMC_CORE);
index dab1bb152fd622c1a09c90e5825b0d315edb262a..51f8651747965f6f530938b2b568486c6830f214 100644 (file)
 #include <linux/mfd/intel-m10-bmc.h>
 #include <linux/module.h>
 
+/*
+ * This function helps to simplify the accessing of the system registers.
+ *
+ * The base of the system registers is configured through the struct
+ * csr_map.
+ */
+int m10bmc_sys_read(struct intel_m10bmc *m10bmc, unsigned int offset, unsigned int *val)
+{
+       const struct m10bmc_csr_map *csr_map = m10bmc->info->csr_map;
+
+       return m10bmc_raw_read(m10bmc, csr_map->base + offset, val);
+}
+EXPORT_SYMBOL_NS_GPL(m10bmc_sys_read, INTEL_M10_BMC_CORE);
+
 int m10bmc_sys_update_bits(struct intel_m10bmc *m10bmc, unsigned int offset,
                           unsigned int msk, unsigned int val)
 {
index 5418f7279ed044dc7433bbec02b4d0491ffb2149..252644fa61be0fcf106c43f5518ea74350b6cd1b 100644 (file)
@@ -267,22 +267,7 @@ m10bmc_raw_read(struct intel_m10bmc *m10bmc, unsigned int addr,
        return ret;
 }
 
-/*
- * The base of the system registers could be configured by HW developers, and
- * in HW SPEC, the base is not added to the addresses of the system registers.
- *
- * This function helps to simplify the accessing of the system registers. And if
- * the base is reconfigured in HW, SW developers could simply change the
- * csr_map's base accordingly.
- */
-static inline int m10bmc_sys_read(struct intel_m10bmc *m10bmc, unsigned int offset,
-                                 unsigned int *val)
-{
-       const struct m10bmc_csr_map *csr_map = m10bmc->info->csr_map;
-
-       return m10bmc_raw_read(m10bmc, csr_map->base + offset, val);
-}
-
+int m10bmc_sys_read(struct intel_m10bmc *m10bmc, unsigned int offset, unsigned int *val);
 int m10bmc_sys_update_bits(struct intel_m10bmc *m10bmc, unsigned int offset,
                           unsigned int msk, unsigned int val);