get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 532,
    "url": "http://patchwork.ozlabs.org/api/patches/532/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/patch/20080918165026.GA27077@oksana.dev.rtsoft.ru/",
    "project": {
        "id": 3,
        "url": "http://patchwork.ozlabs.org/api/projects/3/?format=api",
        "name": "Linux MTD development",
        "link_name": "linux-mtd",
        "list_id": "linux-mtd.lists.infradead.org",
        "list_email": "linux-mtd@lists.infradead.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20080918165026.GA27077@oksana.dev.rtsoft.ru>",
    "list_archive_url": null,
    "date": "2008-09-18T16:50:26",
    "name": "[MTD,NAND] fsl_upm: update driver for the new OF bindings",
    "commit_ref": "95ebffd749c8e6c8cbb746bc0833a5738cc23321",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "c238afa4fad40faee771d36916075b4840bcb4f7",
    "submitter": {
        "id": 45,
        "url": "http://patchwork.ozlabs.org/api/people/45/?format=api",
        "name": "Anton Vorontsov",
        "email": "avorontsov@ru.mvista.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-mtd/patch/20080918165026.GA27077@oksana.dev.rtsoft.ru/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/532/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/532/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@ozlabs.org",
        "Received": [
            "from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34])\n\t(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\n\t(Client did not present a certificate)\n\tby ozlabs.org (Postfix) with ESMTPS id CDCD3DDFF7\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 19 Sep 2008 02:53:03 +1000 (EST)",
            "from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.68 #1 (Red Hat Linux))\n\tid 1KgMi7-0003AU-BX; Thu, 18 Sep 2008 16:50:31 +0000",
            "from [85.21.88.6] (helo=buildserver.ru.mvista.com)\n\tby bombadil.infradead.org with esmtp (Exim 4.68 #1 (Red Hat Linux))\n\tid 1KgMi4-0003AF-Dn\n\tfor linux-mtd@lists.infradead.org; Thu, 18 Sep 2008 16:50:29 +0000",
            "from localhost (unknown [10.150.0.9])\n\tby buildserver.ru.mvista.com (Postfix) with ESMTP\n\tid 5276E8819; Thu, 18 Sep 2008 21:50:26 +0500 (SAMST)"
        ],
        "Date": "Thu, 18 Sep 2008 20:50:26 +0400",
        "From": "Anton Vorontsov <avorontsov@ru.mvista.com>",
        "To": "David Woodhouse <dwmw2@infradead.org>",
        "Subject": "[PATCH] [MTD] [NAND] fsl_upm: update driver for the new OF bindings",
        "Message-ID": "<20080918165026.GA27077@oksana.dev.rtsoft.ru>",
        "MIME-Version": "1.0",
        "Content-Disposition": "inline",
        "User-Agent": "Mutt/1.5.18 (2008-05-17)",
        "X-Spam-Score": "0.1 (/)",
        "X-Spam-Report": "SpamAssassin version 3.2.5 on bombadil.infradead.org summary:\n\tContent analysis details:   (0.1 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t0.1 RDNS_NONE Delivered to trusted network by a host with no rDNS",
        "Cc": "linux-mtd@lists.infradead.org",
        "X-BeenThere": "linux-mtd@lists.infradead.org",
        "X-Mailman-Version": "2.1.9",
        "Precedence": "list",
        "List-Id": "Linux MTD discussion mailing list <linux-mtd.lists.infradead.org>",
        "List-Unsubscribe": "<http://lists.infradead.org/mailman/listinfo/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.infradead.org/pipermail/linux-mtd>",
        "List-Post": "<mailto:linux-mtd@lists.infradead.org>",
        "List-Help": "<mailto:linux-mtd-request@lists.infradead.org?subject=help>",
        "List-Subscribe": "<http://lists.infradead.org/mailman/listinfo/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Sender": "linux-mtd-bounces@lists.infradead.org",
        "Errors-To": "linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org"
    },
    "content": "- Get rid of fsl,wait-pattern and fsl,wait-write. I think this isn't\n  chip-specific, and we should always do waits. I saw one board that\n  didn't need fsl,wait-pattern, but I assume this was the exception\n  that proves the rule;\n- Get rid of chip-delay. Today there are no users for this, and if\n  anyone really need this they should push the OF bindings beforehand;\n- Now flash chips should be child nodes of the FSL UPM NAND controller;\n- Implement OF partition parsing.\n\nSigned-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>",
    "diff": "diff --git a/drivers/mtd/nand/fsl_upm.c b/drivers/mtd/nand/fsl_upm.c\nindex 1ebfd87..3af5ef3 100644\n--- a/drivers/mtd/nand/fsl_upm.c\n+++ b/drivers/mtd/nand/fsl_upm.c\n@@ -36,9 +36,6 @@ struct fsl_upm_nand {\n \tuint8_t upm_cmd_offset;\n \tvoid __iomem *io_base;\n \tint rnb_gpio;\n-\tconst uint32_t *wait_pattern;\n-\tconst uint32_t *wait_write;\n-\tint chip_delay;\n };\n \n #define to_fsl_upm_nand(mtd) container_of(mtd, struct fsl_upm_nand, mtd)\n@@ -89,8 +86,7 @@ static void fun_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)\n \n \tfsl_upm_run_pattern(&fun->upm, fun->io_base, cmd);\n \n-\tif (fun->wait_pattern)\n-\t\tfun_wait_rnb(fun);\n+\tfun_wait_rnb(fun);\n }\n \n static uint8_t fun_read_byte(struct mtd_info *mtd)\n@@ -116,14 +112,16 @@ static void fun_write_buf(struct mtd_info *mtd, const uint8_t *buf, int len)\n \n \tfor (i = 0; i < len; i++) {\n \t\tout_8(fun->chip.IO_ADDR_W, buf[i]);\n-\t\tif (fun->wait_write)\n-\t\t\tfun_wait_rnb(fun);\n+\t\tfun_wait_rnb(fun);\n \t}\n }\n \n-static int __devinit fun_chip_init(struct fsl_upm_nand *fun)\n+static int __devinit fun_chip_init(struct fsl_upm_nand *fun,\n+\t\t\t\t   const struct device_node *upm_np,\n+\t\t\t\t   const struct resource *io_res)\n {\n \tint ret;\n+\tstruct device_node *flash_np;\n #ifdef CONFIG_MTD_PARTITIONS\n \tstatic const char *part_types[] = { \"cmdlinepart\", NULL, };\n #endif\n@@ -131,7 +129,7 @@ static int __devinit fun_chip_init(struct fsl_upm_nand *fun)\n \tfun->chip.IO_ADDR_R = fun->io_base;\n \tfun->chip.IO_ADDR_W = fun->io_base;\n \tfun->chip.cmd_ctrl = fun_cmd_ctrl;\n-\tfun->chip.chip_delay = fun->chip_delay;\n+\tfun->chip.chip_delay = 50;\n \tfun->chip.read_byte = fun_read_byte;\n \tfun->chip.read_buf = fun_read_buf;\n \tfun->chip.write_buf = fun_write_buf;\n@@ -143,18 +141,37 @@ static int __devinit fun_chip_init(struct fsl_upm_nand *fun)\n \tfun->mtd.priv = &fun->chip;\n \tfun->mtd.owner = THIS_MODULE;\n \n+\tflash_np = of_get_next_child(upm_np, NULL);\n+\tif (!flash_np)\n+\t\treturn -ENODEV;\n+\n+\tfun->mtd.name = kasprintf(GFP_KERNEL, \"%x.%s\", io_res->start,\n+\t\t\t\t  flash_np->name);\n+\tif (!fun->mtd.name) {\n+\t\tret = -ENOMEM;\n+\t\tgoto err;\n+\t}\n+\n \tret = nand_scan(&fun->mtd, 1);\n \tif (ret)\n-\t\treturn ret;\n-\n-\tfun->mtd.name = fun->dev->bus_id;\n+\t\tgoto err;\n \n #ifdef CONFIG_MTD_PARTITIONS\n \tret = parse_mtd_partitions(&fun->mtd, part_types, &fun->parts, 0);\n+\n+#ifdef CONFIG_MTD_OF_PARTS\n+\tif (ret == 0)\n+\t\tret = of_mtd_parse_partitions(fun->dev, &fun->mtd,\n+\t\t\t\t\t      flash_np, &fun->parts);\n+#endif\n \tif (ret > 0)\n-\t\treturn add_mtd_partitions(&fun->mtd, fun->parts, ret);\n+\t\tret = add_mtd_partitions(&fun->mtd, fun->parts, ret);\n+\telse\n #endif\n-\treturn add_mtd_device(&fun->mtd);\n+\t\tret = add_mtd_device(&fun->mtd);\n+err:\n+\tof_node_put(flash_np);\n+\treturn ret;\n }\n \n static int __devinit fun_probe(struct of_device *ofdev,\n@@ -220,17 +237,8 @@ static int __devinit fun_probe(struct of_device *ofdev,\n \n \tfun->dev = &ofdev->dev;\n \tfun->last_ctrl = NAND_CLE;\n-\tfun->wait_pattern = of_get_property(ofdev->node, \"fsl,wait-pattern\",\n-\t\t\t\t\t    NULL);\n-\tfun->wait_write = of_get_property(ofdev->node, \"fsl,wait-write\", NULL);\n-\n-\tprop = of_get_property(ofdev->node, \"chip-delay\", NULL);\n-\tif (prop)\n-\t\tfun->chip_delay = *prop;\n-\telse\n-\t\tfun->chip_delay = 50;\n \n-\tret = fun_chip_init(fun);\n+\tret = fun_chip_init(fun, ofdev->node, &io_res);\n \tif (ret)\n \t\tgoto err2;\n \n@@ -251,6 +259,7 @@ static int __devexit fun_remove(struct of_device *ofdev)\n \tstruct fsl_upm_nand *fun = dev_get_drvdata(&ofdev->dev);\n \n \tnand_release(&fun->mtd);\n+\tkfree(fun->mtd.name);\n \n \tif (fun->rnb_gpio >= 0)\n \t\tgpio_free(fun->rnb_gpio);\n",
    "prefixes": [
        "MTD",
        "NAND"
    ]
}