get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 807268,
    "url": "http://patchwork.ozlabs.org/api/patches/807268/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20170829201601.64312-2-sjg@chromium.org/",
    "project": {
        "id": 18,
        "url": "http://patchwork.ozlabs.org/api/projects/18/?format=api",
        "name": "U-Boot",
        "link_name": "uboot",
        "list_id": "u-boot.lists.denx.de",
        "list_email": "u-boot@lists.denx.de",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20170829201601.64312-2-sjg@chromium.org>",
    "list_archive_url": null,
    "date": "2017-08-29T20:15:46",
    "name": "[U-Boot,v2,01/16] fdt: Sync libfdt up to upstream",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "54a08d65d70496dde035ea9c639198f25f1a3afa",
    "submitter": {
        "id": 6170,
        "url": "http://patchwork.ozlabs.org/api/people/6170/?format=api",
        "name": "Simon Glass",
        "email": "sjg@chromium.org"
    },
    "delegate": {
        "id": 3184,
        "url": "http://patchwork.ozlabs.org/api/users/3184/?format=api",
        "username": "sjg",
        "first_name": "Simon",
        "last_name": "Glass",
        "email": "sjg@chromium.org"
    },
    "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20170829201601.64312-2-sjg@chromium.org/mbox/",
    "series": [
        {
            "id": 462,
            "url": "http://patchwork.ozlabs.org/api/series/462/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=462",
            "date": "2017-08-29T20:15:45",
            "name": "dtoc: Add support for 64-bit addresses",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/462/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/807268/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/807268/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<u-boot-bounces@lists.denx.de>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org",
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=google.com header.i=@google.com\n\theader.b=\"EEtgSJjc\"; dkim-atps=neutral"
        ],
        "Received": [
            "from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xhg0P0c0dz9sR9\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 30 Aug 2017 06:17:09 +1000 (AEST)",
            "by lists.denx.de (Postfix, from userid 105)\n\tid AC511C22674; Tue, 29 Aug 2017 20:16:34 +0000 (UTC)",
            "from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id A67C9C225B7;\n\tTue, 29 Aug 2017 20:16:14 +0000 (UTC)",
            "by lists.denx.de (Postfix, from userid 105)\n\tid 4C55FC21E1E; Tue, 29 Aug 2017 20:16:11 +0000 (UTC)",
            "from mail-oi0-f49.google.com (mail-oi0-f49.google.com\n\t[209.85.218.49])\n\tby lists.denx.de (Postfix) with ESMTPS id 9D96CC21DF8\n\tfor <u-boot@lists.denx.de>; Tue, 29 Aug 2017 20:16:10 +0000 (UTC)",
            "by mail-oi0-f49.google.com with SMTP id r203so36444737oih.0\n\tfor <u-boot@lists.denx.de>; Tue, 29 Aug 2017 13:16:10 -0700 (PDT)",
            "from kiwi.bld.corp.google.com ([100.101.164.89])\n\tby smtp.gmail.com with ESMTPSA id\n\tj138sm3718052oib.20.2017.08.29.13.16.08\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tTue, 29 Aug 2017 13:16:08 -0700 (PDT)",
            "by kiwi.bld.corp.google.com (Postfix, from userid 121222)\n\tid A34A213FC5F; Tue, 29 Aug 2017 14:16:07 -0600 (MDT)"
        ],
        "X-Spam-Checker-Version": "SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de",
        "X-Spam-Level": "",
        "X-Spam-Status": "No, score=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,\n\tRCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,\n\tT_DKIM_INVALID autolearn=unavailable\n\tautolearn_force=no version=3.4.0",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n\ts=20161025; \n\th=sender:from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=KcSg1LnL6ip/8QPG3BE5F1uDb7YnpXIu0AtcskEFYek=;\n\tb=EEtgSJjckkawCVZ9ysQlrOvbItmY4uJ/hmjTFYtBhixvLq/Hv/Nt9qRzpBh33l4qrI\n\tXqMVA5VMko/7Ywb3jQK8AnnlRRY4dyI/OuddIr2TB+KxQyj5Bv9ca6UJIUrVGd1vYQPu\n\tYr5DTi96eQcK8lkqu1e33s0VbVA/AB+cJ0pAFADbQbmqGqEcC/0/aswRHBllfzdHrTsY\n\tCXC6Ups6XNq/7b5S6KfSWGBjslBJBOETvm662G1fkLbKyVKj92owKxmVik+a3M5HsCdY\n\tH7f8THfmaXDZutah03rcsgd3F2k+rxjXfElC9qOKMlIaP9fqbTloxjdMjehUPXETFqtD\n\tJ4eQ==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:sender:from:to:cc:subject:date:message-id\n\t:in-reply-to:references;\n\tbh=KcSg1LnL6ip/8QPG3BE5F1uDb7YnpXIu0AtcskEFYek=;\n\tb=WDdDuoRHCWoimI5nVZM/ghQ9GnNvXYsuJsUM10/EGGPEDXwds/aMVlzjqr5CSkWWRf\n\tDtTHk/ldHf+8mCwPh9zZYDVw1sGxqUQe+RdNwSY4ly+dFovTKuJ2et9Up2JdA9hrvNtI\n\tac/8Z/SzPFZ/xqfz7vrgV5dqhi2GLIsciVZFoL0KycJBZgfF3r403JNnpCheEI5+qfn9\n\t7HHmdTMkIYfgIH7NpSkEPpjloqtCXeSoljQ3VdWjKvfc/u/USjqJBVrKC5xku144yN/7\n\t5wKLNYOEZgmi27ei5cDiB0V3L8n0w0R2Uy2FQWqTxxFmtqqxgbySNU5/RMKC4f1VyX0G\n\tKRsw==",
        "X-Gm-Message-State": "AHYfb5j7/xbRzWAIplFvVExUq0PPBSprNg777regJ7lCI+prBuRxzG0A\n\tsGmJrv2YiPrKanP5",
        "X-Google-Smtp-Source": "ADKCNb4fZ/3tkQdbqjdKVagNIGZ5U/kHgf05DPLnrc/8GOwSizTj8Wbi8OyOvEhmMKlvAGnZS1eOYA==",
        "X-Received": "by 10.202.114.199 with SMTP id\n\tp190mr1367530oic.122.1504037768910; \n\tTue, 29 Aug 2017 13:16:08 -0700 (PDT)",
        "From": "Simon Glass <sjg@chromium.org>",
        "To": "U-Boot Mailing List <u-boot@lists.denx.de>",
        "Date": "Tue, 29 Aug 2017 14:15:46 -0600",
        "Message-Id": "<20170829201601.64312-2-sjg@chromium.org>",
        "X-Mailer": "git-send-email 2.14.1.342.g6490525c54-goog",
        "In-Reply-To": "<20170829201601.64312-1-sjg@chromium.org>",
        "References": "<20170829201601.64312-1-sjg@chromium.org>",
        "Cc": "Tom Rini <trini@konsulko.com>, Jerry Van Baren <vanbaren@cideas.com>",
        "Subject": "[U-Boot] [PATCH v2 01/16] fdt: Sync libfdt up to upstream",
        "X-BeenThere": "u-boot@lists.denx.de",
        "X-Mailman-Version": "2.1.18",
        "Precedence": "list",
        "List-Id": "U-Boot discussion <u-boot.lists.denx.de>",
        "List-Unsubscribe": "<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>",
        "List-Archive": "<http://lists.denx.de/pipermail/u-boot/>",
        "List-Post": "<mailto:u-boot@lists.denx.de>",
        "List-Help": "<mailto:u-boot-request@lists.denx.de?subject=help>",
        "List-Subscribe": "<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "base64",
        "Errors-To": "u-boot-bounces@lists.denx.de",
        "Sender": "\"U-Boot\" <u-boot-bounces@lists.denx.de>"
    },
    "content": "Add upstream changes to U-Boot:\n\n- new pylibfdt functions\n- fdt_setprop_placeholder()\n\nSigned-off-by: Simon Glass <sjg@chromium.org>\n---\n\nChanges in v2: None\n\n lib/libfdt/fdt_rw.c          | 20 ++++++++++++---\n lib/libfdt/libfdt.h          | 31 +++++++++++++++++++++++\n lib/libfdt/pylibfdt/libfdt.i | 58 ++++++++++++++++++++++++++++++++++++++++++++\n 3 files changed, 106 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/lib/libfdt/fdt_rw.c b/lib/libfdt/fdt_rw.c\nindex 80a3212141..3dc775261f 100644\n--- a/lib/libfdt/fdt_rw.c\n+++ b/lib/libfdt/fdt_rw.c\n@@ -228,8 +228,8 @@ int fdt_set_name(void *fdt, int nodeoffset, const char *name)\n \treturn 0;\n }\n \n-int fdt_setprop(void *fdt, int nodeoffset, const char *name,\n-\t\tconst void *val, int len)\n+int fdt_setprop_placeholder(void *fdt, int nodeoffset, const char *name,\n+\t\t\t    int len, void **prop_data)\n {\n \tstruct fdt_property *prop;\n \tint err;\n@@ -242,8 +242,22 @@ int fdt_setprop(void *fdt, int nodeoffset, const char *name,\n \tif (err)\n \t\treturn err;\n \n+\t*prop_data = prop->data;\n+\treturn 0;\n+}\n+\n+int fdt_setprop(void *fdt, int nodeoffset, const char *name,\n+\t\tconst void *val, int len)\n+{\n+\tvoid *prop_data;\n+\tint err;\n+\n+\terr = fdt_setprop_placeholder(fdt, nodeoffset, name, len, &prop_data);\n+\tif (err)\n+\t\treturn err;\n+\n \tif (len)\n-\t\tmemcpy(prop->data, val, len);\n+\t\tmemcpy(prop_data, val, len);\n \treturn 0;\n }\n \ndiff --git a/lib/libfdt/libfdt.h b/lib/libfdt/libfdt.h\nindex f3f9cad184..6af94cb3f7 100644\n--- a/lib/libfdt/libfdt.h\n+++ b/lib/libfdt/libfdt.h\n@@ -1404,6 +1404,37 @@ int fdt_set_name(void *fdt, int nodeoffset, const char *name);\n int fdt_setprop(void *fdt, int nodeoffset, const char *name,\n \t\tconst void *val, int len);\n \n+/**\n+ * fdt_setprop _placeholder - allocate space for a property\n+ * @fdt: pointer to the device tree blob\n+ * @nodeoffset: offset of the node whose property to change\n+ * @name: name of the property to change\n+ * @len: length of the property value\n+ * @prop_data: return pointer to property data\n+ *\n+ * fdt_setprop_placeholer() allocates the named property in the given node.\n+ * If the property exists it is resized. In either case a pointer to the\n+ * property data is returned.\n+ *\n+ * This function may insert or delete data from the blob, and will\n+ * therefore change the offsets of some existing nodes.\n+ *\n+ * returns:\n+ *\t0, on success\n+ *\t-FDT_ERR_NOSPACE, there is insufficient free space in the blob to\n+ *\t\tcontain the new property value\n+ *\t-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag\n+ *\t-FDT_ERR_BADLAYOUT,\n+ *\t-FDT_ERR_BADMAGIC,\n+ *\t-FDT_ERR_BADVERSION,\n+ *\t-FDT_ERR_BADSTATE,\n+ *\t-FDT_ERR_BADSTRUCTURE,\n+ *\t-FDT_ERR_BADLAYOUT,\n+ *\t-FDT_ERR_TRUNCATED, standard meanings\n+ */\n+int fdt_setprop_placeholder(void *fdt, int nodeoffset, const char *name,\n+\t\t\t    int len, void **prop_data);\n+\n /**\n  * fdt_setprop_u32 - set a property to a 32-bit integer\n  * @fdt: pointer to the device tree blob\ndiff --git a/lib/libfdt/pylibfdt/libfdt.i b/lib/libfdt/pylibfdt/libfdt.i\nindex 3b11bb0c95..6c44996c31 100644\n--- a/lib/libfdt/pylibfdt/libfdt.i\n+++ b/lib/libfdt/pylibfdt/libfdt.i\n@@ -128,6 +128,23 @@ class Fdt:\n         self._fdt = bytearray(data)\n         check_err(fdt_check_header(self._fdt));\n \n+    def subnode_offset(self, parentoffset, name, quiet=()):\n+        \"\"\"Get the offset of a named subnode\n+\n+        Args:\n+            parentoffset: Offset of the parent node to check\n+            name: Name of the required subnode, e.g. 'subnode@1'\n+            quiet: Errors to ignore (empty to raise on all errors)\n+\n+        Returns:\n+            The node offset of the found node, if any\n+\n+        Raises\n+            FdtException if there is no node with that name, or other error\n+        \"\"\"\n+        return check_err(fdt_subnode_offset(self._fdt, parentoffset, name),\n+                         quiet)\n+\n     def path_offset(self, path, quiet=()):\n         \"\"\"Get the offset for a given path\n \n@@ -302,6 +319,47 @@ class Fdt:\n             return pdata\n         return bytearray(pdata[0])\n \n+    def get_phandle(self, nodeoffset):\n+        \"\"\"Get the phandle of a node\n+\n+        Args:\n+            nodeoffset: Node offset to check\n+\n+        Returns:\n+            phandle of node, or 0 if the node has no phandle or another error\n+            occurs\n+        \"\"\"\n+        return fdt_get_phandle(self._fdt, nodeoffset)\n+\n+    def parent_offset(self, nodeoffset, quiet=()):\n+        \"\"\"Get the offset of a node's parent\n+\n+        Args:\n+            nodeoffset: Node offset to check\n+            quiet: Errors to ignore (empty to raise on all errors)\n+\n+        Returns:\n+            The offset of the parent node, if any\n+\n+        Raises:\n+            FdtException if no parent found or other error occurs\n+        \"\"\"\n+        return check_err(fdt_parent_offset(self._fdt, nodeoffset), quiet)\n+\n+    def node_offset_by_phandle(self, phandle, quiet=()):\n+        \"\"\"Get the offset of a node with the given phandle\n+\n+        Args:\n+            phandle: Phandle to search for\n+            quiet: Errors to ignore (empty to raise on all errors)\n+\n+        Returns:\n+            The offset of node with that phandle, if any\n+\n+        Raises:\n+            FdtException if no node found or other error occurs\n+        \"\"\"\n+        return check_err(fdt_node_offset_by_phandle(self._fdt, phandle), quiet)\n \n class Property:\n     \"\"\"Holds a device tree property name and value.\n",
    "prefixes": [
        "U-Boot",
        "v2",
        "01/16"
    ]
}