get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2228952,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2228952/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-gpio/patch/20260427142924.2702598-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": "<20260427142924.2702598-1-arnd@kernel.org>",
    "date": "2026-04-27T14:28:29",
    "name": "[v4] wiznet: convert to GPIO descriptors",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "881e0213d5968abd9beef9f0240e949617d6613f",
    "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/20260427142924.2702598-1-arnd@kernel.org/mbox/",
    "series": [
        {
            "id": 501661,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/501661/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-gpio/list/?series=501661",
            "date": "2026-04-27T14:28:29",
            "name": "[v4] wiznet: convert to GPIO descriptors",
            "version": 4,
            "mbox": "http://patchwork.ozlabs.org/series/501661/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2228952/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2228952/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "\n <linux-gpio+bounces-35592-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=FRXPpZlD;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org;\n envelope-from=linux-gpio+bounces-35592-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=\"FRXPpZlD\"",
            "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201"
        ],
        "Received": [
            "from tor.lore.kernel.org (tor.lore.kernel.org\n [IPv6:2600:3c04:e001:36c::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 4g45gj0ZNsz1yHX\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 28 Apr 2026 00:34:57 +1000 (AEST)",
            "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id E0259302B530\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 27 Apr 2026 14:29:32 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 6A1CB3D412C;\n\tMon, 27 Apr 2026 14:29:31 +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 297C42F4A18;\n\tMon, 27 Apr 2026 14:29:30 +0000 (UTC)",
            "by smtp.kernel.org (Postfix) with ESMTPSA id 8B8BDC2BCB4;\n\tMon, 27 Apr 2026 14:29:27 +0000 (UTC)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1777300171; cv=none;\n b=bjr0xANaoD5E53zeeiXvr0h4zDh9Kz6ggpArfmThE0NGsMtlNx9LTzZXdr+n42uMSrUTmdsDler3x77O3M90jKxSZfaqW5W2DPBuFHCqTWLBqLiyu1kbSG5sTgqmCBR4br8ugUOzR3QZYxIo2ExkCpIN/94YUf3O9jtibI+tgXk=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1777300171; c=relaxed/simple;\n\tbh=Wl48KU7FFzY9tc+YJTHH50tO37f3gtqdY9BqM/ZabGA=;\n\th=From:To:Cc:Subject:Date:Message-Id:MIME-Version;\n b=A68dRmCaICB/lkHURMzdhDCj7ibY0DVkxHgi5aD1PsDnwR8yCezFOw4dE74j9O63trwjxM0Q+1kXlR2OFE5/SMkgY0BrmpJssFIaSlUFI1bL0hNPXa7EE552KKHT+6+0oxmMOqbocyHdCwu0gtH/2CDBwVRcQeA5iqvICd9WWAU=",
        "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=FRXPpZlD; 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=1777300170;\n\tbh=Wl48KU7FFzY9tc+YJTHH50tO37f3gtqdY9BqM/ZabGA=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=FRXPpZlDCJPy1KTUYNDV/98kbRfznaGgF/hnO2PPhup9kUcOz6vqiKDmNFEaJ2E1o\n\t 3N8fhOGopOGljrRdlbBmhMyvq3IgmBGnXDvEBjEjjvFA8EA9mRuONzB5UBGGsDgYxD\n\t cUu6ELVl41Ri5qlZff2NGV+CjpQqcaGgn69xKlAqfI3WQjvtuCdxS6QLu01jQuGUzf\n\t lFRA+BpKIC+bFj9ysC4xPruzXQ0LsE0SWg9z0e81C7FOBTcnPvPvPUk0nX/0+HAnUr\n\t rGZCo3mgNPySGdV53gLU++DqY3JD0v79IAVmQBdOizaPYuHQZwCEfmoCoVnZfONiOE\n\t UcqCpq1uew7cA==",
        "From": "Arnd Bergmann <arnd@kernel.org>",
        "To": "Andrew Lunn <andrew+netdev@lunn.ch>,\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\tRob Herring <robh@kernel.org>,\n\tKrzysztof Kozlowski <krzk+dt@kernel.org>,\n\tConor Dooley <conor+dt@kernel.org>,\n\tLinus Walleij <linusw@kernel.org>,\n\tBartosz Golaszewski <brgl@kernel.org>",
        "Cc": "Arnd Bergmann <arnd@arndb.de>,\n\tMarco Crivellari <marco.crivellari@suse.com>,\n\tnetdev@vger.kernel.org,\n\tdevicetree@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org,\n\tlinux-gpio@vger.kernel.org",
        "Subject": "[PATCH] [v4] wiznet: convert to GPIO descriptors",
        "Date": "Mon, 27 Apr 2026 16:28:29 +0200",
        "Message-Id": "<20260427142924.2702598-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 w5100/w5300 drivers only support probing with old platform data in\nMMIO mode, or probing with DT in SPI mode. There are no users of this\nplatform data in tree, and from the git history it appears that the only\nusers of MMIO mode were on the (since removed) blackfin architecture.\n\nRemove the platform data option, as it's unlikely to still be needed, and\nchange the internal operation to GPIO descriptors, making the behavior\nthe same for SPI and MMIO mode. The other data in the platform_data\nstructure is the MAC address, so make that also handled the same for both.\n\nIt would probably be possible to just remove the MMIO mode driver\ncompletely, but it seems fine otherwise, and fixing it to use the modern\ninterface seems easy enough.\n\nThe CONFIG_WIZNET_BUS_SHIFT value was apparently meant to be set\nat compile time to a machine specific value. This was always broken\nfor multiplatform configurations with conflicting requirements, and\nin the mainline kernel it was set to 0 anyway. Leave it defined\nlocally as 0 but rename it to something without the CONFIG_ prefix.\n\nAcked-by: Rob Herring <robh@kernel.org>\nSigned-off-by: Arnd Bergmann <arnd@arndb.de>\nLink: https://lore.kernel.org/all/20230127095839.3266452-1-arnd@kernel.org/\n---\nv4: rebase to 7.1\nv3: include linux/gpio/consumer.h to avoid build failure without GPIOLIB\nv2: replace CONFIG_WIZNET_BUS_SHIFT with a constant\n---\n .../devicetree/bindings/net/wiznet,w5x00.txt  |  4 +-\n drivers/net/ethernet/wiznet/w5100-spi.c       |  9 +--\n drivers/net/ethernet/wiznet/w5100.c           | 61 ++++++++++---------\n drivers/net/ethernet/wiznet/w5100.h           |  3 +-\n drivers/net/ethernet/wiznet/w5300.c           | 54 ++++++++--------\n include/linux/platform_data/wiznet.h          | 23 -------\n 6 files changed, 67 insertions(+), 87 deletions(-)\n delete mode 100644 include/linux/platform_data/wiznet.h",
    "diff": "diff --git a/Documentation/devicetree/bindings/net/wiznet,w5x00.txt b/Documentation/devicetree/bindings/net/wiznet,w5x00.txt\nindex e9665798c4be..e8a802d65817 100644\n--- a/Documentation/devicetree/bindings/net/wiznet,w5x00.txt\n+++ b/Documentation/devicetree/bindings/net/wiznet,w5x00.txt\n@@ -1,6 +1,6 @@\n * Wiznet w5x00\n \n-This is a standalone 10/100 MBit Ethernet controller with SPI interface.\n+This is a standalone 10/100 MBit Ethernet controller with SPI or MMIO interface.\n \n For each device connected to a SPI bus, define a child node within\n the SPI master node.\n@@ -9,6 +9,7 @@ Required properties:\n - compatible: Should be one of the following strings:\n \t      \"wiznet,w5100\"\n \t      \"wiznet,w5200\"\n+\t      \"wiznet,w5300\"\n \t      \"wiznet,w5500\"\n - reg: Specify the SPI chip select the chip is wired to.\n - interrupts: Specify the interrupt index within the interrupt controller (referred\n@@ -25,6 +26,7 @@ Optional properties:\n   According to the w5500 datasheet, the chip allows a maximum of 80 MHz, however,\n   board designs may need to limit this value.\n - local-mac-address: See ethernet.txt in the same directory.\n+- link-gpios: a GPIO line used for the link detection interrupt\n \n \n Example (for Raspberry Pi with pin control stuff for GPIO irq):\ndiff --git a/drivers/net/ethernet/wiznet/w5100-spi.c b/drivers/net/ethernet/wiznet/w5100-spi.c\nindex 990a3cce8c0f..0626fcb8db5a 100644\n--- a/drivers/net/ethernet/wiznet/w5100-spi.c\n+++ b/drivers/net/ethernet/wiznet/w5100-spi.c\n@@ -422,14 +422,7 @@ static int w5100_spi_probe(struct spi_device *spi)\n {\n \tconst struct w5100_ops *ops;\n \tkernel_ulong_t driver_data;\n-\tconst void *mac = NULL;\n-\tu8 tmpmac[ETH_ALEN];\n \tint priv_size;\n-\tint ret;\n-\n-\tret = of_get_mac_address(spi->dev.of_node, tmpmac);\n-\tif (!ret)\n-\t\tmac = tmpmac;\n \n \tdriver_data = (uintptr_t)spi_get_device_match_data(spi);\n \n@@ -450,7 +443,7 @@ static int w5100_spi_probe(struct spi_device *spi)\n \t\treturn -EINVAL;\n \t}\n \n-\treturn w5100_probe(&spi->dev, ops, priv_size, mac, spi->irq, -EINVAL);\n+\treturn w5100_probe(&spi->dev, ops, priv_size, spi->irq);\n }\n \n static void w5100_spi_remove(struct spi_device *spi)\ndiff --git a/drivers/net/ethernet/wiznet/w5100.c b/drivers/net/ethernet/wiznet/w5100.c\nindex c5424d882135..62b2f24106cd 100644\n--- a/drivers/net/ethernet/wiznet/w5100.c\n+++ b/drivers/net/ethernet/wiznet/w5100.c\n@@ -11,7 +11,6 @@\n #include <linux/netdevice.h>\n #include <linux/etherdevice.h>\n #include <linux/platform_device.h>\n-#include <linux/platform_data/wiznet.h>\n #include <linux/ethtool.h>\n #include <linux/skbuff.h>\n #include <linux/types.h>\n@@ -23,7 +22,8 @@\n #include <linux/ioport.h>\n #include <linux/interrupt.h>\n #include <linux/irq.h>\n-#include <linux/gpio.h>\n+#include <linux/gpio/consumer.h>\n+#include <linux/of_net.h>\n \n #include \"w5100.h\"\n \n@@ -139,6 +139,10 @@ MODULE_LICENSE(\"GPL\");\n #define W5500_RX_MEM_START\t0x30000\n #define W5500_RX_MEM_SIZE\t0x04000\n \n+#define WIZNET_BUS_SHIFT 0\t/* possibly machine specific */\n+\n+#define W5100_BUS_DIRECT_SIZE  (0x8000 << WIZNET_BUS_SHIFT)\n+\n /*\n  * Device driver private data structure\n  */\n@@ -157,7 +161,7 @@ struct w5100_priv {\n \n \tint irq;\n \tint link_irq;\n-\tint link_gpio;\n+\tstruct gpio_desc *link_gpio;\n \n \tstruct napi_struct napi;\n \tstruct net_device *ndev;\n@@ -204,13 +208,13 @@ static inline void __iomem *w5100_mmio(struct net_device *ndev)\n  */\n static inline int w5100_read_direct(struct net_device *ndev, u32 addr)\n {\n-\treturn ioread8(w5100_mmio(ndev) + (addr << CONFIG_WIZNET_BUS_SHIFT));\n+\treturn ioread8(w5100_mmio(ndev) + (addr << WIZNET_BUS_SHIFT));\n }\n \n static inline int __w5100_write_direct(struct net_device *ndev, u32 addr,\n \t\t\t\t       u8 data)\n {\n-\tiowrite8(data, w5100_mmio(ndev) + (addr << CONFIG_WIZNET_BUS_SHIFT));\n+\tiowrite8(data, w5100_mmio(ndev) + (addr << WIZNET_BUS_SHIFT));\n \n \treturn 0;\n }\n@@ -729,8 +733,8 @@ static u32 w5100_get_link(struct net_device *ndev)\n {\n \tstruct w5100_priv *priv = netdev_priv(ndev);\n \n-\tif (gpio_is_valid(priv->link_gpio))\n-\t\treturn !!gpio_get_value(priv->link_gpio);\n+\tif (priv->link_gpio)\n+\t\treturn !!gpiod_get_value(priv->link_gpio);\n \n \treturn 1;\n }\n@@ -943,7 +947,7 @@ static irqreturn_t w5100_detect_link(int irq, void *ndev_instance)\n \tstruct w5100_priv *priv = netdev_priv(ndev);\n \n \tif (netif_running(ndev)) {\n-\t\tif (gpio_get_value(priv->link_gpio) != 0) {\n+\t\tif (gpiod_get_value(priv->link_gpio) != 0) {\n \t\t\tnetif_info(priv, link, ndev, \"link is up\\n\");\n \t\t\tnetif_carrier_on(ndev);\n \t\t} else {\n@@ -998,8 +1002,8 @@ static int w5100_open(struct net_device *ndev)\n \tw5100_hw_start(priv);\n \tnapi_enable(&priv->napi);\n \tnetif_start_queue(ndev);\n-\tif (!gpio_is_valid(priv->link_gpio) ||\n-\t    gpio_get_value(priv->link_gpio) != 0)\n+\tif (!priv->link_gpio ||\n+\t    gpiod_get_value(priv->link_gpio) != 0)\n \t\tnetif_carrier_on(ndev);\n \treturn 0;\n }\n@@ -1037,15 +1041,10 @@ static const struct net_device_ops w5100_netdev_ops = {\n \n static int w5100_mmio_probe(struct platform_device *pdev)\n {\n-\tstruct wiznet_platform_data *data = dev_get_platdata(&pdev->dev);\n-\tconst void *mac_addr = NULL;\n \tstruct resource *mem;\n \tconst struct w5100_ops *ops;\n \tint irq;\n \n-\tif (data && is_valid_ether_addr(data->mac_addr))\n-\t\tmac_addr = data->mac_addr;\n-\n \tmem = platform_get_resource(pdev, IORESOURCE_MEM, 0);\n \tif (!mem)\n \t\treturn -EINVAL;\n@@ -1058,8 +1057,7 @@ static int w5100_mmio_probe(struct platform_device *pdev)\n \tif (irq < 0)\n \t\treturn irq;\n \n-\treturn w5100_probe(&pdev->dev, ops, sizeof(struct w5100_mmio_priv),\n-\t\t\t   mac_addr, irq, data ? data->link_gpio : -EINVAL);\n+\treturn w5100_probe(&pdev->dev, ops, sizeof(struct w5100_mmio_priv), irq);\n }\n \n static void w5100_mmio_remove(struct platform_device *pdev)\n@@ -1075,13 +1073,13 @@ void *w5100_ops_priv(const struct net_device *ndev)\n EXPORT_SYMBOL_GPL(w5100_ops_priv);\n \n int w5100_probe(struct device *dev, const struct w5100_ops *ops,\n-\t\tint sizeof_ops_priv, const void *mac_addr, int irq,\n-\t\tint link_gpio)\n+\t\tint sizeof_ops_priv, int irq)\n {\n \tstruct w5100_priv *priv;\n \tstruct net_device *ndev;\n \tint err;\n \tsize_t alloc_size;\n+\tu8 tmpmac[ETH_ALEN];\n \n \talloc_size = sizeof(*priv);\n \tif (sizeof_ops_priv) {\n@@ -1127,7 +1125,9 @@ int w5100_probe(struct device *dev, const struct w5100_ops *ops,\n \tpriv->ndev = ndev;\n \tpriv->ops = ops;\n \tpriv->irq = irq;\n-\tpriv->link_gpio = link_gpio;\n+\tpriv->link_gpio = gpiod_get_optional(dev, \"link\", GPIOD_IN);\n+\tif (IS_ERR(priv->link_gpio))\n+\t\treturn PTR_ERR(priv->link_gpio);\n \n \tndev->netdev_ops = &w5100_netdev_ops;\n \tndev->ethtool_ops = &w5100_ethtool_ops;\n@@ -1154,8 +1154,9 @@ int w5100_probe(struct device *dev, const struct w5100_ops *ops,\n \tINIT_WORK(&priv->setrx_work, w5100_setrx_work);\n \tINIT_WORK(&priv->restart_work, w5100_restart_work);\n \n-\tif (mac_addr)\n-\t\teth_hw_addr_set(ndev, mac_addr);\n+\terr = of_get_mac_address(dev->of_node, tmpmac);\n+\tif (!err)\n+\t\teth_hw_addr_set(ndev, tmpmac);\n \telse\n \t\teth_hw_addr_random(ndev);\n \n@@ -1180,7 +1181,7 @@ int w5100_probe(struct device *dev, const struct w5100_ops *ops,\n \tif (err)\n \t\tgoto err_hw;\n \n-\tif (gpio_is_valid(priv->link_gpio)) {\n+\tif (priv->link_gpio) {\n \t\tchar *link_name = devm_kzalloc(dev, 16, GFP_KERNEL);\n \n \t\tif (!link_name) {\n@@ -1188,12 +1189,14 @@ int w5100_probe(struct device *dev, const struct w5100_ops *ops,\n \t\t\tgoto err_gpio;\n \t\t}\n \t\tsnprintf(link_name, 16, \"%s-link\", netdev_name(ndev));\n-\t\tpriv->link_irq = gpio_to_irq(priv->link_gpio);\n+\t\tpriv->link_irq = gpiod_to_irq(priv->link_gpio);\n \t\tif (request_any_context_irq(priv->link_irq, w5100_detect_link,\n \t\t\t\t\t    IRQF_TRIGGER_RISING |\n \t\t\t\t\t    IRQF_TRIGGER_FALLING,\n-\t\t\t\t\t    link_name, priv->ndev) < 0)\n-\t\t\tpriv->link_gpio = -EINVAL;\n+\t\t\t\t\t    link_name, priv->ndev) < 0) {\n+\t\t\tgpiod_put(priv->link_gpio);\n+\t\t\tpriv->link_gpio = NULL;\n+\t\t}\n \t}\n \n \treturn 0;\n@@ -1217,7 +1220,7 @@ void w5100_remove(struct device *dev)\n \n \tw5100_hw_reset(priv);\n \tfree_irq(priv->irq, ndev);\n-\tif (gpio_is_valid(priv->link_gpio))\n+\tif (priv->link_gpio)\n \t\tfree_irq(priv->link_irq, ndev);\n \n \tflush_work(&priv->setrx_work);\n@@ -1254,8 +1257,8 @@ static int w5100_resume(struct device *dev)\n \t\tw5100_hw_start(priv);\n \n \t\tnetif_device_attach(ndev);\n-\t\tif (!gpio_is_valid(priv->link_gpio) ||\n-\t\t    gpio_get_value(priv->link_gpio) != 0)\n+\t\tif (!priv->link_gpio ||\n+\t\t    gpiod_get_value(priv->link_gpio) != 0)\n \t\t\tnetif_carrier_on(ndev);\n \t}\n \treturn 0;\ndiff --git a/drivers/net/ethernet/wiznet/w5100.h b/drivers/net/ethernet/wiznet/w5100.h\nindex 481af3b6d9e8..013ef2835115 100644\n--- a/drivers/net/ethernet/wiznet/w5100.h\n+++ b/drivers/net/ethernet/wiznet/w5100.h\n@@ -29,8 +29,7 @@ struct w5100_ops {\n void *w5100_ops_priv(const struct net_device *ndev);\n \n int w5100_probe(struct device *dev, const struct w5100_ops *ops,\n-\t\tint sizeof_ops_priv, const void *mac_addr, int irq,\n-\t\tint link_gpio);\n+\t\tint sizeof_ops_priv, int irq);\n void w5100_remove(struct device *dev);\n \n extern const struct dev_pm_ops w5100_pm_ops;\ndiff --git a/drivers/net/ethernet/wiznet/w5300.c b/drivers/net/ethernet/wiznet/w5300.c\nindex 3e711dea3b2c..303c04cb7fc4 100644\n--- a/drivers/net/ethernet/wiznet/w5300.c\n+++ b/drivers/net/ethernet/wiznet/w5300.c\n@@ -12,7 +12,6 @@\n #include <linux/netdevice.h>\n #include <linux/etherdevice.h>\n #include <linux/platform_device.h>\n-#include <linux/platform_data/wiznet.h>\n #include <linux/ethtool.h>\n #include <linux/skbuff.h>\n #include <linux/types.h>\n@@ -24,7 +23,8 @@\n #include <linux/ioport.h>\n #include <linux/interrupt.h>\n #include <linux/irq.h>\n-#include <linux/gpio.h>\n+#include <linux/gpio/consumer.h>\n+#include <linux/of_net.h>\n \n #define DRV_NAME\t\"w5300\"\n #define DRV_VERSION\t\"2012-04-04\"\n@@ -80,6 +80,10 @@ MODULE_LICENSE(\"GPL\");\n #define W5300_S0_RX_FIFO\t0x0230\t/* S0 Receive FIFO */\n #define W5300_REGS_LEN\t\t0x0400\n \n+#define WIZNET_BUS_SHIFT 0\n+\n+#define W5300_BUS_DIRECT_SIZE  (0x0400 << WIZNET_BUS_SHIFT)\n+\n /*\n  * Device driver private data structure\n  */\n@@ -91,7 +95,7 @@ struct w5300_priv {\n \tvoid (*write)(struct w5300_priv *priv, u16 addr, u16 data);\n \tint irq;\n \tint link_irq;\n-\tint link_gpio;\n+\tstruct gpio_desc *link_gpio;\n \n \tstruct napi_struct napi;\n \tstruct net_device *ndev;\n@@ -113,13 +117,13 @@ struct w5300_priv {\n  */\n static inline u16 w5300_read_direct(struct w5300_priv *priv, u16 addr)\n {\n-\treturn ioread16(priv->base + (addr << CONFIG_WIZNET_BUS_SHIFT));\n+\treturn ioread16(priv->base + (addr << WIZNET_BUS_SHIFT));\n }\n \n static inline void w5300_write_direct(struct w5300_priv *priv,\n \t\t\t\t      u16 addr, u16 data)\n {\n-\tiowrite16(data, priv->base + (addr << CONFIG_WIZNET_BUS_SHIFT));\n+\tiowrite16(data, priv->base + (addr << WIZNET_BUS_SHIFT));\n }\n \n /*\n@@ -292,8 +296,8 @@ static u32 w5300_get_link(struct net_device *ndev)\n {\n \tstruct w5300_priv *priv = netdev_priv(ndev);\n \n-\tif (gpio_is_valid(priv->link_gpio))\n-\t\treturn !!gpio_get_value(priv->link_gpio);\n+\tif (priv->link_gpio)\n+\t\treturn !!gpiod_get_value(priv->link_gpio);\n \n \treturn 1;\n }\n@@ -442,7 +446,7 @@ static irqreturn_t w5300_detect_link(int irq, void *ndev_instance)\n \tstruct w5300_priv *priv = netdev_priv(ndev);\n \n \tif (netif_running(ndev)) {\n-\t\tif (gpio_get_value(priv->link_gpio) != 0) {\n+\t\tif (gpiod_get_value(priv->link_gpio) != 0) {\n \t\t\tnetif_info(priv, link, ndev, \"link is up\\n\");\n \t\t\tnetif_carrier_on(ndev);\n \t\t} else {\n@@ -485,8 +489,8 @@ static int w5300_open(struct net_device *ndev)\n \tw5300_hw_start(priv);\n \tnapi_enable(&priv->napi);\n \tnetif_start_queue(ndev);\n-\tif (!gpio_is_valid(priv->link_gpio) ||\n-\t    gpio_get_value(priv->link_gpio) != 0)\n+\tif (!priv->link_gpio ||\n+\t    gpiod_get_value(priv->link_gpio) != 0)\n \t\tnetif_carrier_on(ndev);\n \treturn 0;\n }\n@@ -524,7 +528,6 @@ static const struct net_device_ops w5300_netdev_ops = {\n \n static int w5300_hw_probe(struct platform_device *pdev)\n {\n-\tstruct wiznet_platform_data *data = dev_get_platdata(&pdev->dev);\n \tstruct net_device *ndev = platform_get_drvdata(pdev);\n \tstruct w5300_priv *priv = netdev_priv(ndev);\n \tconst char *name = netdev_name(ndev);\n@@ -533,11 +536,9 @@ static int w5300_hw_probe(struct platform_device *pdev)\n \tint irq;\n \tint ret;\n \n-\tif (data && is_valid_ether_addr(data->mac_addr)) {\n-\t\teth_hw_addr_set(ndev, data->mac_addr);\n-\t} else {\n-\t\teth_hw_addr_random(ndev);\n-\t}\n+        ret = of_get_ethdev_address(pdev->dev.of_node, ndev);\n+        if (ret)\n+                eth_hw_addr_random(ndev);\n \n \tpriv->base = devm_platform_get_and_ioremap_resource(pdev, 0, &mem);\n \tif (IS_ERR(priv->base))\n@@ -568,17 +569,22 @@ static int w5300_hw_probe(struct platform_device *pdev)\n \t\treturn ret;\n \tpriv->irq = irq;\n \n-\tpriv->link_gpio = data ? data->link_gpio : -EINVAL;\n-\tif (gpio_is_valid(priv->link_gpio)) {\n+\tpriv->link_gpio = gpiod_get_optional(&pdev->dev, \"link\", GPIOD_IN);\n+\tif (IS_ERR(priv->link_gpio))\n+\t\treturn PTR_ERR(priv->link_gpio);\n+\n+\tif (priv->link_gpio) {\n \t\tchar *link_name = devm_kzalloc(&pdev->dev, 16, GFP_KERNEL);\n \t\tif (!link_name)\n \t\t\treturn -ENOMEM;\n \t\tsnprintf(link_name, 16, \"%s-link\", name);\n-\t\tpriv->link_irq = gpio_to_irq(priv->link_gpio);\n+\t\tpriv->link_irq = gpiod_to_irq(priv->link_gpio);\n \t\tif (request_any_context_irq(priv->link_irq, w5300_detect_link,\n \t\t\t\tIRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,\n-\t\t\t\tlink_name, priv->ndev) < 0)\n-\t\t\tpriv->link_gpio = -EINVAL;\n+\t\t\t\tlink_name, priv->ndev) < 0) {\n+\t\t\tpriv->link_gpio = NULL;\n+\t\t\tgpiod_put(priv->link_gpio);\n+\t\t}\n \t}\n \n \tnetdev_info(ndev, \"at 0x%llx irq %d\\n\", (u64)mem->start, irq);\n@@ -633,7 +639,7 @@ static void w5300_remove(struct platform_device *pdev)\n \n \tw5300_hw_reset(priv);\n \tfree_irq(priv->irq, ndev);\n-\tif (gpio_is_valid(priv->link_gpio))\n+\tif (priv->link_gpio)\n \t\tfree_irq(priv->link_irq, ndev);\n \n \tunregister_netdev(ndev);\n@@ -665,8 +671,8 @@ static int w5300_resume(struct device *dev)\n \t\tw5300_hw_start(priv);\n \n \t\tnetif_device_attach(ndev);\n-\t\tif (!gpio_is_valid(priv->link_gpio) ||\n-\t\t    gpio_get_value(priv->link_gpio) != 0)\n+\t\tif (!priv->link_gpio ||\n+\t\t    gpiod_get_value(priv->link_gpio) != 0)\n \t\t\tnetif_carrier_on(ndev);\n \t}\n \treturn 0;\ndiff --git a/include/linux/platform_data/wiznet.h b/include/linux/platform_data/wiznet.h\ndeleted file mode 100644\nindex 1154c4db8a13..000000000000\n--- a/include/linux/platform_data/wiznet.h\n+++ /dev/null\n@@ -1,23 +0,0 @@\n-/* SPDX-License-Identifier: GPL-2.0-or-later */\n-/*\n- * Ethernet driver for the WIZnet W5x00 chip.\n- */\n-\n-#ifndef PLATFORM_DATA_WIZNET_H\n-#define PLATFORM_DATA_WIZNET_H\n-\n-#include <linux/if_ether.h>\n-\n-struct wiznet_platform_data {\n-\tint\tlink_gpio;\n-\tu8\tmac_addr[ETH_ALEN];\n-};\n-\n-#ifndef CONFIG_WIZNET_BUS_SHIFT\n-#define CONFIG_WIZNET_BUS_SHIFT 0\n-#endif\n-\n-#define W5100_BUS_DIRECT_SIZE\t(0x8000 << CONFIG_WIZNET_BUS_SHIFT)\n-#define W5300_BUS_DIRECT_SIZE\t(0x0400 << CONFIG_WIZNET_BUS_SHIFT)\n-\n-#endif /* PLATFORM_DATA_WIZNET_H */\n",
    "prefixes": [
        "v4"
    ]
}