get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 817922,
    "url": "http://patchwork.ozlabs.org/api/patches/817922/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-gpio/patch/20170924145622.4031-6-linus.walleij@linaro.org/",
    "project": {
        "id": 42,
        "url": "http://patchwork.ozlabs.org/api/projects/42/?format=api",
        "name": "Linux GPIO development",
        "link_name": "linux-gpio",
        "list_id": "linux-gpio.vger.kernel.org",
        "list_email": "linux-gpio@vger.kernel.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20170924145622.4031-6-linus.walleij@linaro.org>",
    "list_archive_url": null,
    "date": "2017-09-24T14:56:19",
    "name": "[5/8] extcon: gpio: Request reasonable interrupts",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "8b271541a6ea3f2f0c0c238d65f48b8c73bd655a",
    "submitter": {
        "id": 7055,
        "url": "http://patchwork.ozlabs.org/api/people/7055/?format=api",
        "name": "Linus Walleij",
        "email": "linus.walleij@linaro.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-gpio/patch/20170924145622.4031-6-linus.walleij@linaro.org/mbox/",
    "series": [
        {
            "id": 4818,
            "url": "http://patchwork.ozlabs.org/api/series/4818/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-gpio/list/?series=4818",
            "date": "2017-09-24T14:56:14",
            "name": "GPIO extcon modernization",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/4818/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/817922/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/817922/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<linux-gpio-owner@vger.kernel.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org",
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=linux-gpio-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=linaro.org header.i=@linaro.org\n\theader.b=\"VOgpi8gK\"; dkim-atps=neutral"
        ],
        "Received": [
            "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3y0Vlj2bFvz9sRV\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 25 Sep 2017 01:01:05 +1000 (AEST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752614AbdIXPAw (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tSun, 24 Sep 2017 11:00:52 -0400",
            "from mail-pg0-f47.google.com ([74.125.83.47]:53297 \"EHLO\n\tmail-pg0-f47.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1752613AbdIXPAu (ORCPT\n\t<rfc822; linux-gpio@vger.kernel.org>); Sun, 24 Sep 2017 11:00:50 -0400",
            "by mail-pg0-f47.google.com with SMTP id j70so2722371pgc.10\n\tfor <linux-gpio@vger.kernel.org>;\n\tSun, 24 Sep 2017 08:00:50 -0700 (PDT)",
            "from genomnajs.saswifi.com ([104.153.224.168])\n\tby smtp.gmail.com with ESMTPSA id\n\tn83sm7386805pfi.163.2017.09.24.08.00.07\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tSun, 24 Sep 2017 08:00:49 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=kGwfhHNs16L499QCaDMtlsmYNdt4BX9na+tY/K9pl9U=;\n\tb=VOgpi8gKmWrVBniz7fZ/OqH0SLtA7j8h5SeF241I5yAg6ntB6oVk7nD/fQxdc5uSUs\n\t+JJ9rfdgQoc/z45y/sGGNni9CYc848acAjwVwr8zTm/yzVpQh7edu24VDbOfWK5H3gmo\n\tIfVdPu114ABfhCivvSYylK+2RrGrznXZ8LhIY=",
        "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;\n\tbh=kGwfhHNs16L499QCaDMtlsmYNdt4BX9na+tY/K9pl9U=;\n\tb=sUIGWHHRvcv4eFnI7w3H9Ui7C4jRwHIIKKR9piAkKZ6jFPEwDNqIEm39WFTb7hv9Rs\n\tTw0e48Y93oIj/vCc+xpqOHLoM7mDzS7Z9Yna0rTHQRqiVDofJd+JiFP6CBh7Lty2RDBa\n\t9GndCC6mOTgTJfcf7U/p3b6aGAb+0LkjLrRD9e/CSvmwWR+kBX39uAaeyV7c8DJqqKrC\n\t6dF6Tbzg3Z+DRBqxVX3mUfejyJYdWPXCmSKPtildtPUVHbH+pIOo6h4vZRdMms0zj9Da\n\tB/nSKsglZJc/lQKMMVLpJnoKKQAWPLbDwqeFCNNsvkVhE4nAcMdHq7ZdbH3Eu45goZno\n\tb9JA==",
        "X-Gm-Message-State": "AHPjjUhyrSfoxgbeEXA0KWrwHNTdrPeOoWRILmYsjn0Mne6tslv0p5yU\n\tlA2qVzkjE7G5VGVZqP0tdzcJMw==",
        "X-Google-Smtp-Source": "AOwi7QAVJ4Th5OmZKuZAIAv7AYKoX/klo4w45fn08GZqa4xKL/r984+6CI9qrLeTfjfayRwrf4SquA==",
        "X-Received": "by 10.99.51.15 with SMTP id z15mr4837618pgz.287.1506265249948;\n\tSun, 24 Sep 2017 08:00:49 -0700 (PDT)",
        "From": "Linus Walleij <linus.walleij@linaro.org>",
        "To": "MyungJoo Ham <myungjoo.ham@samsung.com>,\n\tChanwoo Choi <cw00.choi@samsung.com>",
        "Cc": "linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,\n\tJohn Stultz <john.stultz@linaro.org>,\n\tMike Lockwood <lockwood@google.com>, Guenter Roeck <linux@roeck-us.net>,\n\tLinus Walleij <linus.walleij@linaro.org>",
        "Subject": "[PATCH 5/8] extcon: gpio: Request reasonable interrupts",
        "Date": "Sun, 24 Sep 2017 16:56:19 +0200",
        "Message-Id": "<20170924145622.4031-6-linus.walleij@linaro.org>",
        "X-Mailer": "git-send-email 2.13.5",
        "In-Reply-To": "<20170924145622.4031-1-linus.walleij@linaro.org>",
        "References": "<20170924145622.4031-1-linus.walleij@linaro.org>",
        "Sender": "linux-gpio-owner@vger.kernel.org",
        "Precedence": "bulk",
        "List-ID": "<linux-gpio.vger.kernel.org>",
        "X-Mailing-List": "linux-gpio@vger.kernel.org"
    },
    "content": "The only thing that makes sense is to request a falling edge interrupt\nif the line is active low and a rising edge interrupt if the line is\nactive high, so just do that and get rid of the assignment from\nplatform data. The GPIO descriptor knows if the line is active high\nor low.\n\nAlso make irq a local variable in probe(), it's not used anywhere else.\n\nSigned-off-by: Linus Walleij <linus.walleij@linaro.org>\n---\n drivers/extcon/extcon-gpio.c | 29 +++++++++++++++++++----------\n 1 file changed, 19 insertions(+), 10 deletions(-)",
    "diff": "diff --git a/drivers/extcon/extcon-gpio.c b/drivers/extcon/extcon-gpio.c\nindex 86f3ec6d6014..6d9cb4ed11c2 100644\n--- a/drivers/extcon/extcon-gpio.c\n+++ b/drivers/extcon/extcon-gpio.c\n@@ -30,26 +30,22 @@\n /**\n  * struct gpio_extcon_data - A simple GPIO-controlled extcon device state container.\n  * @edev:\t\tExtcon device.\n- * @irq:\t\tInterrupt line for the external connector.\n  * @work:\t\tWork fired by the interrupt.\n  * @debounce_jiffies:\tNumber of jiffies to wait for the GPIO to stabilize, from the debounce\n  *\t\t\tvalue.\n  * @gpiod:\t\tGPIO descriptor for this external connector.\n  * @extcon_id:\t\tThe unique id of specific external connector.\n  * @debounce:\t\tDebounce time for GPIO IRQ in ms.\n- * @irq_flags:\t\tIRQ Flags (e.g., IRQF_TRIGGER_LOW).\n  * @check_on_resume:\tBoolean describing whether to check the state of gpio\n  *\t\t\twhile resuming from sleep.\n  */\n struct gpio_extcon_data {\n \tstruct extcon_dev *edev;\n-\tint irq;\n \tstruct delayed_work work;\n \tunsigned long debounce_jiffies;\n \tstruct gpio_desc *gpiod;\n \tunsigned int extcon_id;\n \tunsigned long debounce;\n-\tunsigned long irq_flags;\n \tbool check_on_resume;\n };\n \n@@ -77,21 +73,34 @@ static int gpio_extcon_probe(struct platform_device *pdev)\n {\n \tstruct gpio_extcon_data *data;\n \tstruct device *dev = &pdev->dev;\n+\tunsigned long irq_flags;\n+\tint irq;\n \tint ret;\n \n \tdata = devm_kzalloc(dev, sizeof(struct gpio_extcon_data), GFP_KERNEL);\n \tif (!data)\n \t\treturn -ENOMEM;\n \n-\tif (!data->irq_flags || data->extcon_id > EXTCON_NONE)\n+\tif (data->extcon_id > EXTCON_NONE)\n \t\treturn -EINVAL;\n \n \tdata->gpiod = devm_gpiod_get(dev, \"extcon\", GPIOD_IN);\n \tif (IS_ERR(data->gpiod))\n \t\treturn PTR_ERR(data->gpiod);\n-\tdata->irq = gpiod_to_irq(data->gpiod);\n-\tif (data->irq <= 0)\n-\t\treturn data->irq;\n+\tirq = gpiod_to_irq(data->gpiod);\n+\tif (irq <= 0)\n+\t\treturn irq;\n+\n+\t/*\n+\t * It is unlikely that this is an acknowledged interrupt that goes\n+\t * away after handling, what we are looking for are falling edges\n+\t * if the signal is active low, and rising edges if the signal is\n+\t * active high.\n+\t */\n+\tif (gpiod_is_active_low(data->gpiod))\n+\t\tirq_flags = IRQF_TRIGGER_FALLING;\n+\telse\n+\t\tirq_flags = IRQF_TRIGGER_RISING;\n \n \t/* Allocate the memory of extcon devie and register extcon device */\n \tdata->edev = devm_extcon_dev_allocate(dev, &data->extcon_id);\n@@ -110,8 +119,8 @@ static int gpio_extcon_probe(struct platform_device *pdev)\n \t * Request the interrupt of gpio to detect whether external connector\n \t * is attached or detached.\n \t */\n-\tret = devm_request_any_context_irq(dev, data->irq,\n-\t\t\t\t\tgpio_irq_handler, data->irq_flags,\n+\tret = devm_request_any_context_irq(dev, irq,\n+\t\t\t\t\tgpio_irq_handler, irq_flags,\n \t\t\t\t\tpdev->name, data);\n \tif (ret < 0)\n \t\treturn ret;\n",
    "prefixes": [
        "5/8"
    ]
}