get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1820094,
    "url": "http://patchwork.ozlabs.org/api/patches/1820094/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/patch/1faf99d4ae75fa9ac2b36e18fb71075469f246e1.1691717480.git.daniel@makrotopia.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": "<1faf99d4ae75fa9ac2b36e18fb71075469f246e1.1691717480.git.daniel@makrotopia.org>",
    "list_archive_url": null,
    "date": "2023-08-11T01:38:20",
    "name": "[v4,7/8] mtd: ubi: populate ubi volume fwnode",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": false,
    "hash": "930c16c14b41da2fe562e9086ac8e13ce316e2e7",
    "submitter": {
        "id": 64091,
        "url": "http://patchwork.ozlabs.org/api/people/64091/?format=api",
        "name": "Daniel Golle",
        "email": "daniel@makrotopia.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-mtd/patch/1faf99d4ae75fa9ac2b36e18fb71075469f246e1.1691717480.git.daniel@makrotopia.org/mbox/",
    "series": [
        {
            "id": 368347,
            "url": "http://patchwork.ozlabs.org/api/series/368347/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/list/?series=368347",
            "date": "2023-08-11T01:36:37",
            "name": "mtd: ubi: allow UBI volumes to provide NVMEM",
            "version": 4,
            "mbox": "http://patchwork.ozlabs.org/series/368347/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1820094/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1820094/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 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=<UNKNOWN>)",
            "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=EA0oXFB4;\n\tdkim-atps=neutral"
        ],
        "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 (P-384) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4RMRKP3ld3z1yf2\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 11 Aug 2023 11:39:05 +1000 (AEST)",
            "from localhost ([::1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux))\n\tid 1qUH6s-0095R1-1d;\n\tFri, 11 Aug 2023 01:38:38 +0000",
            "from pidgin.makrotopia.org ([185.142.180.65])\n\tby bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux))\n\tid 1qUH6q-0095QB-0N\n\tfor linux-mtd@lists.infradead.org;\n\tFri, 11 Aug 2023 01:38:37 +0000",
            "from local\n\tby pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256)\n\t (Exim 4.96)\n\t(envelope-from <daniel@makrotopia.org>)\n\tid 1qUH6h-000569-34;\n\tFri, 11 Aug 2023 01:38:28 +0000"
        ],
        "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:In-Reply-To:MIME-Version:References:\n\tMessage-ID:Subject:To:From:Date:Reply-To:Cc:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=ws/6P7fJJdshKIJzjBslCtI6JVulqJDZUPTWshd+bcM=; b=EA0oXFB4/53/eA\n\tmSlehst/MiPulkU9AjhFtDY5bYGwj3Rv8uZWoIfx61KsErFaXl5XFBZ/kKLG/lbm7eyOTJe2/sGhJ\n\tEwrgPevKQblyKUYuVoNNHMBPDHfkRkxWu1044FirxoLZ4IfqHxoMll34wmOjnRgnOCQJiXJ1kO2Fk\n\tL7+KbJRtyxvz/BVYsgoTwfpSK7mBmK0z6uK41lA8I+sV10u82plpq1IBXjcKptkoGhHrL0+NphvqB\n\tejdXWwtai1D3l5E3tGzWAWamugrsZi/pJt82naVtlZY7pLgekfE9BvvApKVX0zymXUxrDnt0i/IUs\n\tYhODSrQtZBerShQDgVeg==;",
        "Date": "Fri, 11 Aug 2023 02:38:20 +0100",
        "From": "Daniel Golle <daniel@makrotopia.org>",
        "To": "Randy Dunlap <rdunlap@infradead.org>,\n\tMiquel Raynal <miquel.raynal@bootlin.com>,\n\tRichard Weinberger <richard@nod.at>,\n\tVignesh Raghavendra <vigneshr@ti.com>,\n\tRob Herring <robh+dt@kernel.org>,\n\tKrzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,\n\tConor Dooley <conor+dt@kernel.org>,\n\tDaniel Golle <daniel@makrotopia.org>, linux-mtd@lists.infradead.org,\n\tdevicetree@vger.kernel.org, linux-kernel@vger.kernel.org",
        "Subject": "[PATCH v4 7/8] mtd: ubi: populate ubi volume fwnode",
        "Message-ID": "\n <1faf99d4ae75fa9ac2b36e18fb71075469f246e1.1691717480.git.daniel@makrotopia.org>",
        "References": "<cover.1691717480.git.daniel@makrotopia.org>",
        "MIME-Version": "1.0",
        "Content-Disposition": "inline",
        "In-Reply-To": "<cover.1691717480.git.daniel@makrotopia.org>",
        "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ",
        "X-CRM114-CacheID": "sfid-20230810_183836_149672_EE7BAA18 ",
        "X-CRM114-Status": "GOOD (  12.69  )",
        "X-Spam-Score": "0.0 (/)",
        "X-Spam-Report": "Spam detection software,\n running on the system \"bombadil.infradead.org\",\n has NOT identified this incoming email as spam.  The original\n message has been attached to this so you can view it or label\n similar future email.  If you have any questions, see\n the administrator of that system for details.\n Content preview:  Look for the 'volumes' subnode of an MTD partition attached\n    to a UBI device and attach matching child nodes to UBI volumes. This\n allows\n    UBI volumes to be referenced in device tree, e.g. for use as NVM [...]\n Content analysis details:   (0.0 points, 5.0 required)\n  pts rule name              description\n ---- ----------------------\n --------------------------------------------------\n -0.0 SPF_PASS               SPF: sender matches SPF record\n  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record",
        "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": "Look for the 'volumes' subnode of an MTD partition attached to a UBI\ndevice and attach matching child nodes to UBI volumes.\nThis allows UBI volumes to be referenced in device tree, e.g. for use\nas NVMEM providers.\n\nSigned-off-by: Daniel Golle <daniel@makrotopia.org>\n---\n drivers/mtd/ubi/vmt.c | 27 +++++++++++++++++++++++++++\n 1 file changed, 27 insertions(+)",
    "diff": "diff --git a/drivers/mtd/ubi/vmt.c b/drivers/mtd/ubi/vmt.c\nindex eed4b57c61bda..9db845a43ecfc 100644\n--- a/drivers/mtd/ubi/vmt.c\n+++ b/drivers/mtd/ubi/vmt.c\n@@ -124,6 +124,31 @@ static void vol_release(struct device *dev)\n \tkfree(vol);\n }\n \n+static struct fwnode_handle *find_volume_fwnode(struct ubi_volume *vol)\n+{\n+\tstruct fwnode_handle *fw_vols, *fw_vol;\n+\tconst char *volname;\n+\tu32 volid;\n+\n+\tfw_vols = device_get_named_child_node(vol->dev.parent->parent, \"volumes\");\n+\tif (!fw_vols)\n+\t\treturn NULL;\n+\n+\tfwnode_for_each_child_node(fw_vols, fw_vol) {\n+\t\tif (!fwnode_property_read_string(fw_vol, \"volume-name\", &volname) &&\n+\t\t    strncmp(volname, vol->name, vol->name_len))\n+\t\t\tcontinue;\n+\n+\t\tif (!fwnode_property_read_u32(fw_vol, \"volume-id\", &volid) &&\n+\t\t    vol->vol_id != volid)\n+\t\t\tcontinue;\n+\n+\t\treturn fw_vol;\n+\t}\n+\n+\treturn NULL;\n+}\n+\n /**\n  * ubi_create_volume - create volume.\n  * @ubi: UBI device description object\n@@ -223,6 +248,7 @@ int ubi_create_volume(struct ubi_device *ubi, struct ubi_mkvol_req *req)\n \tvol->name_len  = req->name_len;\n \tmemcpy(vol->name, req->name, vol->name_len);\n \tvol->ubi = ubi;\n+\tdevice_set_node(&vol->dev, find_volume_fwnode(vol));\n \n \t/*\n \t * Finish all pending erases because there may be some LEBs belonging\n@@ -597,6 +623,7 @@ int ubi_add_volume(struct ubi_device *ubi, struct ubi_volume *vol)\n \tvol->dev.class = &ubi_class;\n \tvol->dev.groups = volume_dev_groups;\n \tdev_set_name(&vol->dev, \"%s_%d\", ubi->ubi_name, vol->vol_id);\n+\tdevice_set_node(&vol->dev, find_volume_fwnode(vol));\n \terr = device_register(&vol->dev);\n \tif (err) {\n \t\tcdev_del(&vol->cdev);\n",
    "prefixes": [
        "v4",
        "7/8"
    ]
}