get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1157049,
    "url": "http://patchwork.ozlabs.org/api/patches/1157049/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20190903143850.9824-15-lukma@denx.de/",
    "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": "<20190903143850.9824-15-lukma@denx.de>",
    "list_archive_url": null,
    "date": "2019-09-03T14:38:50",
    "name": "[U-Boot,v2,14/14] imx: Rewrite display5 get_board_id() function to use dm_gpio_* API",
    "commit_ref": "45aac6dd7afe73be69ab432c06eb97f9920c491f",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "9088826097f2d6f45c66e79fd9baf29818f6fefa",
    "submitter": {
        "id": 70701,
        "url": "http://patchwork.ozlabs.org/api/people/70701/?format=api",
        "name": "Lukasz Majewski",
        "email": "lukma@denx.de"
    },
    "delegate": {
        "id": 1693,
        "url": "http://patchwork.ozlabs.org/api/users/1693/?format=api",
        "username": "sbabic",
        "first_name": "Stefano",
        "last_name": "Babic",
        "email": "sbabic@denx.de"
    },
    "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20190903143850.9824-15-lukma@denx.de/mbox/",
    "series": [
        {
            "id": 128783,
            "url": "http://patchwork.ozlabs.org/api/series/128783/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=128783",
            "date": "2019-09-03T14:38:36",
            "name": "DM: display5: Convert display5 board to DM/DTS (including 'factory' setup)",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/128783/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1157049/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1157049/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\tdmarc=none (p=none dis=none) header.from=denx.de"
        ],
        "Received": [
            "from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 46N8nt2PyBz9s7T\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed,  4 Sep 2019 00:43:14 +1000 (AEST)",
            "by lists.denx.de (Postfix, from userid 105)\n\tid CEB89C21E3B; Tue,  3 Sep 2019 14:41:51 +0000 (UTC)",
            "from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id EF7B3C21C50;\n\tTue,  3 Sep 2019 14:41:49 +0000 (UTC)",
            "by lists.denx.de (Postfix, from userid 105)\n\tid F162AC21E0F; Tue,  3 Sep 2019 14:39:32 +0000 (UTC)",
            "from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9])\n\tby lists.denx.de (Postfix) with ESMTPS id 99716C21D8E\n\tfor <u-boot@lists.denx.de>; Tue,  3 Sep 2019 14:39:30 +0000 (UTC)",
            "from frontend01.mail.m-online.net (unknown [192.168.8.182])\n\tby mail-out.m-online.net (Postfix) with ESMTP id 46N8jZ3HNyz1rLlH;\n\tTue,  3 Sep 2019 16:39:30 +0200 (CEST)",
            "from localhost (dynscan1.mnet-online.de [192.168.6.70])\n\tby mail.m-online.net (Postfix) with ESMTP id 46N8jZ34Y7z1qqkP;\n\tTue,  3 Sep 2019 16:39:30 +0200 (CEST)",
            "from mail.mnet-online.de ([192.168.8.182])\n\tby localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new,\n\tport 10024)\n\twith ESMTP id 2bnrDTAX28GQ; Tue,  3 Sep 2019 16:39:29 +0200 (CEST)",
            "from localhost.localdomain (85-222-111-42.dynamic.chello.pl\n\t[85.222.111.42])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby mail.mnet-online.de (Postfix) with ESMTPSA;\n\tTue,  3 Sep 2019 16:39:29 +0200 (CEST)"
        ],
        "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=none autolearn=unavailable\n\tautolearn_force=no version=3.4.0",
        "X-Virus-Scanned": "amavisd-new at mnet-online.de",
        "X-Auth-Info": "m7cB5ElSq8a3nR2p+OIU6OSiUUc5wnFs4KvuDgZNVLk=",
        "From": "Lukasz Majewski <lukma@denx.de>",
        "To": "u-boot@lists.denx.de,\n\tStefano Babic <sbabic@denx.de>",
        "Date": "Tue,  3 Sep 2019 16:38:50 +0200",
        "Message-Id": "<20190903143850.9824-15-lukma@denx.de>",
        "X-Mailer": "git-send-email 2.11.0",
        "In-Reply-To": "<20190903143850.9824-1-lukma@denx.de>",
        "References": "<20190903143850.9824-1-lukma@denx.de>",
        "Subject": "[U-Boot] [PATCH v2 14/14] imx: Rewrite display5 get_board_id()\n\tfunction to use dm_gpio_* API",
        "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": "The get_board_id() function was using the old gpio_* compatibility layer\nto read HW and SW ID numbers encoded on the PCB board.\n\nAfter this change the new dm_gpio* API is used for this purpose.\n\nSigned-off-by: Lukasz Majewski <lukma@denx.de>\n\n---\n\nChanges in v2: None\n\n board/liebherr/display5/display5.c | 53 +++++++++++++++-----------------------\n 1 file changed, 21 insertions(+), 32 deletions(-)",
    "diff": "diff --git a/board/liebherr/display5/display5.c b/board/liebherr/display5/display5.c\nindex b8dcd03fd9b6..85ca777c1d22 100644\n--- a/board/liebherr/display5/display5.c\n+++ b/board/liebherr/display5/display5.c\n@@ -36,60 +36,49 @@ static bool sw_ids_valid;\n static u32 cpu_id;\n static u32 unit_id;\n \n-#define SW0\tIMX_GPIO_NR(2, 4)\n-#define SW1\tIMX_GPIO_NR(2, 5)\n-#define SW2\tIMX_GPIO_NR(2, 6)\n-#define SW3\tIMX_GPIO_NR(2, 7)\n-#define HW0\tIMX_GPIO_NR(6, 7)\n-#define HW1\tIMX_GPIO_NR(6, 9)\n-#define HW2\tIMX_GPIO_NR(6, 10)\n-#define HW3\tIMX_GPIO_NR(6, 11)\n-#define HW4\tIMX_GPIO_NR(4, 7)\n-#define HW5\tIMX_GPIO_NR(4, 11)\n-#define HW6\tIMX_GPIO_NR(4, 13)\n-#define HW7\tIMX_GPIO_NR(4, 15)\n-\n-int gpio_table_sw_ids[] = {\n-\tSW0, SW1, SW2, SW3\n+const char *gpio_table_sw_names[] = {\n+\t\"GPIO2_4\", \"GPIO2_5\", \"GPIO2_6\", \"GPIO2_7\"\n };\n \n const char *gpio_table_sw_ids_names[] = {\n \t\"sw0\", \"sw1\", \"sw2\", \"sw3\"\n };\n \n-int gpio_table_hw_ids[] = {\n-\tHW0, HW1, HW2, HW3, HW4, HW5, HW6, HW7\n+const char *gpio_table_hw_names[] = {\n+\t\"GPIO6_7\", \"GPIO6_9\", \"GPIO6_10\", \"GPIO6_11\",\n+\t\"GPIO4_7\", \"GPIO4_11\", \"GPIO4_13\", \"GPIO4_15\"\n };\n \n const char *gpio_table_hw_ids_names[] = {\n \t\"hw0\", \"hw1\", \"hw2\", \"hw3\", \"hw4\", \"hw5\", \"hw6\", \"hw7\"\n };\n \n-static int get_board_id(int *ids, const char **c, int size,\n-\t\t\tbool *valid, u32 *id)\n+static int get_board_id(const char **pin_names, const char **ids_names,\n+\t\t\tint size, bool *valid, u32 *id)\n {\n+\tstruct gpio_desc desc;\n \tint i, ret, val;\n \n \t*valid = false;\n \n \tfor (i = 0; i < size; i++) {\n-\t\tret = gpio_request(ids[i], c[i]);\n+\t\tmemset(&desc, 0, sizeof(desc));\n+\n+\t\tret = dm_gpio_lookup_name(pin_names[i], &desc);\n \t\tif (ret) {\n-\t\t\tprintf(\"Can't request SWx gpios\\n\");\n+\t\t\tprintf(\"Can't lookup request SWx gpios\\n\");\n \t\t\treturn ret;\n \t\t}\n-\t}\n \n-\tfor (i = 0; i < size; i++) {\n-\t\tret = gpio_direction_input(ids[i]);\n+\t\tret = dm_gpio_request(&desc, ids_names[i]);\n \t\tif (ret) {\n-\t\t\tprintf(\"Can't set SWx gpios direction\\n\");\n+\t\t\tprintf(\"Can't lookup request SWx gpios\\n\");\n \t\t\treturn ret;\n \t\t}\n-\t}\n \n-\tfor (i = 0; i < size; i++) {\n-\t\tval = gpio_get_value(ids[i]);\n+\t\tdm_gpio_set_dir_flags(&desc, GPIOD_IS_IN);\n+\n+\t\tval = dm_gpio_get_value(&desc);\n \t\tif (val < 0) {\n \t\t\tprintf(\"Can't get SW%d ID\\n\", i);\n \t\t\t*id = 0;\n@@ -176,12 +165,12 @@ int board_init(void)\n \t/* Setup misc (application specific) stuff */\n \tSETUP_IOMUX_PADS(misc_pads);\n \n-\tget_board_id(gpio_table_sw_ids, &gpio_table_sw_ids_names[0],\n-\t\t     ARRAY_SIZE(gpio_table_sw_ids), &sw_ids_valid, &unit_id);\n+\tget_board_id(gpio_table_sw_names, &gpio_table_sw_ids_names[0],\n+\t\t     ARRAY_SIZE(gpio_table_sw_names), &sw_ids_valid, &unit_id);\n \tdebug(\"SWx unit_id 0x%x\\n\", unit_id);\n \n-\tget_board_id(gpio_table_hw_ids, &gpio_table_hw_ids_names[0],\n-\t\t     ARRAY_SIZE(gpio_table_hw_ids), &hw_ids_valid, &cpu_id);\n+\tget_board_id(gpio_table_hw_names, &gpio_table_hw_ids_names[0],\n+\t\t     ARRAY_SIZE(gpio_table_hw_names), &hw_ids_valid, &cpu_id);\n \tdebug(\"HWx cpu_id 0x%x\\n\", cpu_id);\n \n \tif (hw_ids_valid && sw_ids_valid)\n",
    "prefixes": [
        "U-Boot",
        "v2",
        "14/14"
    ]
}