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, linux-pm@vger.kernel.org
Subject: [PATCH v5 1/5] platform/x86:intel/vsec: Change return type of intel_vsec_register
Date: Fri, 25 Apr 2025 12:52:29 -0700 [thread overview]
Message-ID: <20250425195237.493129-2-xi.pardee@linux.intel.com> (raw)
In-Reply-To: <20250425195237.493129-1-xi.pardee@linux.intel.com>
Change return type of intel_vsec_register() to int. The current
implementation does not indicate if the register fail or not.
Change to return error code if it fails or if INTEL_VSEC config
is not set. This is a preparation step to introduce a new SSRAM
Telemetry driver that will be using this API.
Signed-off-by: Xi Pardee <xi.pardee@linux.intel.com>
---
drivers/platform/x86/intel/vsec.c | 9 ++++++---
include/linux/intel_vsec.h | 5 +++--
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/drivers/platform/x86/intel/vsec.c b/drivers/platform/x86/intel/vsec.c
index db3c031d1757..055ca9f48fb4 100644
--- a/drivers/platform/x86/intel/vsec.c
+++ b/drivers/platform/x86/intel/vsec.c
@@ -332,13 +332,16 @@ static bool intel_vsec_walk_vsec(struct pci_dev *pdev,
return have_devices;
}
-void intel_vsec_register(struct pci_dev *pdev,
+int intel_vsec_register(struct pci_dev *pdev,
struct intel_vsec_platform_info *info)
{
if (!pdev || !info || !info->headers)
- return;
+ return -EINVAL;
- intel_vsec_walk_header(pdev, info);
+ if (!intel_vsec_walk_header(pdev, info))
+ return -ENODEV;
+ else
+ return 0;
}
EXPORT_SYMBOL_NS_GPL(intel_vsec_register, "INTEL_VSEC");
diff --git a/include/linux/intel_vsec.h b/include/linux/intel_vsec.h
index b94beab64610..bc95821f1bfb 100644
--- a/include/linux/intel_vsec.h
+++ b/include/linux/intel_vsec.h
@@ -139,12 +139,13 @@ static inline struct intel_vsec_device *auxdev_to_ivdev(struct auxiliary_device
}
#if IS_ENABLED(CONFIG_INTEL_VSEC)
-void intel_vsec_register(struct pci_dev *pdev,
+int intel_vsec_register(struct pci_dev *pdev,
struct intel_vsec_platform_info *info);
#else
-static inline void intel_vsec_register(struct pci_dev *pdev,
+static inline int intel_vsec_register(struct pci_dev *pdev,
struct intel_vsec_platform_info *info)
{
+ return -ENODEV;
}
#endif
#endif
--
2.43.0
next prev parent reply other threads:[~2025-04-25 19:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-25 19:52 [PATCH v5 0/5] Create Intel PMC SSRAM Telemetry driver Xi Pardee
2025-04-25 19:52 ` Xi Pardee [this message]
2025-04-25 19:52 ` [PATCH v5 2/5] platform/x86:intel/pmc: " Xi Pardee
2025-04-25 19:52 ` [PATCH v5 3/5] platform/x86:intel/pmc: Use devm for mutex_init Xi Pardee
2025-04-25 19:52 ` [PATCH v5 4/5] platform/x86:intel/pmc: Move error handling to init function Xi Pardee
2025-04-25 19:52 ` [PATCH v5 5/5] platform/x86:intel/pmc: Improve pmc_core_get_lpm_req() Xi Pardee
2025-04-29 15:01 ` [PATCH v5 0/5] Create Intel PMC SSRAM Telemetry driver Ilpo Järvinen
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=20250425195237.493129-2-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=linux-pm@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.