get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 816575,
    "url": "http://patchwork.ozlabs.org/api/patches/816575/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-imx/patch/20170920224621.16236-7-tony@atomide.com/",
    "project": {
        "id": 19,
        "url": "http://patchwork.ozlabs.org/api/projects/19/?format=api",
        "name": "Linux IMX development",
        "link_name": "linux-imx",
        "list_id": "linux-imx-kernel.lists.patchwork.ozlabs.org",
        "list_email": "linux-imx-kernel@lists.patchwork.ozlabs.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20170920224621.16236-7-tony@atomide.com>",
    "list_archive_url": null,
    "date": "2017-09-20T22:46:17",
    "name": "[06/10] ARM: OMAP2+: Populate legacy resources for dma and smartreflex",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "30bdf9d5aa0e690baadc259c0bbd44acf33a7980",
    "submitter": {
        "id": 365,
        "url": "http://patchwork.ozlabs.org/api/people/365/?format=api",
        "name": "Tony Lindgren",
        "email": "tony@atomide.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-imx/patch/20170920224621.16236-7-tony@atomide.com/mbox/",
    "series": [
        {
            "id": 4251,
            "url": "http://patchwork.ozlabs.org/api/series/4251/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-imx/list/?series=4251",
            "date": "2017-09-20T22:46:12",
            "name": "Fix remaining issues to drop more omap platform data",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/4251/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/816575/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/816575/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org>",
        "X-Original-To": "incoming-imx@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming-imx@bilbo.ozlabs.org",
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.infradead.org\n\t(client-ip=65.50.211.133; helo=bombadil.infradead.org;\n\tenvelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org\n\theader.b=\"Nmt2qpXJ\"; dkim-atps=neutral"
        ],
        "Received": [
            "from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xyFNT2CVDz9s4q\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tThu, 21 Sep 2017 08:51:37 +1000 (AEST)",
            "from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dunq8-0000ql-2F; Wed, 20 Sep 2017 22:51:32 +0000",
            "from muru.com ([72.249.23.125])\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dunm2-0004xu-7K for linux-arm-kernel@lists.infradead.org;\n\tWed, 20 Sep 2017 22:47:37 +0000",
            "from sampyla.muru.com (localhost [127.0.0.1])\n\tby muru.com (Postfix) with ESMTP id 351748578;\n\tWed, 20 Sep 2017 22:47:47 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:\n\tMessage-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=y8tI1XXARZF387nvI7qXEoCxASjLFiUTEbXqFyku2QA=;\n\tb=Nmt2qpXJdIWciy\n\tV1bzcf1FDCRBMuaM2YC1ypWYPOW5sVh296BWy0S7HyR4zTG9RoQ8BFUrh5FoFVxCnepiK6JJtjqWd\n\tRlUi8qLKK/U1Lft85m+j+CtqAs8PuZsQjr2i/75tK8bYv76KLgOC/TYUu5lC2z1363CuGegKDGhS/\n\tSf2nUpxKpAHkoziFIn1NjmOcQrWyS5psdNP0QDWM5qFIEObm+ZDlOxFlERMOW7lLFSAq9HxhsSs92\n\tUGXN0/B+QfM7bTyDSRRr/l1Yyny92aR1OWkRTMW/XuU9tf4Dkkae0TABagkAPAyPMtPtZX4OMyeE2\n\t33nWUNv/4YNPXTHbRp0w==;",
        "From": "Tony Lindgren <tony@atomide.com>",
        "To": "linux-omap@vger.kernel.org",
        "Subject": "[PATCH 06/10] ARM: OMAP2+: Populate legacy resources for dma and\n\tsmartreflex",
        "Date": "Wed, 20 Sep 2017 15:46:17 -0700",
        "Message-Id": "<20170920224621.16236-7-tony@atomide.com>",
        "X-Mailer": "git-send-email 2.14.1",
        "In-Reply-To": "<20170920224621.16236-1-tony@atomide.com>",
        "References": "<20170920224621.16236-1-tony@atomide.com>",
        "MIME-Version": "1.0",
        "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ",
        "X-CRM114-CacheID": "sfid-20170920_154718_686647_A52A0F1B ",
        "X-CRM114-Status": "GOOD (  20.36  )",
        "X-Spam-Score": "-1.9 (-)",
        "X-Spam-Report": "SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-1.9 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]",
        "X-BeenThere": "linux-arm-kernel@lists.infradead.org",
        "X-Mailman-Version": "2.1.21",
        "Precedence": "list",
        "List-Unsubscribe": "<http://lists.infradead.org/mailman/options/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.infradead.org/pipermail/linux-arm-kernel/>",
        "List-Post": "<mailto:linux-arm-kernel@lists.infradead.org>",
        "List-Help": "<mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>",
        "List-Subscribe": "<http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>",
        "Cc": "Nishanth Menon <nm@ti.com>, devicetree@vger.kernel.org, Paul Walmsley\n\t<paul@pwsan.com>, Lokesh Vutla <lokeshvutla@ti.com>, Tero Kristo\n\t<t-kristo@ti.com>, =?utf-8?q?Beno=C3=AEt_Cousson?=\n\t<bcousson@baylibre.com>,  linux-arm-kernel@lists.infradead.org",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "base64",
        "Sender": "\"linux-arm-kernel\" <linux-arm-kernel-bounces@lists.infradead.org>",
        "Errors-To": "linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org",
        "List-Id": "linux-imx-kernel.lists.patchwork.ozlabs.org"
    },
    "content": "We can populate the legacy resources needed by dma and smartreflex\nfrom device tree in omap_device_build().\n\nThere should be no need to do this for other devices, and eventually\nthese two remaining users will be gone too. The legacy dma will be\ndropped when the remaining users have been converted to use the\ndmaengine driver, and smartreflex can now become just a regular\ndevice driver with a few pdata callbacks.\n\nThis is needed in order to remove remaining device dma, irq and io\nresources from the interconnect code.\n\nAnd while at it, let's simplify things by removing otherwise\nunused omap_device_build_ss() as we will never call it for more\nthan one hwmod.\n\nCc: \"Benoît Cousson\" <bcousson@baylibre.com>\nCc: Lokesh Vutla <lokeshvutla@ti.com>\nCc: Nishanth Menon <nm@ti.com>\nCc: Paul Walmsley <paul@pwsan.com>\nCc: Tero Kristo <t-kristo@ti.com>\nSigned-off-by: Tony Lindgren <tony@atomide.com>\n---\n arch/arm/mach-omap2/omap_device.c | 137 +++++++++++++++++++++++++++++---------\n arch/arm/mach-omap2/omap_device.h |   4 --\n 2 files changed, 106 insertions(+), 35 deletions(-)",
    "diff": "diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c\n--- a/arch/arm/mach-omap2/omap_device.c\n+++ b/arch/arm/mach-omap2/omap_device.c\n@@ -35,6 +35,8 @@\n #include <linux/pm_domain.h>\n #include <linux/pm_runtime.h>\n #include <linux/of.h>\n+#include <linux/of_address.h>\n+#include <linux/of_irq.h>\n #include <linux/notifier.h>\n \n #include \"common.h\"\n@@ -521,6 +523,91 @@ void omap_device_delete(struct omap_device *od)\n \tkfree(od);\n }\n \n+/**\n+ * omap_device_copy_resources - Add legacy IO and IRQ resources\n+ * @oh: interconnect target module\n+ * @pdev: platform device to copy resources to\n+ *\n+ * We still have legacy DMA and smartreflex needing resources.\n+ * Let's populate what they need until we can eventually just\n+ * remove this function. Note that there should be no need to\n+ * call this from omap_device_build_from_dt(), nor should there\n+ * be any need to call it for other devices.\n+ */\n+static int\n+omap_device_copy_resources(struct omap_hwmod *oh,\n+\t\t\t   struct platform_device *pdev)\n+{\n+\tstruct device_node *np, *child;\n+\tstruct property *prop;\n+\tstruct resource *res;\n+\tconst char *name;\n+\tint error, irq = 0;\n+\n+\tif (!oh || !oh->od || !oh->od->pdev) {\n+\t\terror = -EINVAL;\n+\t\tgoto error;\n+\t}\n+\n+\tnp = oh->od->pdev->dev.of_node;\n+\tif (!np) {\n+\t\terror = -ENODEV;\n+\t\tgoto error;\n+\t}\n+\n+\tres = kzalloc(sizeof(*res) * 2, GFP_KERNEL);\n+\tif (!res)\n+\t\treturn -ENOMEM;\n+\n+\t/* Do we have a dts range for the interconnect target module? */\n+\terror = omap_hwmod_parse_module_range(oh, np, res);\n+\n+\t/* No ranges, rely on device reg entry */\n+\tif (error)\n+\t\terror = of_address_to_resource(np, 0, res);\n+\tif (error)\n+\t\tgoto free;\n+\n+\t/* SmartReflex needs first IO resource name to be \"mpu\" */\n+\tres[0].name = \"mpu\";\n+\n+\t/*\n+\t * We may have a new stil \"ti,sysc\" interconnect target with a\n+\t * dts child with the interrupt. If so use the first child's\n+\t * first interrupt for \"ti-hwmods\" legacy support.\n+\t */\n+\tof_property_for_each_string(np, \"compatible\", prop, name)\n+\t\tif (!strncmp(\"ti,sysc-\", name, 8))\n+\t\t\tbreak;\n+\n+\tchild = of_get_next_available_child(np, NULL);\n+\n+\tif (name)\n+\t\tirq = irq_of_parse_and_map(child, 0);\n+\tif (!irq)\n+\t\tirq = irq_of_parse_and_map(np, 0);\n+\tif (!irq)\n+\t\tgoto free;\n+\n+\t/* Legacy DMA code needs interrupt name to be \"0\" */\n+\tres[1].start = irq;\n+\tres[1].end = irq;\n+\tres[1].flags = IORESOURCE_IRQ;\n+\tres[1].name = \"0\";\n+\n+\terror = platform_device_add_resources(pdev, res, 2);\n+\n+free:\n+\tkfree(res);\n+\n+error:\n+\tWARN(error, \"%s: %s device %s failed: %i\\n\",\n+\t     __func__, oh->name, dev_name(&pdev->dev),\n+\t     error);\n+\n+\treturn error;\n+}\n+\n /**\n  * omap_device_build - build and register an omap_device with one omap_hwmod\n  * @pdev_name: name of the platform_device driver to use\n@@ -539,46 +626,25 @@ struct platform_device __init *omap_device_build(const char *pdev_name,\n \t\t\t\t\t\t int pdev_id,\n \t\t\t\t\t\t struct omap_hwmod *oh,\n \t\t\t\t\t\t void *pdata, int pdata_len)\n-{\n-\tstruct omap_hwmod *ohs[] = { oh };\n-\n-\tif (!oh)\n-\t\treturn ERR_PTR(-EINVAL);\n-\n-\treturn omap_device_build_ss(pdev_name, pdev_id, ohs, 1, pdata,\n-\t\t\t\t    pdata_len);\n-}\n-\n-/**\n- * omap_device_build_ss - build and register an omap_device with multiple hwmods\n- * @pdev_name: name of the platform_device driver to use\n- * @pdev_id: this platform_device's connection ID\n- * @oh: ptr to the single omap_hwmod that backs this omap_device\n- * @pdata: platform_data ptr to associate with the platform_device\n- * @pdata_len: amount of memory pointed to by @pdata\n- *\n- * Convenience function for building and registering an omap_device\n- * subsystem record.  Subsystem records consist of multiple\n- * omap_hwmods.  This function in turn builds and registers a\n- * platform_device record.  Returns an ERR_PTR() on error, or passes\n- * along the return value of omap_device_register().\n- */\n-struct platform_device __init *omap_device_build_ss(const char *pdev_name,\n-\t\t\t\t\t\t    int pdev_id,\n-\t\t\t\t\t\t    struct omap_hwmod **ohs,\n-\t\t\t\t\t\t    int oh_cnt, void *pdata,\n-\t\t\t\t\t\t    int pdata_len)\n {\n \tint ret = -ENOMEM;\n \tstruct platform_device *pdev;\n \tstruct omap_device *od;\n \n-\tif (!ohs || oh_cnt == 0 || !pdev_name)\n+\tif (!oh || !pdev_name)\n \t\treturn ERR_PTR(-EINVAL);\n \n \tif (!pdata && pdata_len > 0)\n \t\treturn ERR_PTR(-EINVAL);\n \n+\tif (strncmp(oh->name, \"smartreflex\", 11) &&\n+\t    strncmp(oh->name, \"dma\", 3)) {\n+\t\tpr_warn(\"%s need to update %s to probe with dt\\na\",\n+\t\t\t__func__, pdev_name);\n+\t\tret = -ENODEV;\n+\t\tgoto odbs_exit;\n+\t}\n+\n \tpdev = platform_device_alloc(pdev_name, pdev_id);\n \tif (!pdev) {\n \t\tret = -ENOMEM;\n@@ -591,7 +657,16 @@ struct platform_device __init *omap_device_build_ss(const char *pdev_name,\n \telse\n \t\tdev_set_name(&pdev->dev, \"%s\", pdev->name);\n \n-\tod = omap_device_alloc(pdev, ohs, oh_cnt);\n+\t/*\n+\t * Must be called before omap_device_alloc() as oh->od\n+\t * only contains the currently registered omap_device\n+\t * and will get overwritten by omap_device_alloc().\n+\t */\n+\tret = omap_device_copy_resources(oh, pdev);\n+\tif (ret)\n+\t\tgoto odbs_exit1;\n+\n+\tod = omap_device_alloc(pdev, &oh, 1);\n \tif (IS_ERR(od))\n \t\tgoto odbs_exit1;\n \ndiff --git a/arch/arm/mach-omap2/omap_device.h b/arch/arm/mach-omap2/omap_device.h\n--- a/arch/arm/mach-omap2/omap_device.h\n+++ b/arch/arm/mach-omap2/omap_device.h\n@@ -75,10 +75,6 @@ struct platform_device *omap_device_build(const char *pdev_name, int pdev_id,\n \t\t\t\t\t  struct omap_hwmod *oh, void *pdata,\n \t\t\t\t\t  int pdata_len);\n \n-struct platform_device *omap_device_build_ss(const char *pdev_name, int pdev_id,\n-\t\t\t\t\t struct omap_hwmod **oh, int oh_cnt,\n-\t\t\t\t\t void *pdata, int pdata_len);\n-\n struct omap_device *omap_device_alloc(struct platform_device *pdev,\n \t\t\t\t      struct omap_hwmod **ohs, int oh_cnt);\n void omap_device_delete(struct omap_device *od);\n",
    "prefixes": [
        "06/10"
    ]
}