Skip to content

Commit 3265cc3

Browse files
aubreylirafaeljw
authored andcommitted
ACPI: PRM: Find PRMT table before parsing it
Find and verify PRMT before parsing it, which eliminates a warning on machines without PRMT: [ 7.197173] ACPI: PRMT not present Fixes: cefc7ca ("ACPI: PRM: implement OperationRegion handler for the PlatformRtMechanism subtype") Signed-off-by: Aubrey Li <aubrey.li@linux.intel.com> Tested-by: Paul Menzel <pmenzel@molgen.mpg.de> Cc: 5.14+ <stable@vger.kernel.org> # 5.14+ [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 8e235ff commit 3265cc3

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

drivers/acpi/prmt.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,10 +288,18 @@ static acpi_status acpi_platformrt_space_handler(u32 function,
288288

289289
void __init init_prmt(void)
290290
{
291+
struct acpi_table_header *tbl;
291292
acpi_status status;
292-
int mc = acpi_table_parse_entries(ACPI_SIG_PRMT, sizeof(struct acpi_table_prmt) +
293+
int mc;
294+
295+
status = acpi_get_table(ACPI_SIG_PRMT, 0, &tbl);
296+
if (ACPI_FAILURE(status))
297+
return;
298+
299+
mc = acpi_table_parse_entries(ACPI_SIG_PRMT, sizeof(struct acpi_table_prmt) +
293300
sizeof (struct acpi_table_prmt_header),
294301
0, acpi_parse_prmt, 0);
302+
acpi_put_table(tbl);
295303
/*
296304
* Return immediately if PRMT table is not present or no PRM module found.
297305
*/

0 commit comments

Comments
 (0)