get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 807286,
    "url": "http://patchwork.ozlabs.org/api/patches/807286/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20170829201601.64312-11-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-11-sjg@chromium.org>",
    "list_archive_url": null,
    "date": "2017-08-29T20:15:55",
    "name": "[U-Boot,v2,10/16] dtoc: Rename is_phandle() and adjust it to return more detail",
    "commit_ref": "8fed2eb20c2ef95d69f9683ab07f0ea869616713",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "ce96f505202007c50f28968606e62f74c4fe8210",
    "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-11-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/807286/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/807286/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=\"D14kquHC\"; dkim-atps=neutral"
        ],
        "Received": [
            "from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xhgHG5s2Cz9sQl\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 30 Aug 2017 06:30:02 +1000 (AEST)",
            "by lists.denx.de (Postfix, from userid 105)\n\tid 740ADC2254B; Tue, 29 Aug 2017 20:23:26 +0000 (UTC)",
            "from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 2E6AEC2268A;\n\tTue, 29 Aug 2017 20:18:11 +0000 (UTC)",
            "by lists.denx.de (Postfix, from userid 105)\n\tid 5C486C22656; Tue, 29 Aug 2017 20:16:26 +0000 (UTC)",
            "from mail-oi0-f47.google.com (mail-oi0-f47.google.com\n\t[209.85.218.47])\n\tby lists.denx.de (Postfix) with ESMTPS id 6CD2FC225AB\n\tfor <u-boot@lists.denx.de>; Tue, 29 Aug 2017 20:16:20 +0000 (UTC)",
            "by mail-oi0-f47.google.com with SMTP id r203so36448231oih.0\n\tfor <u-boot@lists.denx.de>; Tue, 29 Aug 2017 13:16:20 -0700 (PDT)",
            "from kiwi.bld.corp.google.com ([2620:0:10f2:0:e46b:9284:3d4c:e46e])\n\tby smtp.gmail.com with ESMTPSA id\n\tp128sm3538155oif.33.2017.08.29.13.16.17\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tTue, 29 Aug 2017 13:16:18 -0700 (PDT)",
            "by kiwi.bld.corp.google.com (Postfix, from userid 121222)\n\tid 20CE613FC5F; Tue, 29 Aug 2017 14:16:17 -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_H2,\n\tT_DKIM_INVALID autolearn=unavailable autolearn_force=no\n\tversion=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=dRuJPnj08/Sb98QR3/N2nVJv3A6iAlwg8JQoIy4HUAA=;\n\tb=D14kquHCQQs8zMU2bxluV7fnlbyGKH/o8uEmSLDkDwiZ7G+qDBiVFAH168WGQbofQA\n\taDX8zHTE5mBh+yI6ijz+IMqYRxUzt1HzOLOOmAqe9scAeYqg281Kvc5WbZi3BBsoKApS\n\tOuw5ooHei/1XA7b3SuheKqHWELWRYjTOuWwwoN/qJVV69L+Vi/wq8q5A+nFJ78s8wm1J\n\tz4M2x7O+geNdIKtUpxlXI/JI0JkwsJjRsRFR24ZvsXp9wy/G0Kc1GXxrT0WzOFYE+76u\n\tDH42Pn1SvVe0TZe+mp2RKgRY6KB34g5LQL+fNmJnArQ3bJMdB4xglpKyhrsG8P2QsRAc\n\timXQ==",
        "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=dRuJPnj08/Sb98QR3/N2nVJv3A6iAlwg8JQoIy4HUAA=;\n\tb=EK8YpFprsbIM/ih7XA3fNGInNxI7rhLcamKHsLLamq4jgLl/grCso17gM89lncjVL2\n\tlmD6+fL0V/OotuJhu9tFibPxZcLa90o2NbxPIT433abt5MRSkQH2m8/3xFhVkTAHdAre\n\ttWxJHdNm9fvsAcYml6OhQHtQzmXH7VqjLF8LdUIz4DsXszGAUdTpcpxHcKqXh1anyRUc\n\tsvOysrZFBZcvkU2SIfZeMc3AJMQxMswPa1kXWSWlWy2wg3V3V+Tk4ilM2V4+ilHaDu13\n\tv1jBWIbEzO+c1Zztdbx6Guo8QhnzGTBmJhHizdy8mYAMyuerG6u3zb5QoHSKhe0MNOER\n\teiXA==",
        "X-Gm-Message-State": "AHYfb5iGGXp/vvyDZNkLjy/Lwcj3zkFSV/jneVWAkY5A2FlHR/LSzVfs\n\tyXoUsm8ELbqqn/uo",
        "X-Google-Smtp-Source": "ADKCNb41QrsW2Q2x2D3PitVgxFhmJOUJ4+SSJRux+bGGAquKn+p7qRMLn6BYQJK/WYca9F1c11N73g==",
        "X-Received": "by 10.202.172.66 with SMTP id v63mr1597492oie.87.1504037778878; \n\tTue, 29 Aug 2017 13:16:18 -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:55 -0600",
        "Message-Id": "<20170829201601.64312-11-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>",
        "Subject": "[U-Boot] [PATCH v2 10/16] dtoc: Rename is_phandle() and adjust it\n\tto return more detail",
        "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": "Update this function to return more detail about a property that contains\nphandles. This will allow (in a future commit) more accurate handling of\nthese properties.\n\nSigned-off-by: Simon Glass <sjg@chromium.org>\n---\n\nChanges in v2: None\n\n tools/dtoc/dtb_platdata.py       | 79 +++++++++++++++++++++++++++++-----------\n tools/dtoc/dtoc_test_phandle.dts |  1 +\n 2 files changed, 58 insertions(+), 22 deletions(-)",
    "diff": "diff --git a/tools/dtoc/dtb_platdata.py b/tools/dtoc/dtb_platdata.py\nindex a483d6c875..001bc4ea66 100644\n--- a/tools/dtoc/dtb_platdata.py\n+++ b/tools/dtoc/dtb_platdata.py\n@@ -12,6 +12,7 @@ This supports converting device tree data to C structures definitions and\n static data.\n \"\"\"\n \n+import collections\n import copy\n import sys\n \n@@ -44,6 +45,14 @@ TYPE_NAMES = {\n STRUCT_PREFIX = 'dtd_'\n VAL_PREFIX = 'dtv_'\n \n+# This holds information about a property which includes phandles.\n+#\n+# max_args: integer: Maximum number or arguments that any phandle uses (int).\n+# args: Number of args for each phandle in the property. The total number of\n+#     phandles is len(args). This is a list of integers.\n+PhandleInfo = collections.namedtuple('PhandleInfo', ['max_args', 'args'])\n+\n+\n def conv_name_to_c(name):\n     \"\"\"Convert a device-tree name to a C identifier\n \n@@ -181,20 +190,42 @@ class DtbPlatdata(object):\n         self._lines = []\n         return lines\n \n-    def is_phandle(self, prop):\n-\t\"\"\"Check if a node contains phandles\n+    def get_phandle_argc(self, prop, node_name):\n+        \"\"\"Check if a node contains phandles\n \n-\tWe have no reliable way of detecting whether a node uses a phandle\n-\tor not. As an interim measure, use a list of known property names.\n+        We have no reliable way of detecting whether a node uses a phandle\n+        or not. As an interim measure, use a list of known property names.\n \n-\tArgs:\n-\t    prop: Prop object to check\n-\tReturn:\n-\t    True if the object value contains phandles, else False\n-\t\"\"\"\n-\tif prop.name in ['clocks']:\n-\t    return True\n-\treturn False\n+        Args:\n+            prop: Prop object to check\n+        Return:\n+            Number of argument cells is this is a phandle, else None\n+        \"\"\"\n+        if prop.name in ['clocks']:\n+            val = prop.value\n+            if not isinstance(val, list):\n+                val = [val]\n+            i = 0\n+\n+            max_args = 0\n+            args = []\n+            while i < len(val):\n+                phandle = fdt_util.fdt32_to_cpu(val[i])\n+                target = self._fdt.phandle_to_node.get(phandle)\n+                if not target:\n+                    raise ValueError(\"Cannot parse '%s' in node '%s'\" %\n+                                     (prop.name, node_name))\n+                prop_name = '#clock-cells'\n+                cells = target.props.get(prop_name)\n+                if not cells:\n+                    raise ValueError(\"Node '%s' has no '%s' property\" %\n+                            (target.name, prop_name))\n+                num_args = fdt_util.fdt32_to_cpu(cells.value)\n+                max_args = max(max_args, num_args)\n+                args.append(num_args)\n+                i += 1 + num_args\n+            return PhandleInfo(max_args, args)\n+        return None\n \n     def scan_dtb(self):\n         \"\"\"Scan the device tree to obtain a tree of nodes and properties\n@@ -358,14 +389,16 @@ class DtbPlatdata(object):\n             for pname, prop in node.props.items():\n                 if pname in PROP_IGNORE_LIST or pname[0] == '#':\n                     continue\n-                if isinstance(prop.value, list):\n-                    if self.is_phandle(prop):\n-                        # Process the list as pairs of (phandle, id)\n-                        value_it = iter(prop.value)\n-                        for phandle_cell, _ in zip(value_it, value_it):\n-                            phandle = fdt_util.fdt32_to_cpu(phandle_cell)\n-                            target_node = self._fdt.phandle_to_node[phandle]\n-                            node.phandles.add(target_node)\n+                info = self.get_phandle_argc(prop, node.name)\n+                if info:\n+                    if not isinstance(prop.value, list):\n+                        prop.value = [prop.value]\n+                    # Process the list as pairs of (phandle, id)\n+                    value_it = iter(prop.value)\n+                    for phandle_cell, _ in zip(value_it, value_it):\n+                        phandle = fdt_util.fdt32_to_cpu(phandle_cell)\n+                        target_node = self._fdt.phandle_to_node[phandle]\n+                        node.phandles.add(target_node)\n \n \n     def generate_structs(self, structs):\n@@ -383,7 +416,8 @@ class DtbPlatdata(object):\n             self.out('struct %s%s {\\n' % (STRUCT_PREFIX, name))\n             for pname in sorted(structs[name]):\n                 prop = structs[name][pname]\n-                if self.is_phandle(prop):\n+                info = self.get_phandle_argc(prop, structs[name])\n+                if info:\n                     # For phandles, include a reference to the target\n                     self.out('\\t%s%s[%d]' % (tab_to(2, 'struct phandle_2_cell'),\n                                              conv_name_to_c(prop.name),\n@@ -423,7 +457,8 @@ class DtbPlatdata(object):\n                 vals = []\n                 # For phandles, output a reference to the platform data\n                 # of the target node.\n-                if self.is_phandle(prop):\n+                info = self.get_phandle_argc(prop, node.name)\n+                if info:\n                     # Process the list as pairs of (phandle, id)\n                     value_it = iter(prop.value)\n                     for phandle_cell, id_cell in zip(value_it, value_it):\ndiff --git a/tools/dtoc/dtoc_test_phandle.dts b/tools/dtoc/dtoc_test_phandle.dts\nindex e9828a695b..c0a602f296 100644\n--- a/tools/dtoc/dtoc_test_phandle.dts\n+++ b/tools/dtoc/dtoc_test_phandle.dts\n@@ -13,6 +13,7 @@\n \t\tu-boot,dm-pre-reloc;\n \t\tcompatible = \"target\";\n \t\tintval = <1>;\n+                #clock-cells = <1>;\n \t};\n \n \tphandle-source {\n",
    "prefixes": [
        "U-Boot",
        "v2",
        "10/16"
    ]
}