get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 955991,
    "url": "http://patchwork.ozlabs.org/api/patches/955991/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20180810060711.6547-51-jagan@amarulasolutions.com/",
    "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": "<20180810060711.6547-51-jagan@amarulasolutions.com>",
    "list_archive_url": null,
    "date": "2018-08-10T06:07:08",
    "name": "[U-Boot,v2,50/53] reset: Get the RESET by index without device",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "d1d2218b3479cefbd26e1ce89aa09c38d06958af",
    "submitter": {
        "id": 69820,
        "url": "http://patchwork.ozlabs.org/api/people/69820/?format=api",
        "name": "Jagan Teki",
        "email": "jagan@amarulasolutions.com"
    },
    "delegate": {
        "id": 17739,
        "url": "http://patchwork.ozlabs.org/api/users/17739/?format=api",
        "username": "jagan",
        "first_name": "Jagannadha Sutradharudu",
        "last_name": "Teki",
        "email": "jagannadh.teki@gmail.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20180810060711.6547-51-jagan@amarulasolutions.com/mbox/",
    "series": [
        {
            "id": 60190,
            "url": "http://patchwork.ozlabs.org/api/series/60190/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=60190",
            "date": "2018-08-10T06:06:18",
            "name": "clk: Add Allwinner CLK, RESET support",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/60190/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/955991/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/955991/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; dmarc=none (p=none dis=none)\n\theader.from=amarulasolutions.com",
            "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=amarulasolutions.com\n\theader.i=@amarulasolutions.com header.b=\"q5MU0ZFM\"; \n\tdkim-atps=neutral"
        ],
        "Received": [
            "from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 41mwQX1f3Zz9s7Q\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 10 Aug 2018 16:37:08 +1000 (AEST)",
            "by lists.denx.de (Postfix, from userid 105)\n\tid E497EC21E2B; Fri, 10 Aug 2018 06:26:00 +0000 (UTC)",
            "from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id C7B29C21E75;\n\tFri, 10 Aug 2018 06:16:53 +0000 (UTC)",
            "by lists.denx.de (Postfix, from userid 105)\n\tid 0E914C21E44; Fri, 10 Aug 2018 06:10:58 +0000 (UTC)",
            "from mail-pg1-f195.google.com (mail-pg1-f195.google.com\n\t[209.85.215.195])\n\tby lists.denx.de (Postfix) with ESMTPS id C9368C21DA6\n\tfor <u-boot@lists.denx.de>; Fri, 10 Aug 2018 06:10:53 +0000 (UTC)",
            "by mail-pg1-f195.google.com with SMTP id a11-v6so3892903pgw.6\n\tfor <u-boot@lists.denx.de>; Thu, 09 Aug 2018 23:10:53 -0700 (PDT)",
            "from localhost.localdomain ([183.82.228.250])\n\tby smtp.gmail.com with ESMTPSA id\n\tr23-v6sm16880975pfj.5.2018.08.09.23.10.48\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tThu, 09 Aug 2018 23:10:51 -0700 (PDT)"
        ],
        "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_MSPIKE_H3,\n\tRCVD_IN_MSPIKE_WL,\n\tT_DKIM_INVALID autolearn=unavailable autolearn_force=no\n\tversion=3.4.0",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=amarulasolutions.com; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=HKG+wOo1MSPqPf3C5agvCa07hqyCKfAsdbVOjm6A4JA=;\n\tb=q5MU0ZFMWpbB0oRSXZCK7vdVqgFuWBd9JTIBTh5fzXukUFW/3mlT7Xtqu+E6gbcrhQ\n\tNjbmmxeS9jMv8txtRAwNoMjnvuBwRdgu020nK5ZFMEXLAvgzmvlFRCUPxP5soSRkArLm\n\tGmQoBzD8lK6l7YK8yILmVl6lkyyY610xUCT08=",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=HKG+wOo1MSPqPf3C5agvCa07hqyCKfAsdbVOjm6A4JA=;\n\tb=Gq/ClSXWMKxqnTXIcGv4z9F/g7g1icIHD3bm9WbZjH+hJEMuVKdCvF4vZE51/o5AfP\n\t3Uq46lxHk9qNyMqxAeIJn5HTSYECIr/Ucpx9HLJjDPhikBSm//xGL71/N5ON1TwRqmxV\n\t4ZRqSaZcgu+rkrVSGP7m1Rp2QofeAvPlYo7i6z1YQY0GeuDxj9tspm4EGkqFll2Dz75X\n\tPX1XyysUb2fpwSKyBEqmWxQVz/cYVxYrSxXzKcPL8wpmjhG6B8VmxaMc9ZbTk/NR5A1d\n\tprHihLx3nwK4uyfRTx9linUh+bsQyYi+qMAoAeitlZdkb5T/13o5vlig+GxUb7QEZFvG\n\tq/OQ==",
        "X-Gm-Message-State": "AOUpUlEf5PgD8npnep/Y+fRUzEkaA1xXUFfvIsNZCcDiMe2hJrdHlRwJ\n\t6uwnSziCBcJ/9ZL6nOHIDfQZtA==",
        "X-Google-Smtp-Source": "AA+uWPxZVEwOW48NwRa7wzajT4blrYfjsxKFhxsCBU6lmda3UTa9P5Xs55p+Y97Lkna2hffeo8Xonw==",
        "X-Received": "by 2002:a62:9ed1:: with SMTP id\n\tf78-v6mr5598222pfk.35.1533881452365; \n\tThu, 09 Aug 2018 23:10:52 -0700 (PDT)",
        "From": "Jagan Teki <jagan@amarulasolutions.com>",
        "To": "Maxime Ripard <maxime.ripard@bootlin.com>,\n\tAndre Przywara <andre.przywara@arm.com>, Chen-Yu Tsai <wens@csie.org>,\n\tIcenowy Zheng <icenowy@aosc.io>",
        "Date": "Fri, 10 Aug 2018 11:37:08 +0530",
        "Message-Id": "<20180810060711.6547-51-jagan@amarulasolutions.com>",
        "X-Mailer": "git-send-email 2.18.0.321.gffc6fa0e3",
        "In-Reply-To": "<20180810060711.6547-1-jagan@amarulasolutions.com>",
        "References": "<20180810060711.6547-1-jagan@amarulasolutions.com>",
        "MIME-Version": "1.0",
        "Cc": "Joe Hershberger <joe.hershberger@ni.com>, Tom Rini <trini@konsulko.com>, \n\tu-boot@lists.denx.de",
        "Subject": "[U-Boot] [PATCH v2 50/53] reset: Get the RESET by index without\n\tdevice",
        "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>",
        "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": "Getting a RESET by index with device is not straight forward\nfor some use-cases like handling clock operations for child\nnode in parent driver. So we need to process the child node\nin parent probe via ofnode and process RESET operation for child\nwithout udevice but with ofnode.\n\nSo add reset_get_by_index_nodev() and move the common code\nin reset_get_by_index_tail() to use for reset_get_by_index()\n\nCc: Simon Glass <sjg@chromium.org>\nCc: Joe Hershberger <joe.hershberger@ni.com>\nSigned-off-by: Jagan Teki <jagan@amarulasolutions.com>\n---\n drivers/reset/reset-uclass.c | 53 ++++++++++++++++++++++++------------\n include/reset.h              | 16 +++++++++++\n 2 files changed, 52 insertions(+), 17 deletions(-)",
    "diff": "diff --git a/drivers/reset/reset-uclass.c b/drivers/reset/reset-uclass.c\nindex 6320efcb49..755bbf7a5e 100644\n--- a/drivers/reset/reset-uclass.c\n+++ b/drivers/reset/reset-uclass.c\n@@ -34,41 +34,34 @@ static int reset_of_xlate_default(struct reset_ctl *reset_ctl,\n \treturn 0;\n }\n \n-int reset_get_by_index(struct udevice *dev, int index,\n-\t\t       struct reset_ctl *reset_ctl)\n+static int reset_get_by_index_tail(int ret, ofnode node,\n+\t\t\t\t   struct ofnode_phandle_args *args,\n+\t\t\t\t   const char *list_name, int index,\n+\t\t\t\t   struct reset_ctl *reset_ctl)\n {\n-\tstruct ofnode_phandle_args args;\n-\tint ret;\n \tstruct udevice *dev_reset;\n \tstruct reset_ops *ops;\n \n-\tdebug(\"%s(dev=%p, index=%d, reset_ctl=%p)\\n\", __func__, dev, index,\n-\t      reset_ctl);\n+\tassert(reset_ctl);\n \treset_ctl->dev = NULL;\n-\n-\tret = dev_read_phandle_with_args(dev, \"resets\", \"#reset-cells\", 0,\n-\t\t\t\t\t  index, &args);\n-\tif (ret) {\n-\t\tdebug(\"%s: fdtdec_parse_phandle_with_args() failed: %d\\n\",\n-\t\t      __func__, ret);\n+\tif (ret)\n \t\treturn ret;\n-\t}\n \n-\tret = uclass_get_device_by_ofnode(UCLASS_RESET, args.node,\n+\tret = uclass_get_device_by_ofnode(UCLASS_RESET, args->node,\n \t\t\t\t\t  &dev_reset);\n \tif (ret) {\n \t\tdebug(\"%s: uclass_get_device_by_ofnode() failed: %d\\n\",\n \t\t      __func__, ret);\n-\t\tdebug(\"%s %d\\n\", ofnode_get_name(args.node), args.args[0]);\n+\t\tdebug(\"%s %d\\n\", ofnode_get_name(args->node), args->args[0]);\n \t\treturn ret;\n \t}\n \tops = reset_dev_ops(dev_reset);\n \n \treset_ctl->dev = dev_reset;\n \tif (ops->of_xlate)\n-\t\tret = ops->of_xlate(reset_ctl, &args);\n+\t\tret = ops->of_xlate(reset_ctl, args);\n \telse\n-\t\tret = reset_of_xlate_default(reset_ctl, &args);\n+\t\tret = reset_of_xlate_default(reset_ctl, args);\n \tif (ret) {\n \t\tdebug(\"of_xlate() failed: %d\\n\", ret);\n \t\treturn ret;\n@@ -86,6 +79,32 @@ int reset_get_by_index(struct udevice *dev, int index,\n \treturn 0;\n }\n \n+int reset_get_by_index(struct udevice *dev, int index,\n+\t\t       struct reset_ctl *reset_ctl)\n+{\n+\tstruct ofnode_phandle_args args;\n+\tint ret;\n+\n+\tret = dev_read_phandle_with_args(dev, \"resets\", \"#reset-cells\", 0,\n+\t\t\t\t\t index, &args);\n+\n+\treturn reset_get_by_index_tail(ret, dev_ofnode(dev), &args, \"resets\",\n+\t\t\t\t       index > 0, reset_ctl);\n+}\n+\n+int reset_get_by_index_nodev(ofnode node, int index,\n+\t\t\t     struct reset_ctl *reset_ctl)\n+{\n+\tstruct ofnode_phandle_args args;\n+\tint ret;\n+\n+\tret = ofnode_parse_phandle_with_args(node, \"resets\", \"#reset-cells\", 0,\n+\t\t\t\t\t     index > 0, &args);\n+\n+\treturn reset_get_by_index_tail(ret, node, &args, \"resets\",\n+\t\t\t\t       index > 0, reset_ctl);\n+}\n+\n int reset_get_bulk(struct udevice *dev, struct reset_ctl_bulk *bulk)\n {\n \tint i, ret, err, count;\ndiff --git a/include/reset.h b/include/reset.h\nindex 70130bb886..581cc2579b 100644\n--- a/include/reset.h\n+++ b/include/reset.h\n@@ -6,6 +6,7 @@\n #ifndef _RESET_H\n #define _RESET_H\n \n+#include <dm/ofnode.h>\n #include <linux/errno.h>\n \n /**\n@@ -97,6 +98,21 @@ struct reset_ctl_bulk {\n int reset_get_by_index(struct udevice *dev, int index,\n \t\t       struct reset_ctl *reset_ctl);\n \n+/**\n+ * reset_get_by_index_nodev - Get/request a reset signal by integer index\n+ * without a device.\n+ *\n+ * This is a version of reset_get_by_index() that does not use a device.\n+ *\n+ * @node:\tThe client ofnode.\n+ * @index:\tThe index of the reset signal to request, within the client's\n+ *\t\tlist of reset signals.\n+ * @reset_ctl\tA pointer to a reset control struct to initialize.\n+ * @return 0 if OK, or a negative error code.\n+ */\n+int reset_get_by_index_nodev(ofnode node, int index,\n+\t\t\t     struct reset_ctl *reset_ctl);\n+\n /**\n  * reset_get_bulk - Get/request all reset signals of a device.\n  *\n",
    "prefixes": [
        "U-Boot",
        "v2",
        "50/53"
    ]
}