All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xi Pardee <xi.pardee@linux.intel.com>
To: xi.pardee@linux.intel.com, irenic.rajneesh@gmail.com,
	david.e.box@linux.intel.com, hdegoede@redhat.com,
	ilpo.jarvinen@linux.intel.com,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 5/7] platform/x86:intel/pmt: Create inline version for telemetry functions
Date: Fri,  9 Aug 2024 13:46:34 -0700	[thread overview]
Message-ID: <20240809204648.1124545-6-xi.pardee@linux.intel.com> (raw)
In-Reply-To: <20240809204648.1124545-1-xi.pardee@linux.intel.com>

Create inline versions of functions in Intel PMT Telemetry driver when
config option is not set. Drivers that imports the INTEL_PMT_TELEMETRY
namespace could compile when CONFIG_INTEL_PMT_TELEMETRY option is not set.

Signed-off-by: Xi Pardee <xi.pardee@linux.intel.com>
---
 drivers/platform/x86/intel/pmt/telemetry.h | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/drivers/platform/x86/intel/pmt/telemetry.h b/drivers/platform/x86/intel/pmt/telemetry.h
index d45af5512b4e..6798a900042a 100644
--- a/drivers/platform/x86/intel/pmt/telemetry.h
+++ b/drivers/platform/x86/intel/pmt/telemetry.h
@@ -21,6 +21,7 @@ struct telem_endpoint_info {
 	struct telem_header	header;
 };
 
+#if IS_REACHABLE(CONFIG_INTEL_PMT_TELEMETRY)
 /**
  * pmt_telem_get_next_endpoint() - Get next device id for a telemetry endpoint
  * @start:  starting devid to look from
@@ -123,4 +124,20 @@ int pmt_telem_read(struct telem_endpoint *ep, u32 id, u64 *data, u32 count);
  */
 int pmt_telem_read32(struct telem_endpoint *ep, u32 id, u32 *data, u32 count);
 
-#endif
+#else /* !CONFIG_INTEL_PMT_TELEMETRY */
+static inline unsigned long pmt_telem_get_next_endpoint(unsigned long start) { return 0; }
+static inline struct telem_endpoint *pmt_telem_register_endpoint(int devid)
+{ return ERR_PTR(-ENODEV); }
+static inline void pmt_telem_unregister_endpoint(struct telem_endpoint *ep) {}
+static inline int pmt_telem_get_endpoint_info(int devid, struct telem_endpoint_info *info)
+{ return -ENODEV; }
+static inline struct telem_endpoint *pmt_telem_find_and_register_endpoint(struct pci_dev *pcidev,
+				u32 guid, u16 pos)
+{ return ERR_PTR(-ENODEV); }
+static inline int pmt_telem_read(struct telem_endpoint *ep, u32 id, u64 *data, u32 count)
+{ return -ENODEV; }
+static inline int pmt_telem_read32(struct telem_endpoint *ep, u32 id, u32 *data, u32 count)
+{ return -ENODEV; }
+#endif /* CONFIG_INTEL_PMT_TELEMETRY */
+
+#endif /* _TELEMETRY_H */
-- 
2.43.0


  parent reply	other threads:[~2024-08-09 20:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-09 20:46 [PATCH 0/7] Create Intel PMC SSRAM Telemetry driver Xi Pardee
2024-08-09 20:46 ` [PATCH 1/7] platform/x86:intel/pmc: Remove SSRAM support from PMC Core Xi Pardee
2024-08-09 20:46 ` [PATCH 2/7] platform/x86:intel/pmc: Create Intel PMC SSRAM Telemetry driver Xi Pardee
2024-08-12 10:40   ` kernel test robot
2024-08-09 20:46 ` [PATCH 3/7] platform/x86:intel/pmc: Add support to get PMC information from SSRAM Xi Pardee
2024-08-09 20:46 ` [PATCH 4/7] platform/x86:intel/pmt: Get PMC from SSRAM for available platforms Xi Pardee
2024-08-09 20:46 ` Xi Pardee [this message]
2024-08-09 20:46 ` [PATCH 6/7] platform/x86:intel/pmc: Add support to Retrieve LPM information Xi Pardee
2024-08-18  3:27   ` kernel test robot
2024-08-09 20:46 ` [PATCH 7/7] platform/x86:intel/pmc: Get LPM information for available platforms Xi Pardee
2024-08-13 16:01 ` [PATCH 0/7] Create Intel PMC SSRAM Telemetry driver Ilpo Järvinen
2024-08-13 23:01   ` Xi Pardee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240809204648.1124545-6-xi.pardee@linux.intel.com \
    --to=xi.pardee@linux.intel.com \
    --cc=david.e.box@linux.intel.com \
    --cc=hdegoede@redhat.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=irenic.rajneesh@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.