get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 104979,
    "url": "http://patchwork.ozlabs.org/api/patches/104979/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/1310831460-14450-2-git-send-email-apr@cn-eng.de/",
    "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": "<1310831460-14450-2-git-send-email-apr@cn-eng.de>",
    "list_archive_url": null,
    "date": "2011-07-16T15:50:59",
    "name": "[U-Boot,v2,1/2] automatic update from FIT image: add optional address parameter",
    "commit_ref": "8d6b73202c65f40f88ac27f5e5d2203fe6ae3f1d",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "62b4b2fdde4a5692feffbf117c46867b102bd682",
    "submitter": {
        "id": 6492,
        "url": "http://patchwork.ozlabs.org/api/people/6492/?format=api",
        "name": "Andreas Pretzsch",
        "email": "apr@cn-eng.de"
    },
    "delegate": {
        "id": 1689,
        "url": "http://patchwork.ozlabs.org/api/users/1689/?format=api",
        "username": "wd",
        "first_name": "Wolfgang",
        "last_name": "Denk",
        "email": "wd@denx.de"
    },
    "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/1310831460-14450-2-git-send-email-apr@cn-eng.de/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/104979/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/104979/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 382EAB6F70\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSun, 17 Jul 2011 01:51:59 +1000 (EST)",
            "from localhost (localhost [127.0.0.1])\n\tby theia.denx.de (Postfix) with ESMTP id C687E28094;\n\tSat, 16 Jul 2011 17:51:52 +0200 (CEST)",
            "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 RdGJNgTM8oqW; Sat, 16 Jul 2011 17:51:52 +0200 (CEST)",
            "from theia.denx.de (localhost [127.0.0.1])\n\tby theia.denx.de (Postfix) with ESMTP id 2EE3328088;\n\tSat, 16 Jul 2011 17:51:51 +0200 (CEST)",
            "from localhost (localhost [127.0.0.1])\n\tby theia.denx.de (Postfix) with ESMTP id 7E62728081\n\tfor <u-boot@lists.denx.de>; Sat, 16 Jul 2011 17:51:49 +0200 (CEST)",
            "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 sf69KFYEuzCJ for <u-boot@lists.denx.de>;\n\tSat, 16 Jul 2011 17:51:48 +0200 (CEST)",
            "from mail.mars-solutions.de (mars-solutions.de [213.239.212.107])\n\tby theia.denx.de (Postfix) with ESMTP id C4A6D28088\n\tfor <u-boot@lists.denx.de>; Sat, 16 Jul 2011 17:51:45 +0200 (CEST)",
            "from localhost (localhost [127.0.0.1])\n\tby mail.mars-solutions.de (Postfix) with ESMTP id A0E6AA040D0\n\tfor <u-boot@lists.denx.de>; Sat, 16 Jul 2011 17:50:02 +0200 (CEST)",
            "from mail.mars-solutions.de ([127.0.0.1])\n\tby localhost (mars-solutions.de [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id IpE14d+YyD2J for <u-boot@lists.denx.de>;\n\tSat, 16 Jul 2011 17:49:56 +0200 (CEST)",
            "by mail.mars-solutions.de (Postfix, from userid 1036)\n\tid 1252DA040E7; Sat, 16 Jul 2011 17:49:56 +0200 (CEST)",
            "from ws-apr.office.loc\n\t(HSI-KBW-078-043-059-252.hsi4.kabel-badenwuerttemberg.de\n\t[78.43.59.252])\n\tby mail.mars-solutions.de (Postfix) with ESMTP id ADE18A040D0\n\tfor <u-boot@lists.denx.de>; Sat, 16 Jul 2011 17:49:55 +0200 (CEST)",
            "by ws-apr.office.loc (Postfix, from userid 1000)\n\tid B6133276052; Sat, 16 Jul 2011 17:51:37 +0200 (CEST)"
        ],
        "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)",
        "From": "Andreas Pretzsch <apr@cn-eng.de>",
        "To": "u-boot@lists.denx.de",
        "Date": "Sat, 16 Jul 2011 17:50:59 +0200",
        "Message-Id": "<1310831460-14450-2-git-send-email-apr@cn-eng.de>",
        "X-Mailer": "git-send-email 1.7.5.4",
        "In-Reply-To": "<1310831460-14450-1-git-send-email-apr@cn-eng.de>",
        "References": "<1303246918-19921-1-git-send-email-apr@cn-eng.de>\n\t<1310831460-14450-1-git-send-email-apr@cn-eng.de>",
        "Cc": "Andreas Pretzsch <apr@cn-eng.de>",
        "Subject": "[U-Boot] [PATCH v2 1/2] automatic update from FIT image: add\n\toptional address parameter",
        "X-BeenThere": "u-boot@lists.denx.de",
        "X-Mailman-Version": "2.1.9",
        "Precedence": "list",
        "List-Id": "U-Boot discussion <u-boot.lists.denx.de>",
        "List-Unsubscribe": "<http://lists.denx.de/mailman/listinfo/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": "Current update_tftp() flow:\n  1.) fetch \"updatefile\" from defined TFTP server\n  2.) check if FIT format\n  3.) flash contained images\n\nAdd an address parameter to update_tftp(). If this address is non-zero,\nskip the TFTP transfer and use the image at this address.\nAlso extend update_tftp() to return success/fail.\n\nSigned-off-by: Andreas Pretzsch <apr@cn-eng.de>\n---\nChanges for v2:\n   - void update_tftp() => int update_tftp(): return success/fail\n---\n common/main.c   |    4 ++--\n common/update.c |   20 ++++++++++++++------\n 2 files changed, 16 insertions(+), 8 deletions(-)",
    "diff": "diff --git a/common/main.c b/common/main.c\nindex 2730c6f..0a310e0 100644\n--- a/common/main.c\n+++ b/common/main.c\n@@ -51,7 +51,7 @@ void inline __show_boot_progress (int val) {}\n void show_boot_progress (int val) __attribute__((weak, alias(\"__show_boot_progress\")));\n \n #if defined(CONFIG_UPDATE_TFTP)\n-void update_tftp (void);\n+int update_tftp (ulong addr);\n #endif /* CONFIG_UPDATE_TFTP */\n \n #define MAX_DELAY_STOP_STR 32\n@@ -345,7 +345,7 @@ void main_loop (void)\n #endif /* CONFIG_PREBOOT */\n \n #if defined(CONFIG_UPDATE_TFTP)\n-\tupdate_tftp ();\n+\tupdate_tftp (0UL);\n #endif /* CONFIG_UPDATE_TFTP */\n \n #if defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY >= 0)\ndiff --git a/common/update.c b/common/update.c\nindex 7528474..a19f136 100644\n--- a/common/update.c\n+++ b/common/update.c\n@@ -238,13 +238,17 @@ static int update_fit_getparams(const void *fit, int noffset, ulong *addr,\n \treturn 0;\n }\n \n-void update_tftp(void)\n+int update_tftp(ulong addr)\n {\n \tchar *filename, *env_addr;\n \tint images_noffset, ndepth, noffset;\n \tulong update_addr, update_fladdr, update_size;\n-\tulong addr;\n \tvoid *fit;\n+\tint ret = 0;\n+\n+\t/* use already present image */\n+\tif (addr)\n+\t\tgoto got_update_file;\n \n \tprintf(\"Auto-update from TFTP: \");\n \n@@ -253,7 +257,7 @@ void update_tftp(void)\n \tif (filename == NULL) {\n \t\tprintf(\"failed, env. variable '%s' not found\\n\",\n \t\t\t\t\t\t\tUPDATE_FILE_ENV);\n-\t\treturn;\n+\t\treturn 1;\n \t}\n \n \tprintf(\"trying update file '%s'\\n\", filename);\n@@ -268,15 +272,16 @@ void update_tftp(void)\n \tif (update_load(filename, CONFIG_UPDATE_TFTP_MSEC_MAX,\n \t\t\t\t\tCONFIG_UPDATE_TFTP_CNT_MAX, addr)) {\n \t\tprintf(\"Can't load update file, aborting auto-update\\n\");\n-\t\treturn;\n+\t\treturn 1;\n \t}\n \n+got_update_file:\n \tfit = (void *)addr;\n \n \tif (!fit_check_format((void *)fit)) {\n \t\tprintf(\"Bad FIT format of the update file, aborting \"\n \t\t\t\t\t\t\t\"auto-update\\n\");\n-\t\treturn;\n+\t\treturn 1;\n \t}\n \n \t/* process updates */\n@@ -293,6 +298,7 @@ void update_tftp(void)\n \n \t\tif (!fit_image_check_hashes(fit, noffset)) {\n \t\t\tprintf(\"Error: invalid update hash, aborting\\n\");\n+\t\t\tret = 1;\n \t\t\tgoto next_node;\n \t\t}\n \n@@ -301,15 +307,17 @@ void update_tftp(void)\n \t\t\t\t\t&update_fladdr, &update_size)) {\n \t\t\tprintf(\"Error: can't get update parameteres, \"\n \t\t\t\t\t\t\t\t\"aborting\\n\");\n+\t\t\tret = 1;\n \t\t\tgoto next_node;\n \t\t}\n \t\tif (update_flash(update_addr, update_fladdr, update_size)) {\n \t\t\tprintf(\"Error: can't flash update, aborting\\n\");\n+\t\t\tret = 1;\n \t\t\tgoto next_node;\n \t\t}\n next_node:\n \t\tnoffset = fdt_next_node(fit, noffset, &ndepth);\n \t}\n \n-\treturn;\n+\treturn ret;\n }\n",
    "prefixes": [
        "U-Boot",
        "v2",
        "1/2"
    ]
}