get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 960,
    "url": "http://patchwork.ozlabs.org/api/patches/960/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/200809222152.m8MLqD65031949@imap1.linux-foundation.org/",
    "project": {
        "id": 7,
        "url": "http://patchwork.ozlabs.org/api/projects/7/?format=api",
        "name": "Linux network development",
        "link_name": "netdev",
        "list_id": "netdev.vger.kernel.org",
        "list_email": "netdev@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<200809222152.m8MLqD65031949@imap1.linux-foundation.org>",
    "list_archive_url": null,
    "date": "2008-09-22T21:52:13",
    "name": "[05/21] sky2: adapt to the reworked PCI PM",
    "commit_ref": null,
    "pull_url": null,
    "state": "deferred",
    "archived": true,
    "hash": "78b8ecbe76691c57f84ed9f4f3ea942208147a7f",
    "submitter": {
        "id": 107,
        "url": "http://patchwork.ozlabs.org/api/people/107/?format=api",
        "name": "Andrew Morton",
        "email": "akpm@linux-foundation.org"
    },
    "delegate": {
        "id": 36,
        "url": "http://patchwork.ozlabs.org/api/users/36/?format=api",
        "username": "jgarzik",
        "first_name": "Jeff",
        "last_name": "Garzik",
        "email": "jgarzik@pobox.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/200809222152.m8MLqD65031949@imap1.linux-foundation.org/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/960/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/960/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<netdev-owner@vger.kernel.org>",
        "X-Original-To": "patchwork-incoming@ozlabs.org",
        "Delivered-To": "patchwork-incoming@ozlabs.org",
        "Received": [
            "from vger.kernel.org (vger.kernel.org [209.132.176.167])\n\tby ozlabs.org (Postfix) with ESMTP id 5F554DDF13\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 23 Sep 2008 07:53:27 +1000 (EST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1753549AbYIVVxX (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tMon, 22 Sep 2008 17:53:23 -0400",
            "(majordomo@vger.kernel.org) by vger.kernel.org id S1753530AbYIVVxX\n\t(ORCPT <rfc822; netdev-outgoing>); Mon, 22 Sep 2008 17:53:23 -0400",
            "from smtp1.linux-foundation.org ([140.211.169.13]:58269 \"EHLO\n\tsmtp1.linux-foundation.org\" rhost-flags-OK-OK-OK-OK)\n\tby vger.kernel.org with ESMTP id S1753518AbYIVVxW (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Mon, 22 Sep 2008 17:53:22 -0400",
            "from imap1.linux-foundation.org (imap1.linux-foundation.org\n\t[140.211.169.55])\n\tby smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with\n\tESMTP id m8MLqDtM018347\n\t(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);\n\tMon, 22 Sep 2008 14:52:14 -0700",
            "from localhost.localdomain (localhost [127.0.0.1])\n\tby imap1.linux-foundation.org\n\t(8.13.5.20060308/8.13.5/Debian-3ubuntu1.1) with ESMTP id\n\tm8MLqD65031949; Mon, 22 Sep 2008 14:52:13 -0700"
        ],
        "Message-Id": "<200809222152.m8MLqD65031949@imap1.linux-foundation.org>",
        "Subject": "[patch 05/21] sky2: adapt to the reworked PCI PM",
        "To": "jeff@garzik.org",
        "Cc": "netdev@vger.kernel.org, akpm@linux-foundation.org, rjw@sisk.pl,\n\tjbarnes@virtuousgeek.org, stephen.hemminger@vyatta.com",
        "From": "akpm@linux-foundation.org",
        "Date": "Mon, 22 Sep 2008 14:52:13 -0700",
        "X-Spam-Status": "No, hits=-3.359 required=5 tests=AWL, BAYES_00,\n\tOSDL_HEADER_SUBJECT_BRACKETED",
        "X-Spam-Checker-Version": "SpamAssassin 3.2.4-osdl_revision__1.47__",
        "X-MIMEDefang-Filter": "lf$Revision: 1.188 $",
        "X-Scanned-By": "MIMEDefang 2.63 on 140.211.169.13",
        "Sender": "netdev-owner@vger.kernel.org",
        "Precedence": "bulk",
        "List-ID": "<netdev.vger.kernel.org>",
        "X-Mailing-List": "netdev@vger.kernel.org"
    },
    "content": "From: \"Rafael J. Wysocki\" <rjw@sisk.pl>\n\nAdapt the sky2 driver to the reworked PCI PM\n\n* Use device_set_wakeup_enable() and friends as needed\n* Remove an open-coded reference to the standard PCI PM registers\n* Use pci_prepare_to_sleep() and pci_back_from_sleep() in the\n  ->suspend() and ->resume() callbacks\n* Use the observation that it is sufficient to call pci_enable_wake()\n  once, unless it fails\n\nTested on Asus M3A32-MVP (Yukon-2 EC Ultra rev 3).\n\nSigned-off-by: Rafael J. Wysocki <rjw@sisk.pl>\nCc: Jeff Garzik <jeff@garzik.org>\nCc: Jesse Barnes <jbarnes@virtuousgeek.org>\nCc: Stephen Hemminger <stephen.hemminger@vyatta.com>\nSigned-off-by: Andrew Morton <akpm@linux-foundation.org>\n---\n\n drivers/net/sky2.c |   34 ++++++++++------------------------\n 1 file changed, 10 insertions(+), 24 deletions(-)",
    "diff": "diff -puN drivers/net/sky2.c~skty2-adapt-to-the-reworked-pci-pm drivers/net/sky2.c\n--- a/drivers/net/sky2.c~skty2-adapt-to-the-reworked-pci-pm\n+++ a/drivers/net/sky2.c\n@@ -3034,7 +3034,8 @@ static int sky2_set_wol(struct net_devic\n \tstruct sky2_port *sky2 = netdev_priv(dev);\n \tstruct sky2_hw *hw = sky2->hw;\n \n-\tif (wol->wolopts & ~sky2_wol_supported(sky2->hw))\n+\tif ((wol->wolopts & ~sky2_wol_supported(sky2->hw))\n+\t    || !device_can_wakeup(&hw->pdev->dev))\n \t\treturn -EOPNOTSUPP;\n \n \tsky2->wol = wol->wolopts;\n@@ -3045,6 +3046,8 @@ static int sky2_set_wol(struct net_devic\n \t\tsky2_write32(hw, B0_CTST, sky2->wol\n \t\t\t     ? Y2_HW_WOL_ON : Y2_HW_WOL_OFF);\n \n+\tdevice_set_wakeup_enable(&hw->pdev->dev, sky2->wol);\n+\n \tif (!netif_running(dev))\n \t\tsky2_wol_init(sky2);\n \treturn 0;\n@@ -4179,18 +4182,6 @@ static int __devinit sky2_test_msi(struc\n \treturn err;\n }\n \n-static int __devinit pci_wake_enabled(struct pci_dev *dev)\n-{\n-\tint pm  = pci_find_capability(dev, PCI_CAP_ID_PM);\n-\tu16 value;\n-\n-\tif (!pm)\n-\t\treturn 0;\n-\tif (pci_read_config_word(dev, pm + PCI_PM_CTRL, &value))\n-\t\treturn 0;\n-\treturn value & PCI_PM_CTRL_PME_ENABLE;\n-}\n-\n /*\n  * Read and parse the first part of Vital Product Data\n  */\n@@ -4314,7 +4305,7 @@ static int __devinit sky2_probe(struct p\n \t\t}\n \t}\n \n-\twol_default = pci_wake_enabled(pdev) ? WAKE_MAGIC : 0;\n+\twol_default = device_may_wakeup(&pdev->dev) ? WAKE_MAGIC : 0;\n \n \terr = -ENOMEM;\n \thw = kzalloc(sizeof(*hw), GFP_KERNEL);\n@@ -4479,7 +4470,7 @@ static void __devexit sky2_remove(struct\n static int sky2_suspend(struct pci_dev *pdev, pm_message_t state)\n {\n \tstruct sky2_hw *hw = pci_get_drvdata(pdev);\n-\tint i, wol = 0;\n+\tint i;\n \n \tif (!hw)\n \t\treturn 0;\n@@ -4497,8 +4488,6 @@ static int sky2_suspend(struct pci_dev *\n \n \t\tif (sky2->wol)\n \t\t\tsky2_wol_init(sky2);\n-\n-\t\twol |= sky2->wol;\n \t}\n \n \tsky2_write32(hw, B0_IMSK, 0);\n@@ -4506,8 +4495,7 @@ static int sky2_suspend(struct pci_dev *\n \tsky2_power_aux(hw);\n \n \tpci_save_state(pdev);\n-\tpci_enable_wake(pdev, pci_choose_state(pdev, state), wol);\n-\tpci_set_power_state(pdev, pci_choose_state(pdev, state));\n+\tpci_prepare_to_sleep(pdev);\n \n \treturn 0;\n }\n@@ -4520,7 +4508,7 @@ static int sky2_resume(struct pci_dev *p\n \tif (!hw)\n \t\treturn 0;\n \n-\terr = pci_set_power_state(pdev, PCI_D0);\n+\terr = pci_back_from_sleep(pdev);\n \tif (err)\n \t\tgoto out;\n \n@@ -4528,8 +4516,6 @@ static int sky2_resume(struct pci_dev *p\n \tif (err)\n \t\tgoto out;\n \n-\tpci_enable_wake(pdev, PCI_D0, 0);\n-\n \t/* Re-enable all clocks */\n \tif (hw->chip_id == CHIP_ID_YUKON_EX ||\n \t    hw->chip_id == CHIP_ID_YUKON_EC_U ||\n@@ -4588,8 +4574,8 @@ static void sky2_shutdown(struct pci_dev\n \tif (wol)\n \t\tsky2_power_aux(hw);\n \n-\tpci_enable_wake(pdev, PCI_D3hot, wol);\n-\tpci_enable_wake(pdev, PCI_D3cold, wol);\n+\tif (pci_enable_wake(pdev, PCI_D3cold, wol))\n+\t\tpci_enable_wake(pdev, PCI_D3hot, wol);\n \n \tpci_disable_device(pdev);\n \tpci_set_power_state(pdev, PCI_D3hot);\n",
    "prefixes": [
        "05/21"
    ]
}