Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.1/patches/2228951/?format=api
{ "id": 2228951, "url": "http://patchwork.ozlabs.org/api/1.1/patches/2228951/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-gpio/patch/20260427143020.2800317-1-arnd@kernel.org/", "project": { "id": 42, "url": "http://patchwork.ozlabs.org/api/1.1/projects/42/?format=api", "name": "Linux GPIO development", "link_name": "linux-gpio", "list_id": "linux-gpio.vger.kernel.org", "list_email": "linux-gpio@vger.kernel.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20260427143020.2800317-1-arnd@kernel.org>", "date": "2026-04-27T14:30:08", "name": "dsa: b53: hide legacy gpiolib usage on non-mips", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "ccbef5b209b7c9f5d8e191185092a26def8e0e5a", "submitter": { "id": 80402, "url": "http://patchwork.ozlabs.org/api/1.1/people/80402/?format=api", "name": "Arnd Bergmann", "email": "arnd@kernel.org" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-gpio/patch/20260427143020.2800317-1-arnd@kernel.org/mbox/", "series": [ { "id": 501660, "url": "http://patchwork.ozlabs.org/api/1.1/series/501660/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-gpio/list/?series=501660", "date": "2026-04-27T14:30:08", "name": "dsa: b53: hide legacy gpiolib usage on non-mips", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/501660/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2228951/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2228951/checks/", "tags": {}, "headers": { "Return-Path": "\n <linux-gpio+bounces-35593-incoming=patchwork.ozlabs.org@vger.kernel.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "linux-gpio@vger.kernel.org" ], "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=cQ/fOKue;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-gpio+bounces-35593-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=\"cQ/fOKue\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201" ], "Received": [ "from sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::12fc:5321])\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 4g45gY6nYMz1yHX\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 28 Apr 2026 00:34:49 +1000 (AEST)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id A32BC30A26FC\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 27 Apr 2026 14:30:29 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 53D4F2798F3;\n\tMon, 27 Apr 2026 14:30:28 +0000 (UTC)", "from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org\n [10.30.226.201])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 15B311E5B63;\n\tMon, 27 Apr 2026 14:30:28 +0000 (UTC)", "by smtp.kernel.org (Postfix) with ESMTPSA id AF362C2BCB4;\n\tMon, 27 Apr 2026 14:30:24 +0000 (UTC)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1777300228; cv=none;\n b=YgT89PGp/pqrvZV1haQ/QcTIycfMe08iNDn93eygl6EjGGE0I0j+8JthhZpc83cwcII2JDMZuduCI+1Sgzd3A/lesZSS5wCTjgwnyNQbdKijeWqEG82ePwE+Om5aCRwYpSAeCBx9Ig++MuM+NaRBUc7TqZMXrJhqX31kNIjKUGM=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1777300228; c=relaxed/simple;\n\tbh=hhw7ORcJvx+XMfsnPQMXBBhpIaCemzbjzVToiUZbMdI=;\n\th=From:To:Cc:Subject:Date:Message-Id:MIME-Version;\n b=uu5INcsMRxfynKwl/MN/fpe34n47GKT8i9khgzQDlDDDKzByiV5VkEj/8Ti4BqRAXPZ6WWOtmn5D7tIaC4P3EhyM0GOlz4ruIx+hxM+BOFJalAhw/xXZ33O0dxGCUCmRrdRbut+eZePRLNJYWyDRLkqNSxs+G32kWN5K8N8K0io=", "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=cQ/fOKue; arc=none smtp.client-ip=10.30.226.201", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1777300228;\n\tbh=hhw7ORcJvx+XMfsnPQMXBBhpIaCemzbjzVToiUZbMdI=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=cQ/fOKue37nRo1QbbzH2e/+lr5hpba/j2XAmC/anSZW3kP0EbksKCvrUuO0mS2MTh\n\t L0o5wG5yxu/tON6aS8TWAgr7ixHcVKcgoowXLy89wCgVM2CE7/H3/okfVZkxmRx4Iz\n\t 7k955PmOwOdUzfjkLnKCUFH6raG/3li2mgbmu7wZsB08a7eW5Bom9M+fF8R6U+0eAM\n\t QnYYg3ddBrdPE/AxtVwR7QS7hqFMsdKD26jkPXrwQPRnTFaDiDG1gpkORN6PRp4wAy\n\t S4I7YzyT6OfpGvx1NLr4DMozltPFRiBKJH/b9j3IaUiv37mD+QiPvCewqCMDY3VzZ3\n\t IeTkLvcZYF06g==", "From": "Arnd Bergmann <arnd@kernel.org>", "To": "Florian Fainelli <florian.fainelli@broadcom.com>,\n\tJonas Gorski <jonas.gorski@gmail.com>,\n\tAndrew Lunn <andrew@lunn.ch>,\n\tVladimir Oltean <olteanv@gmail.com>,\n\t\"David S. Miller\" <davem@davemloft.net>,\n\tEric Dumazet <edumazet@google.com>,\n\tJakub Kicinski <kuba@kernel.org>,\n\tPaolo Abeni <pabeni@redhat.com>,\n\tLinus Walleij <linusw@kernel.org>,\n\tBartosz Golaszewski <brgl@kernel.org>", "Cc": "Arnd Bergmann <arnd@arndb.de>, =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Roja?=\n\t=?utf-8?q?s?= <noltari@gmail.com>, Kyle Hendry <kylehendrydev@gmail.com>,\n netdev@vger.kernel.org, linux-kernel@vger.kernel.org,\n linux-gpio@vger.kernel.org", "Subject": "[PATCH] dsa: b53: hide legacy gpiolib usage on non-mips", "Date": "Mon, 27 Apr 2026 16:30:08 +0200", "Message-Id": "<20260427143020.2800317-1-arnd@kernel.org>", "X-Mailer": "git-send-email 2.39.5", "Precedence": "bulk", "X-Mailing-List": "linux-gpio@vger.kernel.org", "List-Id": "<linux-gpio.vger.kernel.org>", "List-Subscribe": "<mailto:linux-gpio+subscribe@vger.kernel.org>", "List-Unsubscribe": "<mailto:linux-gpio+unsubscribe@vger.kernel.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit" }, "content": "From: Arnd Bergmann <arnd@arndb.de>\n\nThe MIPS bcm53xx platform still uses the legacy gpiolib interfaces based\non gpio numbers, but other platforms do not.\n\nHide these interfaces inside of the existing #ifdef block and use the\nmodern interfaces in the common parts of the driver to allow building\nit when the gpio_set_value() is left out of the kernel.\n\nReviewed-by: Jonas Gorski <jonas.gorski@gmail.com>\nSigned-off-by: Arnd Bergmann <arnd@arndb.de>\n---\n drivers/net/dsa/b53/b53_common.c | 17 +++++------------\n drivers/net/dsa/b53/b53_priv.h | 25 +++++++++++++++++++------\n 2 files changed, 24 insertions(+), 18 deletions(-)", "diff": "diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c\nindex 2c4131ed7e30..d838511ae674 100644\n--- a/drivers/net/dsa/b53/b53_common.c\n+++ b/drivers/net/dsa/b53/b53_common.c\n@@ -19,7 +19,7 @@\n \n #include <linux/delay.h>\n #include <linux/export.h>\n-#include <linux/gpio.h>\n+#include <linux/gpio/consumer.h>\n #include <linux/kernel.h>\n #include <linux/math.h>\n #include <linux/minmax.h>\n@@ -965,17 +965,17 @@ EXPORT_SYMBOL(b53_configure_vlan);\n \n static void b53_switch_reset_gpio(struct b53_device *dev)\n {\n-\tint gpio = dev->reset_gpio;\n+\tstruct gpio_desc *gpio = dev->reset_gpio;\n \n-\tif (gpio < 0)\n+\tif (IS_ERR(gpio))\n \t\treturn;\n \n \t/* Reset sequence: RESET low(50ms)->high(20ms)\n \t */\n-\tgpio_set_value(gpio, 0);\n+\tgpiod_set_value(gpio, 0);\n \tmdelay(50);\n \n-\tgpio_set_value(gpio, 1);\n+\tgpiod_set_value(gpio, 1);\n \tmdelay(20);\n \n \tdev->current_page = 0xff;\n@@ -3092,7 +3092,6 @@ static int b53_switch_init(struct b53_device *dev)\n {\n \tu32 chip_id = dev->chip_id;\n \tunsigned int i;\n-\tint ret;\n \n \tif (is63xx(dev))\n \t\tchip_id = BCM63XX_DEVICE_ID;\n@@ -3173,12 +3172,6 @@ static int b53_switch_init(struct b53_device *dev)\n \t\treturn -ENOMEM;\n \n \tdev->reset_gpio = b53_switch_get_reset_gpio(dev);\n-\tif (dev->reset_gpio >= 0) {\n-\t\tret = devm_gpio_request_one(dev->dev, dev->reset_gpio,\n-\t\t\t\t\t GPIOF_OUT_INIT_HIGH, \"robo_reset\");\n-\t\tif (ret)\n-\t\t\treturn ret;\n-\t}\n \n \treturn 0;\n }\ndiff --git a/drivers/net/dsa/b53/b53_priv.h b/drivers/net/dsa/b53/b53_priv.h\nindex 923d56bbd061..ad0c65a9bdc3 100644\n--- a/drivers/net/dsa/b53/b53_priv.h\n+++ b/drivers/net/dsa/b53/b53_priv.h\n@@ -149,7 +149,7 @@ struct b53_device {\n \tu8 duplex_reg;\n \tu8 jumbo_pm_reg;\n \tu8 jumbo_size_reg;\n-\tint reset_gpio;\n+\tstruct gpio_desc *reset_gpio;\n \tu8 num_arl_bins;\n \tu16 num_arl_buckets;\n \tenum dsa_tag_protocol tag_protocol;\n@@ -468,23 +468,36 @@ static inline void b53_arl_search_read(struct b53_device *dev, u8 idx,\n #ifdef CONFIG_BCM47XX\n \n #include <linux/bcm47xx_nvram.h>\n+#include <linux/gpio.h>\n #include <bcm47xx_board.h>\n-static inline int b53_switch_get_reset_gpio(struct b53_device *dev)\n+static inline struct gpio_desc *b53_switch_get_reset_gpio(struct b53_device *dev)\n {\n \tenum bcm47xx_board board = bcm47xx_board_get();\n+\tint gpio, ret;\n \n \tswitch (board) {\n \tcase BCM47XX_BOARD_LINKSYS_WRT300NV11:\n \tcase BCM47XX_BOARD_LINKSYS_WRT310NV1:\n-\t\treturn 8;\n+\t\tgpio = 8;\n+\t\tbreak;\n \tdefault:\n-\t\treturn bcm47xx_nvram_gpio_pin(\"robo_reset\");\n+\t\tgpio = bcm47xx_nvram_gpio_pin(\"robo_reset\");\n \t}\n+\n+\tif (!gpio_is_valid(gpio))\n+\t\treturn ERR_PTR(-EINVAL);\n+\n+\tret = devm_gpio_request_one(dev->dev, gpio,\n+\t\t\t\t GPIOF_OUT_INIT_HIGH, \"robo_reset\");\n+\tif (ret)\n+\t\treturn ERR_PTR(ret);\n+\n+\treturn gpio_to_desc(gpio);\n }\n #else\n-static inline int b53_switch_get_reset_gpio(struct b53_device *dev)\n+static inline struct gpio_desc *b53_switch_get_reset_gpio(struct b53_device *dev)\n {\n-\treturn -ENOENT;\n+\treturn ERR_PTR(-ENODEV);\n }\n #endif\n \n", "prefixes": [] }