get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/2217397/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2217397,
    "url": "http://patchwork.ozlabs.org/api/patches/2217397/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/patch/20260328-mips-input-rb532-button-v1-2-98e201621501@kernel.org/",
    "project": {
        "id": 3,
        "url": "http://patchwork.ozlabs.org/api/projects/3/?format=api",
        "name": "Linux MTD development",
        "link_name": "linux-mtd",
        "list_id": "linux-mtd.lists.infradead.org",
        "list_email": "linux-mtd@lists.infradead.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260328-mips-input-rb532-button-v1-2-98e201621501@kernel.org>",
    "list_archive_url": null,
    "date": "2026-03-28T15:55:48",
    "name": "[2/2] MIPS/mtd: Handle READY GPIO in generic NAND platform data",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "41d86cdae9762c94a1e1b09e14038ef457b2d244",
    "submitter": {
        "id": 92050,
        "url": "http://patchwork.ozlabs.org/api/people/92050/?format=api",
        "name": "Linus Walleij",
        "email": "linusw@kernel.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-mtd/patch/20260328-mips-input-rb532-button-v1-2-98e201621501@kernel.org/mbox/",
    "series": [
        {
            "id": 497875,
            "url": "http://patchwork.ozlabs.org/api/series/497875/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/list/?series=497875",
            "date": "2026-03-28T15:55:46",
            "name": "MIPS RB532 GPIO descriptor conversion",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/497875/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2217397/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2217397/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n secure) header.d=lists.infradead.org header.i=@lists.infradead.org\n header.a=rsa-sha256 header.s=bombadil.20210309 header.b=tmF1KMfW;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=Bm7fMoYF;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=none (no SPF record) smtp.mailfrom=lists.infradead.org\n (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org;\n envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n receiver=patchwork.ozlabs.org)"
        ],
        "Received": [
            "from bombadil.infradead.org (bombadil.infradead.org\n [IPv6:2607:7c80:54:3::133])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fjhvG6h82z1yG4\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 29 Mar 2026 02:56:07 +1100 (AEDT)",
            "from localhost ([::1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1w6W12-000000095Up-0Clj;\n\tSat, 28 Mar 2026 15:56:00 +0000",
            "from tor.source.kernel.org ([172.105.4.254])\n\tby bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1w6W0z-000000095US-2b7q\n\tfor linux-mtd@lists.infradead.org;\n\tSat, 28 Mar 2026 15:55:57 +0000",
            "from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])\n\tby tor.source.kernel.org (Postfix) with ESMTP id BA5D8600AE;\n\tSat, 28 Mar 2026 15:55:56 +0000 (UTC)",
            "by smtp.kernel.org (Postfix) with ESMTPSA id 64A26C2BC86;\n\tSat, 28 Mar 2026 15:55:54 +0000 (UTC)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20210309; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id\n\t:MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=6c2cYwkG2FHPPeF8IN+Qd/rsPcOElvWnUMqPtI8y8+s=; b=tmF1KMfWDQLota\n\tDHYFJh+HSMkXNJoYml7r9VL+/YYmSH9H7WhpGAtgwFPLr4W8sAZ9lF+mrEUpznQxtYkpWwacrjMQ6\n\tf7EY+nsCnXIUrzIjrftxTDqh9eR1lY/IRgSmT3GfTDTsLRE1I+Re1MId8Xv23coQZ4sHug7GBb8t9\n\t7TxFbd4p0X/3Xlc+91AX4ikL/HoHnJeO/bEbNl50Tn9hwG1/srUvpKZnACVuEmvuuYZffjYEKoBwD\n\twCNR+HVhswpe/LP38WTvIXNN5lwawbvDo0KwtCOmQFnFzdM06iYwZsmSxwmsrnLp9+84L6EggLFEp\n\tNfC/d7tRUXw/xQnqxCLA==;",
            "v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1774713356;\n\tbh=UD/TwSuuylvsTVk6WuLqLc/i823tJemYw2VTGjQDzOU=;\n\th=From:Date:Subject:References:In-Reply-To:To:Cc:From;\n\tb=Bm7fMoYFkUbimvOYpNbqJa1zS9jOSlu3hhkd1VIWosEKAiRFMr0AbqbdeuoXQ6za1\n\t slZjp+JbOw4XGUTyGKd83DJdlyE5RLol1fN1LxQZS3Qy5C5ae/SHwu7NvyvLNl+7Kl\n\t Tmy9K7uxnwDUIRiXkcR4sy4eXorE6OLiKOqpKde6NYgCh+LgD0jhwG5nfFsQoePwmZ\n\t 5NBVj5J41BY1UqisNpeBe79Z7tqOQ3DxRnBATawJnrhNFinStUy9sE6tcHzv/y5sVB\n\t +qsZ1B1KWFzbeMgHRm8nwy9ZbvEPdthwa1FuEKJx/2bZcB7mlBXeONsodKpwPcFNS7\n\t d0+YXPgPSQ2hA=="
        ],
        "From": "Linus Walleij <linusw@kernel.org>",
        "Date": "Sat, 28 Mar 2026 16:55:48 +0100",
        "Subject": "[PATCH 2/2] MIPS/mtd: Handle READY GPIO in generic NAND platform\n data",
        "MIME-Version": "1.0",
        "Message-Id": "<20260328-mips-input-rb532-button-v1-2-98e201621501@kernel.org>",
        "References": "<20260328-mips-input-rb532-button-v1-0-98e201621501@kernel.org>",
        "In-Reply-To": "<20260328-mips-input-rb532-button-v1-0-98e201621501@kernel.org>",
        "To": "Thomas Bogendoerfer <tsbogend@alpha.franken.de>,\n Dmitry Torokhov <dmitry.torokhov@gmail.com>,\n Bartosz Golaszewski <brgl@kernel.org>,\n Miquel Raynal <miquel.raynal@bootlin.com>,\n Richard Weinberger <richard@nod.at>, Vignesh Raghavendra <vigneshr@ti.com>",
        "Cc": "linux-mips@vger.kernel.org, linux-input@vger.kernel.org,\n linux-gpio@vger.kernel.org, linux-mtd@lists.infradead.org,\n Linus Walleij <linusw@kernel.org>",
        "X-Mailer": "b4 0.14.3",
        "X-BeenThere": "linux-mtd@lists.infradead.org",
        "X-Mailman-Version": "2.1.34",
        "Precedence": "list",
        "List-Id": "Linux MTD discussion mailing list <linux-mtd.lists.infradead.org>",
        "List-Unsubscribe": "<http://lists.infradead.org/mailman/options/linux-mtd>,\n <mailto:linux-mtd-request@lists.infradead.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.infradead.org/pipermail/linux-mtd/>",
        "List-Post": "<mailto:linux-mtd@lists.infradead.org>",
        "List-Help": "<mailto:linux-mtd-request@lists.infradead.org?subject=help>",
        "List-Subscribe": "<http://lists.infradead.org/mailman/listinfo/linux-mtd>,\n <mailto:linux-mtd-request@lists.infradead.org?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Sender": "\"linux-mtd\" <linux-mtd-bounces@lists.infradead.org>",
        "Errors-To": "linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org"
    },
    "content": "The callbacks into the MIPS RB532 platform to read the GPIO pin\nindicating that the NAND chip is ready are oldschool and does\nnot assign GPIOs as properties to the NAND device.\n\nAdd a capability to the generic platform NAND chip driver to use\na GPIO line to detect if a NAND chip is ready and override the\nplatform-local drv_ready() callback with this check if the GPIO\nis present.\n\nThis makes it possible to drop the legacy include header\n<linux/gpio.h> from the RB532 devices.\n\nSigned-off-by: Linus Walleij <linusw@kernel.org>\n---\n arch/mips/rb532/devices.c        | 36 +++++++++++++++++++++---------------\n drivers/mtd/nand/raw/plat_nand.c | 24 +++++++++++++++++++++++-\n 2 files changed, 44 insertions(+), 16 deletions(-)",
    "diff": "diff --git a/arch/mips/rb532/devices.c b/arch/mips/rb532/devices.c\nindex 3f56d9feb73a..c3d8d96d0ef5 100644\n--- a/arch/mips/rb532/devices.c\n+++ b/arch/mips/rb532/devices.c\n@@ -14,7 +14,6 @@\n #include <linux/platform_device.h>\n #include <linux/mtd/platnand.h>\n #include <linux/mtd/mtd.h>\n-#include <linux/gpio.h>\n #include <linux/gpio/machine.h>\n #include <linux/gpio/property.h>\n #include <linux/gpio_keys.h>\n@@ -135,12 +134,6 @@ static struct platform_device cf_slot0 = {\n \t.num_resources = ARRAY_SIZE(cf_slot0_res),\n };\n \n-/* Resources and device for NAND */\n-static int rb532_dev_ready(struct nand_chip *chip)\n-{\n-\treturn gpio_get_value(GPIO_RDY);\n-}\n-\n static void rb532_cmd_ctrl(struct nand_chip *chip, int cmd, unsigned int ctrl)\n {\n \tunsigned char orbits, nandbits;\n@@ -166,16 +159,23 @@ static struct resource nand_slot0_res[] = {\n };\n \n static struct platform_nand_data rb532_nand_data = {\n-\t.ctrl.dev_ready = rb532_dev_ready,\n \t.ctrl.cmd_ctrl\t= rb532_cmd_ctrl,\n };\n \n-static struct platform_device nand_slot0 = {\n-\t.name = \"gen_nand\",\n-\t.id = -1,\n-\t.resource = nand_slot0_res,\n-\t.num_resources = ARRAY_SIZE(nand_slot0_res),\n-\t.dev.platform_data = &rb532_nand_data,\n+static const struct property_entry nand0_properties[] = {\n+\tPROPERTY_ENTRY_GPIO(\"ready-gpios\", &rb532_gpio0_node,\n+\t\t\t    GPIO_RDY, GPIO_ACTIVE_HIGH),\n+\t{ }\n+};\n+\n+static const struct platform_device_info nand0_info  __initconst = {\n+\t.name\t\t= \"gen_nand\",\n+\t.id\t\t= PLATFORM_DEVID_NONE,\n+\t.res\t\t= nand_slot0_res,\n+\t.num_res\t= ARRAY_SIZE(nand_slot0_res),\n+\t.data\t\t= &rb532_nand_data,\n+\t.size_data\t= sizeof(struct platform_nand_data),\n+\t.properties\t= nand0_properties,\n };\n \n static struct mtd_partition rb532_partition_info[] = {\n@@ -234,7 +234,6 @@ static struct platform_device rb532_uart = {\n \n static struct platform_device *rb532_devs[] = {\n \t&korina_dev0,\n-\t&nand_slot0,\n \t&cf_slot0,\n \t&rb532_led,\n \t&rb532_uart,\n@@ -321,6 +320,13 @@ static int __init plat_setup_devices(void)\n \t */\n \tsoftware_node_register(&rb532_gpio0_node);\n \n+\tpd = platform_device_register_full(&nand0_info);\n+\tret = PTR_ERR_OR_ZERO(pd);\n+\tif (ret) {\n+\t\tpr_err(\"failed to create NAND slot0 device: %d\\n\", ret);\n+\t\treturn ret;\n+\t}\n+\n \tpd = platform_device_register_full(&rb532_button_info);\n \tret = PTR_ERR_OR_ZERO(pd);\n \tif (ret) {\ndiff --git a/drivers/mtd/nand/raw/plat_nand.c b/drivers/mtd/nand/raw/plat_nand.c\nindex 0bcd455328ef..fe31551bcf5f 100644\n--- a/drivers/mtd/nand/raw/plat_nand.c\n+++ b/drivers/mtd/nand/raw/plat_nand.c\n@@ -6,6 +6,7 @@\n  */\n \n #include <linux/err.h>\n+#include <linux/gpio/consumer.h>\n #include <linux/io.h>\n #include <linux/module.h>\n #include <linux/platform_device.h>\n@@ -17,6 +18,7 @@ struct plat_nand_data {\n \tstruct nand_controller\tcontroller;\n \tstruct nand_chip\tchip;\n \tvoid __iomem\t\t*io_base;\n+\tstruct gpio_desc\t*ready_gpio;\n };\n \n static int plat_nand_attach_chip(struct nand_chip *chip)\n@@ -32,6 +34,14 @@ static const struct nand_controller_ops plat_nand_ops = {\n \t.attach_chip = plat_nand_attach_chip,\n };\n \n+/* Resources and device for NAND */\n+static int plat_nand_gpio_dev_ready(struct nand_chip *chip)\n+{\n+\tstruct plat_nand_data *data = nand_get_controller_data(chip);\n+\n+\treturn gpiod_get_value(data->ready_gpio);\n+}\n+\n /*\n  * Probe for the NAND device.\n  */\n@@ -41,6 +51,7 @@ static int plat_nand_probe(struct platform_device *pdev)\n \tstruct plat_nand_data *data;\n \tstruct mtd_info *mtd;\n \tconst char **part_types;\n+\tstruct nand_chip *chip;\n \tint err = 0;\n \n \tif (!pdata) {\n@@ -59,9 +70,17 @@ static int plat_nand_probe(struct platform_device *pdev)\n \tif (!data)\n \t\treturn -ENOMEM;\n \n+\tdata->ready_gpio = devm_gpiod_get_optional(&pdev->dev, \"ready\",\n+\t\t\t\t\t\t   GPIOD_IN);\n+\tif (IS_ERR(data->ready_gpio))\n+\t\treturn dev_err_probe(&pdev->dev, PTR_ERR(data->ready_gpio),\n+\t\t\t\t     \"could not get READY GPIO\\n\");\n+\n \tdata->controller.ops = &plat_nand_ops;\n \tnand_controller_init(&data->controller);\n \tdata->chip.controller = &data->controller;\n+\tchip = &data->chip;\n+\tnand_set_controller_data(chip, data);\n \n \tdata->io_base = devm_platform_ioremap_resource(pdev, 0);\n \tif (IS_ERR(data->io_base))\n@@ -74,7 +93,10 @@ static int plat_nand_probe(struct platform_device *pdev)\n \tdata->chip.legacy.IO_ADDR_R = data->io_base;\n \tdata->chip.legacy.IO_ADDR_W = data->io_base;\n \tdata->chip.legacy.cmd_ctrl = pdata->ctrl.cmd_ctrl;\n-\tdata->chip.legacy.dev_ready = pdata->ctrl.dev_ready;\n+\tif (data->ready_gpio)\n+\t\tdata->chip.legacy.dev_ready = plat_nand_gpio_dev_ready;\n+\telse\n+\t\tdata->chip.legacy.dev_ready = pdata->ctrl.dev_ready;\n \tdata->chip.legacy.select_chip = pdata->ctrl.select_chip;\n \tdata->chip.legacy.write_buf = pdata->ctrl.write_buf;\n \tdata->chip.legacy.read_buf = pdata->ctrl.read_buf;\n",
    "prefixes": [
        "2/2"
    ]
}