ACPI: PRM: Add acpi_prm_handler_available()
Add a helper function to check if a PRM handler/module is present. This can be used during init time by code that depends on a particular handler. If the handler is not present, then the code does not need to be loaded. Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Reviewed-by: "Mario Limonciello (AMD)" <superm1@kernel.org> Acked-by: "Rafael J. Wysocki (Intel)" <rafael@kernel.org> Link: https://patch.msgid.link/all/20251017-wip-atl-prm-v2-1-7ab1df4a5fbc@amd.compull/1354/merge
parent
6553c68bc7
commit
83be4bee57
|
|
@ -244,6 +244,12 @@ static struct prm_handler_info *find_prm_handler(const guid_t *guid)
|
||||||
return (struct prm_handler_info *) find_guid_info(guid, GET_HANDLER);
|
return (struct prm_handler_info *) find_guid_info(guid, GET_HANDLER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool acpi_prm_handler_available(const guid_t *guid)
|
||||||
|
{
|
||||||
|
return find_prm_handler(guid) && find_prm_module(guid);
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(acpi_prm_handler_available);
|
||||||
|
|
||||||
/* In-coming PRM commands */
|
/* In-coming PRM commands */
|
||||||
|
|
||||||
#define PRM_CMD_RUN_SERVICE 0
|
#define PRM_CMD_RUN_SERVICE 0
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,11 @@
|
||||||
|
|
||||||
#ifdef CONFIG_ACPI_PRMT
|
#ifdef CONFIG_ACPI_PRMT
|
||||||
void init_prmt(void);
|
void init_prmt(void);
|
||||||
|
bool acpi_prm_handler_available(const guid_t *handler_guid);
|
||||||
int acpi_call_prm_handler(guid_t handler_guid, void *param_buffer);
|
int acpi_call_prm_handler(guid_t handler_guid, void *param_buffer);
|
||||||
#else
|
#else
|
||||||
static inline void init_prmt(void) { }
|
static inline void init_prmt(void) { }
|
||||||
|
static inline bool acpi_prm_handler_available(const guid_t *handler_guid) { return false; }
|
||||||
static inline int acpi_call_prm_handler(guid_t handler_guid, void *param_buffer)
|
static inline int acpi_call_prm_handler(guid_t handler_guid, void *param_buffer)
|
||||||
{
|
{
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue