]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
platform/x86: intel_telemetry: Add telemetry_get_pltdata()
authorMika Westerberg <mika.westerberg@linux.intel.com>
Thu, 16 Apr 2020 08:15:50 +0000 (11:15 +0300)
committerLee Jones <lee.jones@linaro.org>
Fri, 24 Apr 2020 10:18:30 +0000 (11:18 +0100)
Add new function that allows telemetry modules to get pointer to the
platform specific configuration. This is needed to allow the telemetry
debugfs module to fetch PMC IPC instance in the subsequent patch.

This also allows us to replace telemetry_pltconfig_valid() with
telemetry_get_pltdata() as well.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
arch/x86/include/asm/intel_telemetry.h
drivers/platform/x86/intel_telemetry_core.c
drivers/platform/x86/intel_telemetry_debugfs.c

index 274aaf0dae48f660c5b60b5e17e9c83fde2a71af..2c0e7d7a10e929fdaaf58775d8e4e876924cc2f5 100644 (file)
@@ -95,7 +95,7 @@ int telemetry_set_pltdata(const struct telemetry_core_ops *ops,
 
 int telemetry_clear_pltdata(void);
 
-int telemetry_pltconfig_valid(void);
+struct telemetry_plt_config *telemetry_get_pltdata(void);
 
 int telemetry_get_evtname(enum telemetry_unit telem_unit,
                          const char **name, int len);
index d4040bb222b485ead8c8caa8a1b3c4463e72dffa..fdf55b5d69480e4a12765a15b42bb8ac6dee287b 100644 (file)
@@ -353,21 +353,16 @@ int telemetry_clear_pltdata(void)
 EXPORT_SYMBOL_GPL(telemetry_clear_pltdata);
 
 /**
- * telemetry_pltconfig_valid() - Checkif platform config is valid
+ * telemetry_get_pltdata() - Return telemetry platform config
  *
- * Usage by other than telemetry module is invalid
- *
- * Return: 0 success, < 0 for failure
+ * May be used by other telemetry modules to get platform specific
+ * configuration.
  */
-int telemetry_pltconfig_valid(void)
+struct telemetry_plt_config *telemetry_get_pltdata(void)
 {
-       if (telm_core_conf.plt_config)
-               return 0;
-
-       else
-               return -EINVAL;
+       return telm_core_conf.plt_config;
 }
-EXPORT_SYMBOL_GPL(telemetry_pltconfig_valid);
+EXPORT_SYMBOL_GPL(telemetry_get_pltdata);
 
 static inline int telemetry_get_pssevtname(enum telemetry_unit telem_unit,
                                           const char **name, int len)
index 8a53d3b485b3a04cfc10cc9f274bb1ab2c892a99..6cac3e05b817cc1b2f160aad966b90e9063ead9e 100644 (file)
@@ -910,8 +910,7 @@ static int __init telemetry_debugfs_init(void)
 
        debugfs_conf = (struct telemetry_debugfs_conf *)id->driver_data;
 
-       err = telemetry_pltconfig_valid();
-       if (err < 0) {
+       if (!telemetry_get_pltdata()) {
                pr_info("Invalid pltconfig, ensure IPC1 device is enabled in BIOS\n");
                return -ENODEV;
        }