Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/2234375/?format=api
{ "id": 2234375, "url": "http://patchwork.ozlabs.org/api/1.2/patches/2234375/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-gpio/patch/20260507155647.403964-6-mscardovi95@gmail.com/", "project": { "id": 42, "url": "http://patchwork.ozlabs.org/api/1.2/projects/42/?format=api", "name": "Linux GPIO development", "link_name": "linux-gpio", "list_id": "linux-gpio.vger.kernel.org", "list_email": "linux-gpio@vger.kernel.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260507155647.403964-6-mscardovi95@gmail.com>", "list_archive_url": null, "date": "2026-05-07T15:56:46", "name": "[v3,5/6] gpio: acpi: use cleanup.h for automated resource deallocation", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "42c9929b02c2f8ebcbcc4e10e9179d078d478b55", "submitter": { "id": 93312, "url": "http://patchwork.ozlabs.org/api/1.2/people/93312/?format=api", "name": "Marco Scardovi", "email": "mscardovi95@gmail.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-gpio/patch/20260507155647.403964-6-mscardovi95@gmail.com/mbox/", "series": [ { "id": 503210, "url": "http://patchwork.ozlabs.org/api/1.2/series/503210/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-gpio/list/?series=503210", "date": "2026-05-07T15:56:41", "name": "gpio: acpi: modernize resource management using cleanup.h", "version": 3, "mbox": "http://patchwork.ozlabs.org/series/503210/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2234375/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2234375/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linux-gpio+bounces-36391-incoming=patchwork.ozlabs.org@vger.kernel.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "linux-gpio@vger.kernel.org" ], "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=o/McGVjT;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org;\n envelope-from=linux-gpio+bounces-36391-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=\"o/McGVjT\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=209.85.221.45", "smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com", "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=gmail.com" ], "Received": [ "from tor.lore.kernel.org (tor.lore.kernel.org\n [IPv6:2600:3c04:e001:36c::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4gBH4L0hLFz1y04\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 08 May 2026 01:59:14 +1000 (AEST)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id 34896307EBDF\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 7 May 2026 15:57:27 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 5165344D014;\n\tThu, 7 May 2026 15:57:01 +0000 (UTC)", "from mail-wr1-f45.google.com (mail-wr1-f45.google.com\n [209.85.221.45])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 73D914534B2\n\tfor <linux-gpio@vger.kernel.org>; Thu, 7 May 2026 15:56:59 +0000 (UTC)", "by mail-wr1-f45.google.com with SMTP id\n ffacd0b85a97d-43d7645adbdso655033f8f.1\n for <linux-gpio@vger.kernel.org>;\n Thu, 07 May 2026 08:56:59 -0700 (PDT)", "from ROG ([2a01:e11:202b:40:68b1:8d59:e348:c16e])\n by smtp.gmail.com with ESMTPSA id\n ffacd0b85a97d-45412820463sm44581f8f.3.2026.05.07.08.56.57\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 07 May 2026 08:56:57 -0700 (PDT)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1778169421; cv=none;\n b=qdgvHziqUk4azTq6Zrxxi4IlGr9Zxs4ssHBV19Ozl/vciiQn0SES1x9C7XZJK4P6gTQTMY4x5d2SwVGso5glUEzmwHKJ0VTM1/DXpi7DUJlK2rd2IMEfVn2yCUpB+le3ZYpdXBDmw8BCZXoFIGHsMcnyeQeze1zXL53fMUGtOr4=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1778169421; c=relaxed/simple;\n\tbh=JV3zZJ8rkmi4RMT6hpnGeDnQ0pKc5O/jB6na/dhq70A=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=By6hYmSAB4prWJTNXTNJEz1p4bXTHiOmb1CmWcUZBqCOxDWJSvfoCJvD719Y59+nH3coPtQBnzwKxzoYhas1OXxx3wdnJi3naO5yeynPv4TknPvbgPSQIbKx+oYJzPtpb8ixm5wENyy5mVjzpt05nvRH4tWkkWfW7ALsvI5raXs=", "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com;\n spf=pass smtp.mailfrom=gmail.com;\n dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=o/McGVjT; arc=none smtp.client-ip=209.85.221.45", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1778169418; x=1778774218;\n darn=vger.kernel.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=LuLklHkoZ90lipN8/stupsJdkmM0RVCMnCyoiMUX2OI=;\n b=o/McGVjTKIpSPlAJBkVFsQ5gQrlE76xrCJ1RIaGedoTmgBa+d9YGeL1ic4JZr+p+DQ\n lh/cC+LgOtxMXlhrDmSGh0gDRRNAFlU3l4i3DPrN5iplFslU/dzsmMTcJHJRIEg4KWu4\n nHiLZ7sj92teaAz8CI4Qs7hAc1Fsr/n1Ab82HhWi57H1RixY/fUsGf2boNnlHwovT9iq\n dWiiPOxINqpH0L3Kgu4g5BaZpvdFvWYCYZ11Hw3MwuzAj9alMtswTmjYpHSKA6GmdkBV\n FX4ozaDqTPT906g2l31ILF86vu5RPifs5n69IE45TfqOxT+Pl1uIpevf1Ykh1ZvRD+Vr\n NUBw==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1778169418; x=1778774218;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=LuLklHkoZ90lipN8/stupsJdkmM0RVCMnCyoiMUX2OI=;\n b=tEXo0XkJamMjjOkJRgxDDCYuVUg5pfj5ng8btNVyrDfFzfY5OzK7XpgjJI2q8kA2W0\n ihqFq2n5fy2oCXJtoi8eZkwclKFJXoE1I4bkV+qe+9nUh4X1Hphw84nZx0L5Gd0n0pXI\n ALN7rWk/TZTqGQRww/bCCVMk9LHPxE0MLsZfoZmhxPB7DQ49FFsd4uGSggxFJK0IiXre\n Tn3SnVstnwKlq9g77TdxUZzzuMLKAjvvVE7MifM63GhqfBazc17gNyhPAXCkbD59ylLR\n NKfD1hILdTTYldEF62EOpRHfW2H73HfxFNoW/7JC6FQ+TB96Usm3qgvlExuickw9epAe\n ITvA==", "X-Forwarded-Encrypted": "i=1;\n AFNElJ+btBDaOeWrSEbyxpFr9PrjOKxUHNRrnNg4sxyfnniVPMuyb2/w7edMXwIuTR3p8A6K3bFXB+4eEzjX@vger.kernel.org", "X-Gm-Message-State": "AOJu0Yy6H7Y/r2yv0adI4Nt0xJOECv64dw6k0goDir4Rnkgkwu5Y6XI4\n\thI8elSmxe+sT47N9H6sF5an4uY4gjVpnO9EE1eJTv6+QxVU/Ph9OcYdU", "X-Gm-Gg": "AeBDietS2jQj5CWPIlhXu0WTq3W9v1i5AdJlLyY+5evvbn5I4w2IhB24r/hKkUM0oH8\n\tToD0Vsh2P8Kw2Zspq9vb9iHG4sgs0PptFMM/YzBnlAoWuVABHqnvZDVq236+ncwAZxuhgTifj0V\n\tch5HGAI0Qp9RgDhbJ4YXcXGLSTX53QTCbHNxn7Jwf+uzOXbsVCkoIgJ+7RVQ3LlcwnSyj1y5sk8\n\txwFHDOn83ewNShFJ5MXb0sXlMHdQM8eug8qBMFqMSeMCfO+J5BCtLvHLXMskGVJVFhLbypWJNZF\n\tXkAeQwPORzdY81OnRf0NEKxonwChS2u0aTbqtJmG6y/gdnpNZI5zGjWNqCGQeYYUnKdgqec99FW\n\tMbPFmJ/sp2HQLZYjWK/WM6b5Dq6LZjAIHu6rIIBylHqT68uJxwbA5v9gojfJe3rWCHaKogCKzgw\n\t6lnxskDwAC1rR25IKoWFHaYxOa4Q==", "X-Received": "by 2002:a05:6000:1acb:b0:44a:8c10:40d9 with SMTP id\n ffacd0b85a97d-4515cf126camr14427750f8f.23.1778169417791;\n Thu, 07 May 2026 08:56:57 -0700 (PDT)", "From": "Marco Scardovi <mscardovi95@gmail.com>", "To": "mika.westerberg@intel.com", "Cc": "andriy.shevchenko@intel.com,\n\tmathias.nyman@intel.com,\n\tlinux-gpio@vger.kernel.org,\n\tlinux-acpi@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org,\n\tMarco Scardovi <mscardovi95@gmail.com>", "Subject": "[PATCH v3 5/6] gpio: acpi: use cleanup.h for automated resource\n deallocation", "Date": "Thu, 7 May 2026 17:56:46 +0200", "Message-ID": "<20260507155647.403964-6-mscardovi95@gmail.com>", "X-Mailer": "git-send-email 2.54.0", "In-Reply-To": "<20260507155647.403964-1-mscardovi95@gmail.com>", "References": "<20260506123421.1077421-1-mscardovi95@gmail.com>\n <20260507155647.403964-1-mscardovi95@gmail.com>", "Precedence": "bulk", "X-Mailing-List": "linux-gpio@vger.kernel.org", "List-Id": "<linux-gpio.vger.kernel.org>", "List-Subscribe": "<mailto:linux-gpio+subscribe@vger.kernel.org>", "List-Unsubscribe": "<mailto:linux-gpio+unsubscribe@vger.kernel.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit" }, "content": "---\n drivers/gpio/gpiolib-acpi-core.c | 40 +++++++++++---------------------\n 1 file changed, 14 insertions(+), 26 deletions(-)", "diff": "diff --git a/drivers/gpio/gpiolib-acpi-core.c b/drivers/gpio/gpiolib-acpi-core.c\nindex 33d6c3b6cdf0..c9b12e24de14 100644\n--- a/drivers/gpio/gpiolib-acpi-core.c\n+++ b/drivers/gpio/gpiolib-acpi-core.c\n@@ -397,31 +397,27 @@ static acpi_status acpi_gpiochip_alloc_event(struct acpi_resource *ares,\n \n \tdesc = acpi_request_own_gpiod(chip, agpio, 0, \"ACPI:Event\");\n \tif (IS_ERR(desc)) {\n-\t\tdev_err(chip->parent,\n-\t\t\t\"Failed to request GPIO for pin 0x%04X, err %pe\\n\",\n-\t\t\tpin, desc);\n+\t\tdev_err(chip->parent, \"Failed to request GPIO for pin 0x%04X, err %pe\\n\", pin, desc);\n \t\treturn AE_OK;\n \t}\n \n+\tstruct gpio_desc *desc_guard __free(free_gpio_desc) = desc;\n+\n \tret = gpiochip_lock_as_irq(chip, pin);\n \tif (ret) {\n-\t\tdev_err(chip->parent,\n-\t\t\t\"Failed to lock GPIO pin 0x%04X as interrupt, err %d\\n\",\n-\t\t\tpin, ret);\n-\t\tgoto fail_free_desc;\n+\t\tdev_err(chip->parent, \"Failed to lock GPIO pin 0x%04X as interrupt, err %d\\n\", pin, ret);\n+\t\treturn AE_OK;\n \t}\n \n \tirq = gpiod_to_irq(desc);\n \tif (irq < 0) {\n-\t\tdev_err(chip->parent,\n-\t\t\t\"Failed to translate GPIO pin 0x%04X to IRQ, err %d\\n\",\n-\t\t\tpin, irq);\n-\t\tgoto fail_unlock_irq;\n+\t\tdev_err(chip->parent, \"Failed to translate GPIO pin 0x%04X to IRQ, err %d\\n\", pin, irq);\n+\t\tgoto err_unlock;\n \t}\n \n \tevent = kzalloc_obj(*event);\n \tif (!event)\n-\t\tgoto fail_unlock_irq;\n+\t\tgoto err_unlock;\n \n \tevent->irqflags = IRQF_ONESHOT;\n \tif (agpio->triggering == ACPI_LEVEL_SENSITIVE) {\n@@ -449,17 +445,15 @@ static acpi_status acpi_gpiochip_alloc_event(struct acpi_resource *ares,\n \tevent->irq = irq;\n \tevent->irq_is_wake = acpi_gpio_irq_is_wake(chip->parent, agpio);\n \tevent->pin = pin;\n-\tevent->desc = desc;\n+\t/* Transfer ownership to event, prevent auto-free */\n+\tevent->desc = no_free_ptr(desc_guard);\n \n \tlist_add_tail(&event->node, &acpi_gpio->events);\n \n \treturn AE_OK;\n \n-fail_unlock_irq:\n+err_unlock:\n \tgpiochip_unlock_as_irq(chip, pin);\n-fail_free_desc:\n-\tgpiochip_free_own_desc(desc);\n-\n \treturn AE_OK;\n }\n \n@@ -1091,7 +1085,7 @@ acpi_gpio_adr_space_handler(u32 function, acpi_physical_address address,\n \tstruct acpi_gpio_chip *achip = region_context;\n \tstruct gpio_chip *chip = achip->chip;\n \tstruct acpi_resource_gpio *agpio;\n-\tstruct acpi_resource *ares;\n+\tstruct acpi_resource *ares __free(acpi_free) = NULL;\n \tu16 pin_index = address;\n \tacpi_status status;\n \tint length;\n@@ -1102,18 +1096,14 @@ acpi_gpio_adr_space_handler(u32 function, acpi_physical_address address,\n \tif (ACPI_FAILURE(status))\n \t\treturn status;\n \n-\tif (WARN_ON(ares->type != ACPI_RESOURCE_TYPE_GPIO)) {\n-\t\tACPI_FREE(ares);\n+\tif (WARN_ON(ares->type != ACPI_RESOURCE_TYPE_GPIO))\n \t\treturn AE_BAD_PARAMETER;\n-\t}\n \n \tagpio = &ares->data.gpio;\n \n \tif (WARN_ON(agpio->io_restriction == ACPI_IO_RESTRICT_INPUT &&\n-\t function == ACPI_WRITE)) {\n-\t\tACPI_FREE(ares);\n+\t function == ACPI_WRITE))\n \t\treturn AE_BAD_PARAMETER;\n-\t}\n \n \tlength = min(agpio->pin_table_length, pin_index + bits);\n \tfor (i = pin_index; i < length; ++i) {\n@@ -1189,8 +1179,6 @@ acpi_gpio_adr_space_handler(u32 function, acpi_physical_address address,\n \t\t}\n \t}\n \n-out:\n-\tACPI_FREE(ares);\n \treturn status;\n }\n \n", "prefixes": [ "v3", "5/6" ] }