get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 806803,
    "url": "http://patchwork.ozlabs.org/api/patches/806803/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/1503936303-18274-1-git-send-email-bryantly@linux.vnet.ibm.com/",
    "project": {
        "id": 2,
        "url": "http://patchwork.ozlabs.org/api/projects/2/?format=api",
        "name": "Linux PPC development",
        "link_name": "linuxppc-dev",
        "list_id": "linuxppc-dev.lists.ozlabs.org",
        "list_email": "linuxppc-dev@lists.ozlabs.org",
        "web_url": "https://github.com/linuxppc/wiki/wiki",
        "scm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git",
        "webscm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/",
        "list_archive_url": "https://lore.kernel.org/linuxppc-dev/",
        "list_archive_url_format": "https://lore.kernel.org/linuxppc-dev/{}/",
        "commit_url_format": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id={}"
    },
    "msgid": "<1503936303-18274-1-git-send-email-bryantly@linux.vnet.ibm.com>",
    "list_archive_url": "https://lore.kernel.org/linuxppc-dev/1503936303-18274-1-git-send-email-bryantly@linux.vnet.ibm.com/",
    "date": "2017-08-28T16:05:03",
    "name": "powerpc/kernel: Change retrieval of pci_dn",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "8bd72e717519049f3a732d69e5125cc0cd9248be",
    "submitter": {
        "id": 72247,
        "url": "http://patchwork.ozlabs.org/api/people/72247/?format=api",
        "name": "Bryant G. Ly",
        "email": "bryantly@linux.vnet.ibm.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/1503936303-18274-1-git-send-email-bryantly@linux.vnet.ibm.com/mbox/",
    "series": [
        {
            "id": 276,
            "url": "http://patchwork.ozlabs.org/api/series/276/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=276",
            "date": "2017-08-28T16:05:03",
            "name": "powerpc/kernel: Change retrieval of pci_dn",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/276/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/806803/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/806803/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>",
        "X-Original-To": [
            "patchwork-incoming@ozlabs.org",
            "linuxppc-dev@lists.ozlabs.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@ozlabs.org",
            "linuxppc-dev@lists.ozlabs.org"
        ],
        "Received": [
            "from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xh6S41FJKz9s7v\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 29 Aug 2017 08:50:44 +1000 (AEST)",
            "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xh6S40S7pzDqR9\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 29 Aug 2017 08:50:44 +1000 (AEST)",
            "from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com\n\t[148.163.158.5])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xgxSC1F67zDq5m\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tTue, 29 Aug 2017 02:05:14 +1000 (AEST)",
            "from pps.filterd (m0098413.ppops.net [127.0.0.1])\n\tby mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv7SG4kQF144455\n\tfor <linuxppc-dev@lists.ozlabs.org>; Mon, 28 Aug 2017 12:05:12 -0400",
            "from e13.ny.us.ibm.com (e13.ny.us.ibm.com [129.33.205.203])\n\tby mx0b-001b2d01.pphosted.com with ESMTP id 2cmjvy0cwq-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <linuxppc-dev@lists.ozlabs.org>; Mon, 28 Aug 2017 12:05:12 -0400",
            "from localhost\n\tby e13.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <linuxppc-dev@lists.ozlabs.org> from\n\t<bryantly@linux.vnet.ibm.com>; Mon, 28 Aug 2017 12:05:11 -0400",
            "from b01cxnp22035.gho.pok.ibm.com (9.57.198.25)\n\tby e13.ny.us.ibm.com (146.89.104.200) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tMon, 28 Aug 2017 12:05:08 -0400",
            "from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com\n\t[9.57.199.111])\n\tby b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP\n\tid v7SG53cp31326450; Mon, 28 Aug 2017 16:05:07 GMT",
            "from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id 8BDFBAC040;\n\tMon, 28 Aug 2017 12:05:31 -0400 (EDT)",
            "from localhost.localdomain (unknown [9.85.143.91])\n\tby b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP id B905DAC03F;\n\tMon, 28 Aug 2017 12:05:30 -0400 (EDT)"
        ],
        "From": "\"Bryant G. Ly\" <bryantly@linux.vnet.ibm.com>",
        "To": "benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au",
        "Subject": "[PATCH] powerpc/kernel: Change retrieval of pci_dn",
        "Date": "Mon, 28 Aug 2017 11:05:03 -0500",
        "X-Mailer": "git-send-email 2.5.4 (Apple Git-61)",
        "X-TM-AS-GCONF": "00",
        "x-cbid": "17082816-0008-0000-0000-00000275A3BB",
        "X-IBM-SpamModules-Scores": "",
        "X-IBM-SpamModules-Versions": "BY=3.00007627; HX=3.00000241; KW=3.00000007;\n\tPH=3.00000004; SC=3.00000226; SDB=6.00908864; UDB=6.00455751;\n\tIPR=6.00689115; \n\tBA=6.00005557; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009;\n\tZB=6.00000000; \n\tZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00016902;\n\tXFM=3.00000015; UTC=2017-08-28 16:05:09",
        "X-IBM-AV-DETECTION": "SAVI=unused REMOTE=unused XFE=unused",
        "x-cbparentid": "17082816-0009-0000-0000-000036848C79",
        "Message-Id": "<1503936303-18274-1-git-send-email-bryantly@linux.vnet.ibm.com>",
        "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-08-28_09:, , signatures=0",
        "X-Proofpoint-Spam-Details": "rule=outbound_notspam policy=outbound score=0\n\tspamscore=0 suspectscore=0\n\tmalwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam\n\tadjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000\n\tdefinitions=main-1708280257",
        "X-Mailman-Approved-At": "Tue, 29 Aug 2017 08:49:33 +1000",
        "X-BeenThere": "linuxppc-dev@lists.ozlabs.org",
        "X-Mailman-Version": "2.1.23",
        "Precedence": "list",
        "List-Id": "Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>",
        "List-Unsubscribe": "<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.ozlabs.org/pipermail/linuxppc-dev/>",
        "List-Post": "<mailto:linuxppc-dev@lists.ozlabs.org>",
        "List-Help": "<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>",
        "List-Subscribe": "<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>",
        "Cc": "\"Bryant G. Ly\" <bgly@us.ibm.com>, linuxppc-dev@lists.ozlabs.org,\n\t\"Bryant G. Ly\" <bryantly@linux.vnet.ibm.com>, martin.petersen@oracle.com",
        "Errors-To": "linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org",
        "Sender": "\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"
    },
    "content": "For a PCI device it's pci_dn can be retrieved from\npdev->dev.archdata.firmware_data, PCI_DN(devnode), or parent's list.\nThus, we should just use the generic function pci_get_pdn_by_devfn\nto get the pci_dn.\n\nSigned-off-by: Bryant G. Ly <bgly@us.ibm.com>\n---\n arch/powerpc/kernel/rtas_pci.c | 30 ++----------------------------\n 1 file changed, 2 insertions(+), 28 deletions(-)",
    "diff": "diff --git a/arch/powerpc/kernel/rtas_pci.c b/arch/powerpc/kernel/rtas_pci.c\nindex 73f1934..c21e6c5 100644\n--- a/arch/powerpc/kernel/rtas_pci.c\n+++ b/arch/powerpc/kernel/rtas_pci.c\n@@ -91,25 +91,13 @@ static int rtas_pci_read_config(struct pci_bus *bus,\n \t\t\t\tunsigned int devfn,\n \t\t\t\tint where, int size, u32 *val)\n {\n-\tstruct device_node *busdn, *dn;\n \tstruct pci_dn *pdn;\n-\tbool found = false;\n \tint ret;\n \n \t/* Search only direct children of the bus */\n \t*val = 0xFFFFFFFF;\n-\tbusdn = pci_bus_to_OF_node(bus);\n-\tfor (dn = busdn->child; dn; dn = dn->sibling) {\n-\t\tpdn = PCI_DN(dn);\n-\t\tif (pdn && pdn->devfn == devfn\n-\t\t    && of_device_is_available(dn)) {\n-\t\t\tfound = true;\n-\t\t\tbreak;\n-\t\t}\n-\t}\n \n-\tif (!found)\n-\t\treturn PCIBIOS_DEVICE_NOT_FOUND;\n+\tpdn = pci_get_pdn_by_devfn(bus, devfn);\n \n \tret = rtas_read_config(pdn, where, size, val);\n \tif (*val == EEH_IO_ERROR_VALUE(size) &&\n@@ -153,23 +141,9 @@ static int rtas_pci_write_config(struct pci_bus *bus,\n \t\t\t\t unsigned int devfn,\n \t\t\t\t int where, int size, u32 val)\n {\n-\tstruct device_node *busdn, *dn;\n \tstruct pci_dn *pdn;\n-\tbool found = false;\n-\n-\t/* Search only direct children of the bus */\n-\tbusdn = pci_bus_to_OF_node(bus);\n-\tfor (dn = busdn->child; dn; dn = dn->sibling) {\n-\t\tpdn = PCI_DN(dn);\n-\t\tif (pdn && pdn->devfn == devfn\n-\t\t    && of_device_is_available(dn)) {\n-\t\t\tfound = true;\n-\t\t\tbreak;\n-\t\t}\n-\t}\n \n-\tif (!found)\n-\t\treturn PCIBIOS_DEVICE_NOT_FOUND;\n+\tpdn = pci_get_pdn_by_devfn(bus, devfn);\n \n \treturn rtas_write_config(pdn, where, size, val);\n }\n",
    "prefixes": []
}