linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: linux-media@vger.kernel.org
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
	linux-acpi@vger.kernel.org, "Len Brown" <lenb@kernel.org>,
	"Daniel Scally" <dan.scally@ideasonboard.com>,
	"Hans de Goede" <hansg@kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	platform-driver-x86@vger.kernel.org
Subject: [PATCH v2 4/5] platform/x86: int3472: Release ACPI objects using __free()
Date: Tue, 25 Aug 2026 00:13:37 +0300	[thread overview]
Message-ID: <20260824211338.3583976-5-sakari.ailus@linux.intel.com> (raw)
In-Reply-To: <20260824211338.3583976-1-sakari.ailus@linux.intel.com>

Use __free() to release ACPI objects received from
acpi_evaluate_dsm_typed() without explicit ACPI_FREE().

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/platform/x86/intel/int3472/discrete.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/platform/x86/intel/int3472/discrete.c b/drivers/platform/x86/intel/int3472/discrete.c
index b4a95b583edb..2024eaa09033 100644
--- a/drivers/platform/x86/intel/int3472/discrete.c
+++ b/drivers/platform/x86/intel/int3472/discrete.c
@@ -4,6 +4,7 @@
 #include <linux/acpi.h>
 #include <linux/array_size.h>
 #include <linux/bitfield.h>
+#include <linux/cleanup.h>
 #include <linux/device.h>
 #include <linux/dmi.h>
 #include <linux/gpio/consumer.h>
@@ -327,7 +328,6 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares,
 	unsigned int enable_time_us;
 	u8 active_value, pin, type;
 	unsigned long gpio_flags;
-	union acpi_object *obj;
 	struct gpio_desc *gpio;
 	const char *con_id;
 	int ret;
@@ -339,10 +339,11 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares,
 	 * ngpios + 2 because the index of this _DSM function is 1-based and
 	 * the first function is just a count.
 	 */
-	obj = acpi_evaluate_dsm_typed(int3472->adev->handle,
-				      &int3472_gpio_guid, 0x00,
-				      int3472->ngpios + 2,
-				      NULL, ACPI_TYPE_INTEGER);
+	union acpi_object *obj __free(ACPI_FREE) =
+		acpi_evaluate_dsm_typed(int3472->adev->handle,
+					&int3472_gpio_guid, 0x00,
+					int3472->ngpios + 2,
+					NULL, ACPI_TYPE_INTEGER);
 
 	if (!obj) {
 		dev_warn(int3472->dev, "No _DSM entry for GPIO pin %u\n",
@@ -433,7 +434,6 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares,
 	}
 
 	int3472->ngpios++;
-	ACPI_FREE(obj);
 
 	/*
 	 * Either return an error or tell acpi_dev_get_resources() to not make a
-- 
2.47.3


  parent reply	other threads:[~2026-08-24 21:13 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-24 21:13 [PATCH v2 0/5] Fix static analyser and compiler warnings in int3472 Sakari Ailus
2026-08-24 21:13 ` [PATCH v2 1/5] platform/x86: int3472: Address Coccinelle warning on an error print Sakari Ailus
2026-08-24 21:13 ` [PATCH v2 2/5] platform/x86: int3472: Fix uninitialised variable warning Sakari Ailus
2026-08-24 21:13 ` [PATCH v2 3/5] ACPI: Support __free() from cleanup.h for ACPI objects Sakari Ailus
2026-08-25 11:51   ` Rafael J. Wysocki (Intel)
2026-08-25 12:07     ` Sakari Ailus
2026-08-25 12:18       ` Rafael J. Wysocki (Intel)
2026-08-25 12:32         ` Ilpo Järvinen
2026-08-25 13:02           ` Rafael J. Wysocki (Intel)
2026-08-25 13:08             ` Rafael J. Wysocki (Intel)
2026-08-25 13:51               ` Ilpo Järvinen
2026-08-25 14:42                 ` Rafael J. Wysocki (Intel)
2026-08-25 19:35               ` Sakari Ailus
2026-08-26  9:04                 ` Ilpo Järvinen
2026-08-26 10:17                   ` Rafael J. Wysocki (Intel)
2026-08-25 13:37             ` Ilpo Järvinen
2026-08-25 13:49               ` Rafael J. Wysocki (Intel)
2026-08-24 21:13 ` Sakari Ailus [this message]
2026-08-25 11:54   ` [PATCH v2 4/5] platform/x86: int3472: Release ACPI objects using __free() Rafael J. Wysocki (Intel)
2026-08-25 12:04     ` Sakari Ailus
2026-08-25 12:32       ` Rafael J. Wysocki (Intel)
2026-08-24 21:13 ` [PATCH v2 5/5] platform/x86: int3472: Clean up GPIO parsing Sakari Ailus
2026-08-25 10:40   ` Ilpo Järvinen
2026-08-25 10:54     ` Sakari Ailus

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=20260824211338.3583976-5-sakari.ailus@linux.intel.com \
    --to=sakari.ailus@linux.intel.com \
    --cc=dan.scally@ideasonboard.com \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rafael@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).