get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 207456,
    "url": "http://patchwork.ozlabs.org/api/patches/207456/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/1355934463-24319-2-git-send-email-jagannadh.teki@gmail.com/",
    "project": {
        "id": 18,
        "url": "http://patchwork.ozlabs.org/api/projects/18/?format=api",
        "name": "U-Boot",
        "link_name": "uboot",
        "list_id": "u-boot.lists.denx.de",
        "list_email": "u-boot@lists.denx.de",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<1355934463-24319-2-git-send-email-jagannadh.teki@gmail.com>",
    "list_archive_url": null,
    "date": "2012-12-19T16:27:39",
    "name": "[U-Boot,U-Boot,v2,2/6] cmd_sf: Add print messages on flash read/write commands",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "e5cb56d6b995ef2be8dc789863b802abcf10e89c",
    "submitter": {
        "id": 20045,
        "url": "http://patchwork.ozlabs.org/api/people/20045/?format=api",
        "name": "Jagan Teki",
        "email": "jagannadh.teki@gmail.com"
    },
    "delegate": {
        "id": 17739,
        "url": "http://patchwork.ozlabs.org/api/users/17739/?format=api",
        "username": "jagan",
        "first_name": "Jagannadha Sutradharudu",
        "last_name": "Teki",
        "email": "jagannadh.teki@gmail.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/1355934463-24319-2-git-send-email-jagannadh.teki@gmail.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/207456/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/207456/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<u-boot-bounces@lists.denx.de>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org",
        "Received": [
            "from theia.denx.de (theia.denx.de [85.214.87.163])\n\tby ozlabs.org (Postfix) with ESMTP id ADB6F2C0089\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 20 Dec 2012 03:35:59 +1100 (EST)",
            "from localhost (localhost [127.0.0.1])\n\tby theia.denx.de (Postfix) with ESMTP id DCE324A027;\n\tWed, 19 Dec 2012 17:35:57 +0100 (CET)",
            "from theia.denx.de ([127.0.0.1])\n\tby localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id cQd+jfzrnsr0; Wed, 19 Dec 2012 17:35:57 +0100 (CET)",
            "from theia.denx.de (localhost [127.0.0.1])\n\tby theia.denx.de (Postfix) with ESMTP id 7E9744A049;\n\tWed, 19 Dec 2012 17:35:55 +0100 (CET)",
            "from localhost (localhost [127.0.0.1])\n\tby theia.denx.de (Postfix) with ESMTP id 46FA14A050\n\tfor <u-boot@lists.denx.de>; Wed, 19 Dec 2012 17:35:53 +0100 (CET)",
            "from theia.denx.de ([127.0.0.1])\n\tby localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id 3d25rrsaVMH9 for <u-boot@lists.denx.de>;\n\tWed, 19 Dec 2012 17:35:52 +0100 (CET)",
            "from mail-pa0-f45.google.com (mail-pa0-f45.google.com\n\t[209.85.220.45]) by theia.denx.de (Postfix) with ESMTPS id 44C434A049\n\tfor <u-boot@lists.denx.de>; Wed, 19 Dec 2012 17:35:51 +0100 (CET)",
            "by mail-pa0-f45.google.com with SMTP id bg2so1428734pad.4\n\tfor <u-boot@lists.denx.de>; Wed, 19 Dec 2012 08:35:49 -0800 (PST)",
            "from localhost.localdomain ([123.237.83.48])\n\tby mx.google.com with ESMTPS id z5sm3683430pax.9.2012.12.19.08.28.10\n\t(version=TLSv1/SSLv3 cipher=OTHER);\n\tWed, 19 Dec 2012 08:28:11 -0800 (PST)"
        ],
        "X-Virus-Scanned": [
            "Debian amavisd-new at theia.denx.de",
            "Debian amavisd-new at theia.denx.de"
        ],
        "X-policyd-weight": "NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5\n\tNOT_IN_BL_NJABL=-1.5 (only DNSBL check requested)",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\n\th=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to\n\t:references; bh=s8VY4+ymKg7SK0yvMie3IpcA4lCDg/pstVLQl/Z75kw=;\n\tb=u+7wGdE81thL0dL6bvnImDCYbHjQb3WWL/6zPL1STk7uU0UPwzCB5RciMpPpiRBpu/\n\t9DUmW5q0YiFTP8M28ATBL4PSUq0uI3r4qdF2sYnj5MWbgXJwac4zrsGJqCK5V18UGAMg\n\tW6lSR5olGiuC1HHiYZmJORa0FbzyalYlb4yjERZp9YW0rDViSy28srQYF2xJ+IZJ0xbv\n\t+4I7mGHmbzznpJlZWDGJzGgDS2Gmc3uxXWJ7ZgX2h51sinMPFKbKkCV1nv/YgKmx6hd0\n\tqQbycr2JEUil8H+JeID2pDGps9qwSPCIlxSCTmWEp/ZGvQ91tcnd6oc6bZM8HBYK46Cm\n\tC2gg==",
        "X-Received": "by 10.68.220.162 with SMTP id px2mr19868170pbc.109.1355934492896;\n\tWed, 19 Dec 2012 08:28:12 -0800 (PST)",
        "From": "Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>",
        "To": "u-boot@lists.denx.de",
        "Date": "Wed, 19 Dec 2012 21:57:39 +0530",
        "Message-Id": "<1355934463-24319-2-git-send-email-jagannadh.teki@gmail.com>",
        "X-Mailer": "git-send-email 1.7.0.4",
        "In-Reply-To": "<1355934463-24319-1-git-send-email-jagannadh.teki@gmail.com>",
        "References": "<1355934463-24319-1-git-send-email-jagannadh.teki@gmail.com>",
        "Subject": "[U-Boot] [U-Boot,\n\tv2 2/6] cmd_sf: Add print messages on flash read/write commands",
        "X-BeenThere": "u-boot@lists.denx.de",
        "X-Mailman-Version": "2.1.11",
        "Precedence": "list",
        "List-Id": "U-Boot discussion <u-boot.lists.denx.de>",
        "List-Unsubscribe": "<http://lists.denx.de/mailman/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>",
        "List-Archive": "<http://lists.denx.de/pipermail/u-boot>",
        "List-Post": "<mailto:u-boot@lists.denx.de>",
        "List-Help": "<mailto:u-boot-request@lists.denx.de?subject=help>",
        "List-Subscribe": "<http://lists.denx.de/mailman/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Sender": "u-boot-bounces@lists.denx.de",
        "Errors-To": "u-boot-bounces@lists.denx.de"
    },
    "content": "This patch adds a print messages while using 'sf read' and\n'sf write' commands to make sure that how many bytes read/written\nfrom/into flash device.\n\nSigned-off-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>\n---\nChanges in v2:\n        Move print messages from spi_flash.c into cmd_sf.c\n\n common/cmd_sf.c             |   26 ++++++++++++++++----------\n drivers/mtd/spi/spi_flash.c |    3 ---\n 2 files changed, 16 insertions(+), 13 deletions(-)",
    "diff": "diff --git a/common/cmd_sf.c b/common/cmd_sf.c\nindex ddb1a65..efdd640 100644\n--- a/common/cmd_sf.c\n+++ b/common/cmd_sf.c\n@@ -196,7 +196,7 @@ static int do_spi_flash_read_write(int argc, char * const argv[])\n \tunsigned long len;\n \tvoid *buf;\n \tchar *endp;\n-\tint ret;\n+\tint ret = 0;\n \n \tif (argc < 4)\n \t\treturn -1;\n@@ -226,19 +226,25 @@ static int do_spi_flash_read_write(int argc, char * const argv[])\n \n \tif (strcmp(argv[0], \"update\") == 0)\n \t\tret = spi_flash_update(flash, offset, len, buf);\n-\telse if (strcmp(argv[0], \"read\") == 0)\n-\t\tret = spi_flash_read(flash, offset, len, buf);\n-\telse\n-\t\tret = spi_flash_write(flash, offset, len, buf);\n+\telse if (strncmp(argv[0], \"read\", 4) == 0 ||\n+\t\t\tstrncmp(argv[0], \"write\", 5) == 0) {\n+\t\tint read;\n \n-\tunmap_physmem(buf, len);\n+\t\tread = strncmp(argv[0], \"read\", 4) == 0;\n+\t\tprintf(\"SF: %s flash... \", read ? \"Reading\" : \"Writing\");\n \n-\tif (ret) {\n-\t\tprintf(\"SPI flash %s failed\\n\", argv[0]);\n-\t\treturn 1;\n+\t\tif (read)\n+\t\t\tret = spi_flash_read(flash, offset, len, buf);\n+\t\telse\n+\t\t\tret = spi_flash_write(flash, offset, len, buf);\n+\n+\t\tprintf(\"%zu bytes @ %#x %s: %s\\n\", (size_t)len, (u32)offset,\n+\t\t\tread ? \"read\" : \"written\", ret ? \"ERROR\" : \"OK\");\n \t}\n \n-\treturn 0;\n+\tunmap_physmem(buf, len);\n+\n+\treturn ret == 0 ? 0 : 1;\n }\n \n static int do_spi_flash_erase(int argc, char * const argv[])\ndiff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c\nindex 43e0334..9e8939c 100644\n--- a/drivers/mtd/spi/spi_flash.c\n+++ b/drivers/mtd/spi/spi_flash.c\n@@ -115,9 +115,6 @@ int spi_flash_cmd_write_multi(struct spi_flash *flash, u32 offset,\n \t\tbyte_addr = 0;\n \t}\n \n-\tdebug(\"SF: program %s %zu bytes @ %#x\\n\",\n-\t      ret ? \"failure\" : \"success\", len, offset);\n-\n \tspi_release_bus(flash->spi);\n \treturn ret;\n }\n",
    "prefixes": [
        "U-Boot",
        "U-Boot",
        "v2",
        "2/6"
    ]
}