Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2225697/?format=api
{ "id": 2225697, "url": "http://patchwork.ozlabs.org/api/patches/2225697/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20260421080847.235789-1-happycpu@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": "<20260421080847.235789-1-happycpu@gmail.com>", "list_archive_url": null, "date": "2026-04-21T08:08:47", "name": "gpio: 74x164: use dev_read_* APIs for live-tree compatibility", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "1c43468c565ec652364672c3bcdf49f8445fbedb", "submitter": { "id": 93205, "url": "http://patchwork.ozlabs.org/api/people/93205/?format=api", "name": "Chanhong Jung", "email": "happycpu@gmail.com" }, "delegate": { "id": 3651, "url": "http://patchwork.ozlabs.org/api/users/3651/?format=api", "username": "trini", "first_name": "Tom", "last_name": "Rini", "email": "trini@ti.com" }, "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20260421080847.235789-1-happycpu@gmail.com/mbox/", "series": [ { "id": 500793, "url": "http://patchwork.ozlabs.org/api/series/500793/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=500793", "date": "2026-04-21T08:08:47", "name": "gpio: 74x164: use dev_read_* APIs for live-tree compatibility", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/500793/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2225697/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2225697/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=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=dor9wbhE;\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=gmail.com", "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=gmail.com header.i=@gmail.com header.b=\"dor9wbhE\";\n\tdkim-atps=neutral", "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=gmail.com", "phobos.denx.de;\n spf=pass smtp.mailfrom=happycpu@gmail.com" ], "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)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0MMw6yvVz1yJG\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 21 Apr 2026 22:38:20 +1000 (AEST)", "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id AFE568432A;\n\tTue, 21 Apr 2026 14:37:44 +0200 (CEST)", "by phobos.denx.de (Postfix, from userid 109)\n id 1940C8436C; Tue, 21 Apr 2026 10:08:55 +0200 (CEST)", "from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com\n [IPv6:2607:f8b0:4864:20::102b])\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 DF8FB84378\n for <u-boot@lists.denx.de>; Tue, 21 Apr 2026 10:08:52 +0200 (CEST)", "by mail-pj1-x102b.google.com with SMTP id\n 98e67ed59e1d1-35fb7c1a455so1583834a91.3\n for <u-boot@lists.denx.de>; Tue, 21 Apr 2026 01:08:52 -0700 (PDT)", "from happycpu-p1.. ([121.160.151.7])\n by smtp.gmail.com with ESMTPSA id\n 98e67ed59e1d1-36141973c57sm12547393a91.14.2026.04.21.01.08.49\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 21 Apr 2026 01:08:50 -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=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_GMAIL_RCVD,FREEMAIL_FROM,\n RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=no\n autolearn_force=no version=3.4.2", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1776758931; x=1777363731; darn=lists.denx.de;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:from:to:cc:subject:date:message-id:reply-to;\n bh=ty1AuVJ60rqNW9oDZzVrfMesTBg9B7KTK4geTZZvpik=;\n b=dor9wbhEJwJir4FsScn6Lld1Bz3j2k/j6Td/tjx1JXSFQnmHgVmgsRrVQGLC5gkm+r\n eJlv2JTiXihPJdHl411OB8dJXfzVmxhvpAgOZvVGL8ViOm5p9ag4SmjnKKTTpRzQQVR8\n GpRwWi0Xuxfrpb0CsOwvfGgCzfFs22Cp3fK0lTV2dCN3jp/DI5wd1F1OxQYxINiYz78b\n IkiR5z857O0IiJ5kyhVkH+JbnmkBgK9RxUHcfAPL/Nln+DLa1cBth5Is1Y/NDF0xy/n/\n fdLLomDXQVfcyLtj4E0FLLHWy6TXdIDc/TvEyf038bgQPxK5Wm6vtJ3t7hjdI1FR1y0s\n ibZQ==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776758931; x=1777363731;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=ty1AuVJ60rqNW9oDZzVrfMesTBg9B7KTK4geTZZvpik=;\n b=bf869PvA64dl1QonRW6OWoyxN2boAly8r+qrTprcq/M+85Y4zhrsz6w7BQmH9M8OCD\n l81USLpOcSuzh1Y49IDcQyNjsARUW6Zt7RZ/Yv65g1r7nm0MTJ+xkwHsd5TvaNYFusAF\n +LwmKnWzJKxMtFbzkv7zO+mK9xQxKtjB6vNUYlSMxOWsk18wQ2NBilep8Rxa+TjTOv6T\n NW0TZZZY9U1R0P41x1q7xMi03rSqNf6wH0n59a1LtvAS5fDUQGKksZwWuoL23S5H1dCE\n 6Xdh1JJCKWGvhOvVsbHxjdATw7CxThM6SY8eeq8u6ZOUyLtdLiBKcu8SiFpLiY+giJCu\n W7sg==", "X-Gm-Message-State": "AOJu0Yy2Rr4Q4JTku920eRM+vTYinBomkjRpnAVRuBldjAoSu+/w5YeN\n 28Hb+tu6bgUextJedvS19cAO+PHJ2ohYLrXdVVNRFI3v2NhG9rxI//4r6/jZag==", "X-Gm-Gg": "AeBDieu4FoPA98PPKPgGm8vqI+qU/muiL/PSoJGoZLmv5O8gxxkn797Qwm4NrVDLi8a\n uyWY4X8+X7cSy9bdAm6o/Z+xtQIXiBNW8KPZ9Gx3zGEl0k0pD/kzPu2TtXGk3OtohjlD22nmkqh\n gBVs0g47gYN1UqZSoy2F/Aqv6SKWsy+QVIb4KQO3ouVr02oPIEB7DIJc5jsRYphsCs3Qcdtw+ej\n 9omVxsdMu5bKyAv9Qh8rc0v1PsreJu+dFfSjHfHZA1a4aGSTD4Jz43hCG0soz/1/lcRiC7hQfdE\n XM2dlnjxlnh8CVSf06B/exIfDj6Ktp8CqbpWXEavJdOQsTYfVX6vIS1EWSjYjsy3gpgS1C55FD9\n IpmUYC5Zhfn66VrCpw/NkmW+90oR/Od8/cnM2dVSk8HcODgmljIjReM4CWwWnk5RAfkj0afrzi3\n RbnAY+e1O44xOY4yPpCsUuTJnxJE/J7NEHPDF+C0+jCifBSWL0bqg4ZCUOhP6WTFEO", "X-Received": "by 2002:a17:90a:e7ca:b0:35d:8fdb:4f36 with SMTP id\n 98e67ed59e1d1-3614048a21bmr17510273a91.18.1776758930864;\n Tue, 21 Apr 2026 01:08:50 -0700 (PDT)", "From": "Chanhong Jung <happycpu@gmail.com>", "To": "u-boot@lists.denx.de", "Cc": "trini@konsulko.com,\n\tsjg@chromium.org,\n\tpeng.fan@nxp.com", "Subject": "[PATCH] gpio: 74x164: use dev_read_* APIs for live-tree compatibility", "Date": "Tue, 21 Apr 2026 17:08:47 +0900", "Message-Id": "<20260421080847.235789-1-happycpu@gmail.com>", "X-Mailer": "git-send-email 2.34.1", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-Mailman-Approved-At": "Tue, 21 Apr 2026 14:37:42 +0200", "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": "With CONFIG_OF_LIVE=y, dev_of_offset(dev) does not return a valid\nflat-FDT offset, so fdtdec_get_int(gd->fdt_blob, offset, ...) inside\ngen_74x164_probe() fails to locate the \"registers-number\" property and\nalways falls back to the default value of 1. This results in a 4-chip\n74HC595 daisy chain being exposed as only 8 GPIOs instead of 32, and\nany consumer referencing offsets >= 8 fails to bind with -ENOENT\n(\"GPIO ... not found\" / Error -22).\n\nThe \"registers-default\" property is ignored for the same reason, so\nany configured power-on output pattern is silently discarded.\n\nReplace the flat-FDT helpers with dev_read_u32_default() and\ndev_read_u8_array_ptr(), which correctly walk both live and flat\ntrees. This matches how other DM GPIO drivers (e.g. pca953x_gpio.c)\nread their per-device properties.\n\nTested on stm32mp153d-ssonic (CONFIG_OF_LIVE=y) with a 4-chip 74HC595\nchain: all 32 GPIOs are now exposed, and 16 consumer LED nodes at\noffsets 0..31 bind successfully.\n\nFixes: 9300f711baac (\"dm: gpio: introduce 74x164 driver\")\nSigned-off-by: Chanhong Jung <happycpu@gmail.com>\n---\n drivers/gpio/74x164_gpio.c | 13 ++++++-------\n 1 file changed, 6 insertions(+), 7 deletions(-)", "diff": "diff --git a/drivers/gpio/74x164_gpio.c b/drivers/gpio/74x164_gpio.c\nindex 331428ccdb9..e394d1ce379 100644\n--- a/drivers/gpio/74x164_gpio.c\n+++ b/drivers/gpio/74x164_gpio.c\n@@ -10,7 +10,6 @@\n \n #include <errno.h>\n #include <dm.h>\n-#include <fdtdec.h>\n #include <malloc.h>\n #include <asm/global_data.h>\n #include <asm/gpio.h>\n@@ -127,10 +126,9 @@ static int gen_74x164_probe(struct udevice *dev)\n {\n \tstruct gen_74x164_priv *priv = dev_get_priv(dev);\n \tstruct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev);\n+\tconst u8 *defaults;\n \tchar *str, name[32];\n \tint ret;\n-\tconst void *fdt = gd->fdt_blob;\n-\tint node = dev_of_offset(dev);\n \n \tsnprintf(name, sizeof(name), \"%s_\", dev->name);\n \tstr = strdup(name);\n@@ -141,16 +139,17 @@ static int gen_74x164_probe(struct udevice *dev)\n \t * See Linux kernel:\n \t * Documentation/devicetree/bindings/gpio/gpio-74x164.txt\n \t */\n-\tpriv->nregs = fdtdec_get_int(fdt, node, \"registers-number\", 1);\n+\tpriv->nregs = dev_read_u32_default(dev, \"registers-number\", 1);\n \tpriv->buffer = calloc(priv->nregs, sizeof(u8));\n \tif (!priv->buffer) {\n \t\tret = -ENOMEM;\n \t\tgoto free_str;\n \t}\n \n-\tret = fdtdec_get_byte_array(fdt, node, \"registers-default\",\n-\t\t\t\t priv->buffer, priv->nregs);\n-\tif (ret)\n+\tdefaults = dev_read_u8_array_ptr(dev, \"registers-default\", priv->nregs);\n+\tif (defaults)\n+\t\tmemcpy(priv->buffer, defaults, priv->nregs);\n+\telse\n \t\tdev_dbg(dev, \"No registers-default property\\n\");\n \n \tret = gpio_request_by_name(dev, \"oe-gpios\", 0, &priv->oe,\n", "prefixes": [] }