hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/mailbox/pcc.c
....@@ -1,16 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Copyright (C) 2014 Linaro Ltd.
34 * Author: Ashwin Chaugule <ashwin.chaugule@linaro.org>
4
- *
5
- * This program is free software; you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License as published by
7
- * the Free Software Foundation; either version 2 of the License, or
8
- * (at your option) any later version.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
145 *
156 * PCC (Platform Communication Channel) is defined in the ACPI 5.0+
167 * specification. It is a mailbox like mechanism to allow clients
....@@ -382,7 +373,7 @@
382373 *
383374 * This gets called for each entry in the PCC table.
384375 */
385
-static int parse_pcc_subspace(struct acpi_subtable_header *header,
376
+static int parse_pcc_subspace(union acpi_subtable_headers *header,
386377 const unsigned long end)
387378 {
388379 struct acpi_pcct_subspace *ss = (struct acpi_pcct_subspace *) header;
....@@ -466,14 +457,17 @@
466457 pr_warn("Error parsing PCC subspaces from PCCT\n");
467458 else
468459 pr_warn("Invalid PCCT: %d PCC subspaces\n", count);
469
- return -EINVAL;
460
+
461
+ rc = -EINVAL;
462
+ goto err_put_pcct;
470463 }
471464
472465 pcc_mbox_channels = kcalloc(count, sizeof(struct mbox_chan),
473466 GFP_KERNEL);
474467 if (!pcc_mbox_channels) {
475468 pr_err("Could not allocate space for PCC mbox channels\n");
476
- return -ENOMEM;
469
+ rc = -ENOMEM;
470
+ goto err_put_pcct;
477471 }
478472
479473 pcc_doorbell_vaddr = kcalloc(count, sizeof(void *), GFP_KERNEL);
....@@ -544,6 +538,8 @@
544538 kfree(pcc_doorbell_vaddr);
545539 err_free_mbox:
546540 kfree(pcc_mbox_channels);
541
+err_put_pcct:
542
+ acpi_put_table(pcct_tbl);
547543 return rc;
548544 }
549545
....@@ -577,7 +573,7 @@
577573 return ret;
578574 }
579575
580
-struct platform_driver pcc_mbox_driver = {
576
+static struct platform_driver pcc_mbox_driver = {
581577 .probe = pcc_mbox_probe,
582578 .driver = {
583579 .name = "PCCT",