Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.1/patches/2233428/?format=api
{ "id": 2233428, "url": "http://patchwork.ozlabs.org/api/1.1/patches/2233428/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-gpio/patch/20260506123637.1077421-4-mscardovi95@gmail.com/", "project": { "id": 42, "url": "http://patchwork.ozlabs.org/api/1.1/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": "" }, "msgid": "<20260506123637.1077421-4-mscardovi95@gmail.com>", "date": "2026-05-06T12:35:35", "name": "[v2,2/3,2/3] gpio: acpi: modernize resource management using cleanup.h", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "4ac3bc34c6973fc59c3749ff1938bf6f15a014a5", "submitter": { "id": 93312, "url": "http://patchwork.ozlabs.org/api/1.1/people/93312/?format=api", "name": "Marco Scardovi", "email": "mscardovi95@gmail.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-gpio/patch/20260506123637.1077421-4-mscardovi95@gmail.com/mbox/", "series": [ { "id": 502978, "url": "http://patchwork.ozlabs.org/api/1.1/series/502978/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-gpio/list/?series=502978", "date": "2026-05-06T12:34:21", "name": "gpio: acpi: modernize resource management using cleanup.h", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/502978/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2233428/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2233428/checks/", "tags": {}, "headers": { "Return-Path": "\n <linux-gpio+bounces-36284-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=engmf561;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c15:e001:75::12fc:5321; helo=sin.lore.kernel.org;\n envelope-from=linux-gpio+bounces-36284-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=\"engmf561\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=209.85.128.51", "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 sin.lore.kernel.org (sin.lore.kernel.org\n [IPv6:2600:3c15:e001:75::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 4g9Zdk09sHz1yJq\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 06 May 2026 22:37:14 +1000 (AEST)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sin.lore.kernel.org (Postfix) with ESMTP id 80FFC300E6AE\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 6 May 2026 12:37:11 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 2A613453495;\n\tWed, 6 May 2026 12:37:07 +0000 (UTC)", "from mail-wm1-f51.google.com (mail-wm1-f51.google.com\n [209.85.128.51])\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 92F6044CF39\n\tfor <linux-gpio@vger.kernel.org>; Wed, 6 May 2026 12:37:00 +0000 (UTC)", "by mail-wm1-f51.google.com with SMTP id\n 5b1f17b1804b1-488a14c31eeso48000855e9.0\n for <linux-gpio@vger.kernel.org>;\n Wed, 06 May 2026 05:37:00 -0700 (PDT)", "from ROG ([2a01:e11:202b:40:68b1:8d59:e348:c16e])\n by smtp.gmail.com with ESMTPSA id\n 5b1f17b1804b1-48e530cf964sm31767485e9.1.2026.05.06.05.36.57\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 06 May 2026 05:36:58 -0700 (PDT)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1778071024; cv=none;\n b=Hy9FTumJFuogjVVqrRe7rVeDrVs65OxgIyu2pc3JODYzIf8V7AmSBV4LHfJXAGJpgpQLFWYplaxM9U7LyLULxifZ5cStJPzIruoUbHPxcUdOElDcMqQYMeVr1xu2OK+6tdRKh/I4IKFSG44JzvdMuM+X31gFLFhJqxWyxZl1IWs=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1778071024; c=relaxed/simple;\n\tbh=v/NK4ob2BdQrRgRECswCj/ZvHO8mcxQCL6EyTUOg2XI=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=nxBJ03ZXsTEAWX641NIOWroiX8Je0v/r4KyGfN9yUT84jNcY4enfxf7X3gVoPOXq47hoDVkMA32OSBOJpzbJd25qe4Z8KUio6clLaDJc6y2VLNrL62s3tHGah+IrZQtgaHuVsRMVN0WgR06GtJ55lODaQ6XPClOfJ/xA0m5b7xw=", "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=engmf561; arc=none smtp.client-ip=209.85.128.51", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1778071018; x=1778675818;\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=ZmPjvjob3FbjNKESIZvrg3JwdYT3+owCLHCZhOf9FAE=;\n b=engmf561V+xtEFyjJdib7qGpkxbU57rxXX16u2gOE+u29xoDh9xDQ6jzwdnwm6rkVZ\n TzJOPlclWgrgJbYybU/Rs1qx7OIfAs0vmwvmGVQ/CRhU5oBMqSN1yhw4k4Z3KN8nj+ow\n 86Pt3k54mdILmIF3XDXxv3yRxzw0/8Bk+TdhfjUbFMZz/vxqrfv/8ost32XP0VK7WTOm\n wJsko8LF9x35YUidrhUAMVL5IvIzloWm71bfcjVLD+Z6baRYc5i36DJjtzhe0BvO8uSJ\n QAAvxMrn2dFHHERs1nE1PKaSROGXX/YaABE0+nwxiCyekkVd/lPmW2pxaCczcuuxZbPG\n fdzA==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1778071018; x=1778675818;\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=ZmPjvjob3FbjNKESIZvrg3JwdYT3+owCLHCZhOf9FAE=;\n b=G7u5QftiRUCyOwti2T2w6/xPoiLvalRydIbmDwRxF6pSzCy+MjGe0IkpufYu9e8FTX\n MfL8y73SvuUkurL5weI5EVdAPW1jAd9kuL/lcdK0Oxp6J2oE1U+D+RtcEwW1+9ACvmo+\n QjDjumvn5hJFxJ86CNRkFR5Aivl/Dq4fi6l78pOQVDY1o1XvPUyrIPzpuqkp2ep9OBBP\n bOxSdjdajQVgIZk266pJxKfcJfrvjhU6posu2giHhZ73+bJdZNuzj8F7VTUDTtSh2NjU\n IY2Cx//wFxywhrNUAfv1E2vfkjoos93KPnKCdCMXCEmtMLe8kpxSjaxIW/CgQvR1JZ2A\n 9lVQ==", "X-Forwarded-Encrypted": "i=1;\n AFNElJ8invGHFYoVbHUhzK+KngZkXZHxzptHE3P+f+VSTphzcrpkVFGfCfOB+YPPn6IYEpRpo70zkXpzWC1/@vger.kernel.org", "X-Gm-Message-State": "AOJu0YxWX9L1gy8DjGyob0edWb3Gitx3LqDnja06OYjvCCZfrVNpWuxg\n\tD0tB4XM0zQ084QNLfsHqjKpD35wnpGDCMUBHfsp1g+mCwzszTS8IhBNG", "X-Gm-Gg": "AeBDietPBAEhEVPecdnYwbGeHjwntOvV4oZzsgr2argYmqiXi/8G64liRfwOFmKAg2d\n\tgk4bL9olKoVsARcyPLnJ4AtuMu+OUO/lhKURGCRzMJwTHFF0V1ROkGhxSQyW2vEiwzIh/e13Y9J\n\t1RCv7On9Wj/Vwxn+z/qHWKz3kxzihhxT2t2kBNylTc9BgDQR65SUbTnOdPw2IwUgyrX8TXQEuz2\n\t7fCjOwRzGfBOOxX60/0T1YvDiniTV10jT8OxtMC7O7jGhycNX3muv204ltWc7ZfT2+TncSSP0aQ\n\t8nKrWu+9oFBC4EOMORskcujrO31H367IWtUU3fcpoVRkwFwQbUST13mRzDffDfrdAqUroyK0DjI\n\tBySQwEQBUW4KwkUYgDCrcO1dVhW8Nt8TN6DDtgg/1OC8qviq0FYbSllWfzlv0TL5H0fBrDTK0PP\n\tgKROWiZmOHwNQXeHF1Rgj6PRDpjw==", "X-Received": "by 2002:a05:600c:4f53:b0:486:fb0b:ad79 with SMTP id\n 5b1f17b1804b1-48e51f4456cmr56620385e9.20.1778071018538;\n Wed, 06 May 2026 05:36:58 -0700 (PDT)", "From": "Marco Scardovi <mscardovi95@gmail.com>", "To": "mika.westerberg@intel.com", "Cc": "mathias.nyman@intel.com,\n\tandriy.shevchenko@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 v2 2/3] [PATCH 2/3] gpio: acpi: modernize resource management\n using cleanup.h", "Date": "Wed, 6 May 2026 14:35:35 +0200", "Message-ID": "<20260506123637.1077421-4-mscardovi95@gmail.com>", "X-Mailer": "git-send-email 2.54.0", "In-Reply-To": "<20260506123637.1077421-1-mscardovi95@gmail.com>", "References": "<20260506113215.GK6785@://intel.com>\n <20260506123637.1077421-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 | 38 ++++++++++++--------------------\n 1 file changed, 14 insertions(+), 24 deletions(-)", "diff": "diff --git a/drivers/gpio/gpiolib-acpi-core.c b/drivers/gpio/gpiolib-acpi-core.c\nindex 7c17bffcd4e7..b6accbaba04d 100644\n--- a/drivers/gpio/gpiolib-acpi-core.c\n+++ b/drivers/gpio/gpiolib-acpi-core.c\n@@ -410,31 +410,26 @@ 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+\tdesc_guard = 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@@ -462,17 +457,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@@ -1104,7 +1097,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@@ -1115,20 +1108,17 @@ 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+\tstatus = AE_OK;\n \tfor (i = pin_index; i < length; ++i) {\n \t\tunsigned int pin = agpio->pin_table[i];\n \t\tstruct acpi_gpio_connection *conn;\n", "prefixes": [ "v2", "2/3", "2/3" ] }