get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2102556,
    "url": "http://patchwork.ozlabs.org/api/patches/2102556/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20250625132108.3292932-11-jerome.forissier@linaro.org/",
    "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": "<20250625132108.3292932-11-jerome.forissier@linaro.org>",
    "list_archive_url": null,
    "date": "2025-06-25T13:19:18",
    "name": "[v4,10/13] net: extract function net_sntp_set_rtc() from sntp_handler()",
    "commit_ref": "77f0bed326b658fcb57f278bd5228afbe382401a",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "cb40e93d096feb4f1f04cc3a967e1120a372edcc",
    "submitter": {
        "id": 69192,
        "url": "http://patchwork.ozlabs.org/api/people/69192/?format=api",
        "name": "Jerome Forissier",
        "email": "jerome.forissier@linaro.org"
    },
    "delegate": {
        "id": 157425,
        "url": "http://patchwork.ozlabs.org/api/users/157425/?format=api",
        "username": "jforissier",
        "first_name": "Jerome",
        "last_name": "Forissier",
        "email": "jerome.forissier@linaro.org"
    },
    "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20250625132108.3292932-11-jerome.forissier@linaro.org/mbox/",
    "series": [
        {
            "id": 462405,
            "url": "http://patchwork.ozlabs.org/api/series/462405/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=462405",
            "date": "2025-06-25T13:19:11",
            "name": "sntp for NET_LWIP",
            "version": 4,
            "mbox": "http://patchwork.ozlabs.org/series/462405/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2102556/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2102556/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<u-boot-bounces@lists.denx.de>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256\n header.s=google header.b=LTZRhfSx;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=85.214.62.61; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)",
            "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=linaro.org",
            "phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de",
            "phobos.denx.de;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=linaro.org header.i=@linaro.org header.b=\"LTZRhfSx\";\n\tdkim-atps=neutral",
            "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=linaro.org",
            "phobos.denx.de;\n spf=pass smtp.mailfrom=jerome.forissier@linaro.org"
        ],
        "Received": [
            "from phobos.denx.de (phobos.denx.de [85.214.62.61])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature ECDSA (secp384r1))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4bS2Ym2Pwxz1ydW\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 25 Jun 2025 23:22:52 +1000 (AEST)",
            "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 1D9CE82F08;\n\tWed, 25 Jun 2025 15:21:47 +0200 (CEST)",
            "by phobos.denx.de (Postfix, from userid 109)\n id 45D9D82D83; Wed, 25 Jun 2025 15:21:42 +0200 (CEST)",
            "from mail-wm1-x331.google.com (mail-wm1-x331.google.com\n [IPv6:2a00:1450:4864:20::331])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id B419C82E50\n for <u-boot@lists.denx.de>; Wed, 25 Jun 2025 15:21:37 +0200 (CEST)",
            "by mail-wm1-x331.google.com with SMTP id\n 5b1f17b1804b1-4531e146a24so9550475e9.0\n for <u-boot@lists.denx.de>; Wed, 25 Jun 2025 06:21:37 -0700 (PDT)",
            "from builder.. ([2a01:e0a:3cb:7bb0:af71:dfb2:66ef:80c3])\n by smtp.gmail.com with ESMTPSA id\n ffacd0b85a97d-3a6e8068fd0sm4760042f8f.38.2025.06.25.06.21.36\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 25 Jun 2025 06:21:36 -0700 (PDT)"
        ],
        "X-Spam-Checker-Version": "SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de",
        "X-Spam-Level": "",
        "X-Spam-Status": "No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,\n SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=linaro.org; s=google; t=1750857697; x=1751462497; darn=lists.denx.de;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=YYAng4b1PFv6aatTjr0TOnkP6IgSAMBiynf3klbsjUk=;\n b=LTZRhfSxm+CftDPzDUN0GJJ/nw3PICxLcaJ4Qshv0vBg6e4hDoeF0hBa9f47uHsi8i\n CbUm3LuuYE//x7cbMtqP6O17RqMeT3xY33640Skl4Kn1V+2W+I8QLHJHL7oYzfRupszN\n b4N49FLcmy1rGZ1todKTVnGVSfAQsvtUtYoiXEAWPvQDlgiNMHLAjT/C0PWAWAl+xHkU\n dbpKCNNGCFOC1c6OWcEDM2MKg7V9brlNobUzS6XTWczAlhaXr1ztfhp4Ji8xWl/wVS6p\n FhN2Z7kmRWwXyRCjMb5gVX2QAvPeTZAux/cRIrNA1x3AX1M4DnBCs1lrSAUpl5rZiNsC\n GFeQ==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1750857697; x=1751462497;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n :subject:date:message-id:reply-to;\n bh=YYAng4b1PFv6aatTjr0TOnkP6IgSAMBiynf3klbsjUk=;\n b=cxCd9RDQca5+rY4DZmLgsQdfSc+5IBDk+wiANJtbKF4z1MNMwf2Yg45EIEUdyWyxw+\n sF9BX48R16I/umX7EV5NZ1R8kxuU4xsXM4Fn8aBrZ9GgsGegSvojEWzTjD2yvQE3nV0/\n yf0a+ro1IGnWuY2Ftl7uDYob9aiQeAQnv92vxQ3sUXQmbl9v9wVu/8Gq2DnWZQnyrPAy\n wJpUZ3Fu9tN3ngxg89ESQ9fuegO+QBJoGh+hb+OS2b65/lTRUQuIJ5tiDY6AX+CvsHNR\n BUX6FZgIPdcyAtFZmsN1x2TVs3nfWYlGyvbe1edXlku9ty20yq+oZxQoCJkGziKsGqTu\n 53Hg==",
        "X-Gm-Message-State": "AOJu0YyEb8+580y8NiZfTUx8OjIEkyAgLRCNwfkBNQF5mUHRZsJo+e4R\n O+US4UEinjSjcpLIaA+fA2sjWYC5t4UTPQeDL2nHQh5m7h2ymgrqxn1ZnaFeWvT0dQF5IWhqCIT\n lm7/b0pA=",
        "X-Gm-Gg": "ASbGncvY4lNJyB5I+EByGu1K0x6DngZUIVVNEvrGGNkckk3Rw7/PLyJCpPs0u/7vxV0\n JwPQ/UZNegbOYIcSJW5pWBnsoKWpxiQUsn19I2/okMf3ynQ6G4nJtMPGJmAeSItPUeRHtyhE5hv\n /SJMxKsR+1609fxgPjgJwJwLJVcQQGzPRnTllvLprIiSKfAx+khNuXnRjpNwR4j00MFFVQCOmMw\n T514OPGfOsVn33H4bnSYrhBkBFWeoBRK3aV3xaeZVaJMFDbwxEF/oGR/zEpr8UAGrF5rwsfJ/fL\n g3r68H2kmNCRBBxUeNGPT/uGZuHEt8Ln0tgCOrD8U8mJPvmi4s2xAy9nUUu/Dxlm78La69cr518\n UQv/xdQ==",
        "X-Google-Smtp-Source": "\n AGHT+IGxKfrqBi3evvLshNiCBCrQ3mEfp7V64C052oRw2zP6rBW5Mp2RqevuElO3Ww8vImFyUrC9iA==",
        "X-Received": "by 2002:a05:6000:2c0d:b0:3a4:ea40:4d3f with SMTP id\n ffacd0b85a97d-3a6ed6717e2mr2486050f8f.53.1750857696780;\n Wed, 25 Jun 2025 06:21:36 -0700 (PDT)",
        "From": "Jerome Forissier <jerome.forissier@linaro.org>",
        "To": "U-Boot mailing list <u-boot@lists.denx.de>",
        "Cc": "Jerome Forissier <jerome.forissier@linaro.org>,\n Adriano Cordova <adrianox@gmail.com>,\n Heinrich Schuchardt <xypron.glpk@gmx.de>,\n Ilias Apalodimas <ilias.apalodimas@linaro.org>,\n Joe Hershberger <joe.hershberger@ni.com>,\n Ramon Fried <rfried.dev@gmail.com>, Simon Glass <sjg@chromium.org>,\n Tom Rini <trini@konsulko.com>",
        "Subject": "[PATCH v4 10/13] net: extract function net_sntp_set_rtc() from\n sntp_handler()",
        "Date": "Wed, 25 Jun 2025 15:19:18 +0200",
        "Message-ID": "<20250625132108.3292932-11-jerome.forissier@linaro.org>",
        "X-Mailer": "git-send-email 2.43.0",
        "In-Reply-To": "<20250625132108.3292932-1-jerome.forissier@linaro.org>",
        "References": "<20250625132108.3292932-1-jerome.forissier@linaro.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "u-boot@lists.denx.de",
        "X-Mailman-Version": "2.1.39",
        "Precedence": "list",
        "List-Id": "U-Boot discussion <u-boot.lists.denx.de>",
        "List-Unsubscribe": "<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>",
        "List-Archive": "<https://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": "<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>",
        "Errors-To": "u-boot-bounces@lists.denx.de",
        "Sender": "\"U-Boot\" <u-boot-bounces@lists.denx.de>",
        "X-Virus-Scanned": "clamav-milter 0.103.8 at phobos.denx.de",
        "X-Virus-Status": "Clean"
    },
    "content": "Extract the code that sets the RTC clock from sntp_handler() in\nnet/sntp.c and make it a new function net_sntp_set_rtc() in\nnet/net-common.c. This will allow re-use with NET_LWIP.\n\nAccording to [1] it is safe to assume that all devices have been\nconverted to DM_RTC so drop the useless code.\n\n[1] https://lists.denx.de/pipermail/u-boot/2025-June/591376.html\n\nSigned-off-by: Jerome Forissier <jerome.forissier@linaro.org>\n---\n\n(no changes since v2)\n\nChanges in v2:\n- Drop the non-RTC case\n\n include/net-common.h |  2 ++\n net/net-common.c     | 23 +++++++++++++++++++++++\n net/sntp.c           | 23 +++--------------------\n 3 files changed, 28 insertions(+), 20 deletions(-)",
    "diff": "diff --git a/include/net-common.h b/include/net-common.h\nindex 7853612b237..c212d2f9b3b 100644\n--- a/include/net-common.h\n+++ b/include/net-common.h\n@@ -588,4 +588,6 @@ extern struct wget_http_info default_wget_info;\n extern struct wget_http_info *wget_info;\n int wget_request(ulong dst_addr, char *uri, struct wget_http_info *info);\n \n+void net_sntp_set_rtc(u32 seconds);\n+\n #endif /* __NET_COMMON_H__ */\ndiff --git a/net/net-common.c b/net/net-common.c\nindex e01b0da7d7b..b064557d524 100644\n--- a/net/net-common.c\n+++ b/net/net-common.c\n@@ -1,5 +1,9 @@\n // SPDX-License-Identifier: GPL-2.0\n+\n+#include <dm/uclass.h>\n #include <net-common.h>\n+#include <linux/time.h>\n+#include <rtc.h>\n \n void copy_filename(char *dst, const char *src, int size)\n {\n@@ -25,3 +29,22 @@ int wget_request(ulong dst_addr, char *uri, struct wget_http_info *info)\n \twget_info = info ? info : &default_wget_info;\n \treturn wget_do_request(dst_addr, uri);\n }\n+\n+void net_sntp_set_rtc(u32 seconds)\n+{\n+\tstruct rtc_time tm;\n+\tstruct udevice *dev;\n+\tint ret;\n+\n+\trtc_to_tm(seconds, &tm);\n+\n+\tret = uclass_get_device(UCLASS_RTC, 0, &dev);\n+\tif (ret)\n+\t\tprintf(\"SNTP: cannot find RTC: err=%d\\n\", ret);\n+\telse\n+\t\tdm_rtc_set(dev, &tm);\n+\n+\tprintf(\"Date: %4d-%02d-%02d Time: %2d:%02d:%02d\\n\",\n+\t       tm.tm_year, tm.tm_mon, tm.tm_mday,\n+\t       tm.tm_hour, tm.tm_min, tm.tm_sec);\n+}\ndiff --git a/net/sntp.c b/net/sntp.c\nindex 73d1d87d38b..77cee0046bd 100644\n--- a/net/sntp.c\n+++ b/net/sntp.c\n@@ -57,8 +57,7 @@ static void sntp_handler(uchar *pkt, unsigned dest, struct in_addr sip,\n \t\t\t unsigned src, unsigned len)\n {\n \tstruct sntp_pkt_t *rpktp = (struct sntp_pkt_t *)pkt;\n-\tstruct rtc_time tm;\n-\tulong seconds;\n+\tu32 seconds;\n \n \tdebug(\"%s\\n\", __func__);\n \n@@ -69,24 +68,8 @@ static void sntp_handler(uchar *pkt, unsigned dest, struct in_addr sip,\n \t * As the RTC's used in U-Boot support second resolution only\n \t * we simply ignore the sub-second field.\n \t */\n-\tmemcpy(&seconds, &rpktp->transmit_timestamp, sizeof(ulong));\n-\n-\trtc_to_tm(ntohl(seconds) - 2208988800UL + net_ntp_time_offset, &tm);\n-#ifdef CONFIG_DM_RTC\n-\tstruct udevice *dev;\n-\tint ret;\n-\n-\tret = uclass_get_device(UCLASS_RTC, 0, &dev);\n-\tif (ret)\n-\t\tprintf(\"SNTP: cannot find RTC: err=%d\\n\", ret);\n-\telse\n-\t\tdm_rtc_set(dev, &tm);\n-#elif defined(CONFIG_CMD_DATE)\n-\trtc_set(&tm);\n-#endif\n-\tprintf(\"Date: %4d-%02d-%02d Time: %2d:%02d:%02d\\n\",\n-\t       tm.tm_year, tm.tm_mon, tm.tm_mday,\n-\t       tm.tm_hour, tm.tm_min, tm.tm_sec);\n+\tmemcpy(&seconds, &rpktp->transmit_timestamp, sizeof(seconds));\n+\tnet_sntp_set_rtc(ntohl(seconds) - 2208988800UL + net_ntp_time_offset);\n \n \tnet_set_state(NETLOOP_SUCCESS);\n }\n",
    "prefixes": [
        "v4",
        "10/13"
    ]
}